I have what I think is an easy problem, though the solution evades me right now.
I have a tab bar application with three views. The problem is when the middle view is shown I want to do some mapkit and gps stuff, but the code never runs.
At first, I put the code into the viewDidLoad event, stuck a breakpoint on it, and the breakpoint is never hit. So, I moved the code to the viewDidAppear event, and the same thing happened... the code doesn't seem to run, even though the view shows up.
I have what I think is an easy problem, though the solution evades me right now.
I have a tab bar application with three views. The problem is when the middle view is shown I want to do some mapkit and gps stuff, but the code never runs.
At first, I put the code into the viewDidLoad event, stuck a breakpoint on it, and the breakpoint is never hit. So, I moved the code to the viewDidAppear event, and the same thing happened... the code doesn't seem to run, even though the view shows up.
Has anyone else ever hit this issue?
Cheers,
Coulls
I'm going to make a random guess and suggest you check you've configured the outlets correctly in IB..?
Want to post some code?
__________________ Working on: 1st app
Status: PoC working.
iPhone Developer Program enrolled.
Alpha testing in progress....
I'm going to make a random guess and suggest you check you've configured the outlets correctly in IB..?
Want to post some code?
OK - Just tried something.
1. I put an NSLog in the applicationDidFinishLaunching, and that showed up in the console.
2. I put the same in all three views. Those don't show up. However, all code tied to the IBActions and Outlets runs if I hit a button, etc.
It's just the viewDidLoad and viewDidAppear that seem to not run...
..if you have a TabBarController with a view that's loaded from a nib, you must set the "Class Identity" of the "Tab View Controller Identity" to the same controller class you've set the "File's Owner" to in the nib that loads the actual view...
...You have to set the Class Identity in two places, not just in the nib of the view you are loading, but also in the TabBarController nib.