I’ll try to explain as best I can:
I have two classes I’m currently focusing on. A Database Class and a View Controller, everything is currently set up like this:
View.h – Has “Database* myDatabase;”
View.m – Calls “OpenDB” during ViewLoad and has a button method that uses: [myDatabase getRow]; when clicked.
Database.h – Has “sqlite3 db;”
Database.m – Has “getRow” method and “openDB”, which uses the “db” declared in Database.h.
This causes no errors during build, but when my program runs, when I click my button [myDatabase getRow]; does nothing. I used NSLog just inside the method and it never gets called. If it’s hard to understand, I’ll post code snippets, but I thought it would just be too much code.
Typically when you’re not seeing a message that you’re expecting to see, and the circumstances of it are completely baffling, it’s because the receiver of the message is nil.
Put a breakpoint inside your viewDidLoad and make sure that myDatabase actually has a value assigned to it.
“po myDatabase” in gdb…
If in fact myDatabase is actually non-nil, then the second source of lots of grief trying to figure out why something’s not happening the way you expect it to is missing connections in your XIB.
Make sure that your button’s action is wired to your controller, or if you’re programmatically setting the button’s action, then make sure that your controller’s outlet to the button is wired up.