Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-10-2010, 12:54 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2009
Location: I'm a Brit-pat.
Posts: 171
Default Tab Bar Application Code Not Running

Hi all,

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
coulls is offline   Reply With Quote
Old 03-10-2010, 01:53 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 23
Default

Quote:
Originally Posted by coulls View Post
Hi all,

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....
tin pot is offline   Reply With Quote
Old 03-10-2010, 04:00 PM   #3 (permalink)
Registered Member
 
Join Date: Mar 2009
Location: I'm a Brit-pat.
Posts: 171
Default

Quote:
Originally Posted by tin pot View Post
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...

This is bizzare!
coulls is offline   Reply With Quote
Old 03-10-2010, 04:16 PM   #4 (permalink)
Registered Member
 
Join Date: Mar 2009
Location: I'm a Brit-pat.
Posts: 171
Default

Found the solution... I'm being an idiot.

Quote:
..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.
coulls is offline   Reply With Quote
Reply

Bookmarks

Tags
tab bar application, viewdidappear, viewdidload

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 258
17 members and 241 guests
ADY, Alsahir, dacapo, Dani77, Desert Diva, djohnson, F_Bryant, Grinarn, HemiMG, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,762
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0