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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 05-26-2011, 10:34 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 180
shnaps is on a distinguished road
Default Alternate NIB file for root view controller.

I am adding the paid-functionality in my lite-version of the app....and need some help.

I had incorporated iAds in the lite version - so the NIB file for the root VC has the banner view and such that go along w/ iAds. For the paid version, I have conditionally compiled out the iAd code with #ifdefs. Both versions of the app compile fine; but only the lite version runs in the Simulator.

When I run the paid version, i get crash w/ the following stack trace.

Code:
2011-05-26 08:33:44.453 GoalBuggerFull[78022:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SPAppViewController 0x63393c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ivPatAppText.'
*** Call stack at first throw:
(
	0   CoreFoundation                      0x00e8fbe9 __exceptionPreprocess + 185
	1   libobjc.A.dylib                     0x00fe45c2 objc_exception_throw + 47
	2   CoreFoundation                      0x00e8fb21 -[NSException raise] + 17
	3   Foundation                          0x0004d6cf _NSSetUsingKeyValueSetter + 135
	4   Foundation                          0x0004d63d -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
	5   UIKit                               0x004cc8d6 -[UIRuntimeOutletConnection connect] + 112
	6   CoreFoundation                      0x00e062cf -[NSArray makeObjectsPerformSelector:] + 239
	7   UIKit                               0x004cb2ed -[UINib instantiateWithOwner:options:] + 1041
	8   UIKit                               0x004cd081 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
	9   UIKit                               0x00385a94 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
	10  UIKit                               0x00383709 -[UIViewController loadView] + 120
	11  UIKit                               0x003835e3 -[UIViewController view] + 56
	12  GoalBuggerFull                      0x00002a52 -[SPAppAppDelegate application:didFinishLaunchingWithOptions:] + 572
	13  UIKit                               0x002d61fa -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
	14  UIKit                               0x002d855e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
	15  UIKit                               0x002e2db2 -[UIApplication handleEvent:withNewEvent:] + 1533
	16  UIKit                               0x002db202 -[UIApplication sendEvent:] + 71
	17  UIKit                               0x002e0732 _UIApplicationHandleEvent + 7576
	18  GraphicsServices                    0x01732a36 PurpleEventCallback + 1550
	19  CoreFoundation                      0x00e71064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
	20  CoreFoundation                      0x00dd16f7 __CFRunLoopDoSource1 + 215
	21  CoreFoundation                      0x00dce983 __CFRunLoopRun + 979
	22  CoreFoundation                      0x00dce240 CFRunLoopRunSpecific + 208
	23  CoreFoundation                      0x00dce161 CFRunLoopRunInMode + 97
	24  UIKit                               0x002d7fa8 -[UIApplication _run] + 636
	25  UIKit                               0x002e442e UIApplicationMain + 1160
	26  GoalBuggerFull                      0x0000ad96 main + 102
	27  GoalBuggerFull                      0x0000280d start + 53
	28  ???                                 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
I think it is because of the fact that the NIB file still refers to the outlets for the iAd (because I don't have two versions of the NIB file).....

Now comes my question:

Is there a way to specify an alternate NIB file for the root view controller? If not, how can I get around the problem?

BTW, for the other NIB files, I am planning to have alternate versions - and since the code refer to them explicitly, I can put them in #ifdefs. I just don't know how to deal w/ the root VC's NIB file.
__________________
Regards,
=S=
******************
Currently in AppStore:
******************
iNotate - Annotate pictures, re-edit the text, upload them to FB or email them
MultiSnaps - Shoot pictures and send multiple pictures from the app to custom distribution list
TimeSnaps - Schedule a shoot, shoot pictures and send multiple pictures from the app to custom distribution list
GoalBugger - Free app to set and track goals that you want to achieve
******************
shnaps is offline   Reply With Quote
Old 05-26-2011, 11:15 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2009
Location: Kyiv, Ukraine
Posts: 27
Nikh is on a distinguished road
Default

While loading nib file all outlets are resolved and if there is no corresponding property/selector it raises the error. If the difference with paid version in 1-2 outlets i'd recommend to set them programmatically, in applicationDidFinishLoading.
__________________
ToDo Lists by AntLogic - quick and powerful tasks management
Nikh is offline   Reply With Quote
Old 05-26-2011, 11:24 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 180
shnaps is on a distinguished road
Default

Quote:
Originally Posted by Nikh View Post
While loading nib file all outlets are resolved and if there is no corresponding property/selector it raises the error. If the difference with paid version in 1-2 outlets i'd recommend to set them programmatically, in applicationDidFinishLoading.
Thanks for the suggestion....

Actually, that's what I am trying to do by having the alternate nib file in which the IBOutlets for the iAd are not present. The nib file is ready to go - however, I can't figure out how to select the root nib file for the appropriate version of the app.

__________________
Regards,
=S=
******************
Currently in AppStore:
******************
iNotate - Annotate pictures, re-edit the text, upload them to FB or email them
MultiSnaps - Shoot pictures and send multiple pictures from the app to custom distribution list
TimeSnaps - Schedule a shoot, shoot pictures and send multiple pictures from the app to custom distribution list
GoalBugger - Free app to set and track goals that you want to achieve
******************
shnaps is offline   Reply With Quote
Old 05-27-2011, 08:18 AM   #4 (permalink)
Registered Member
 
Join Date: Dec 2009
Location: Kyiv, Ukraine
Posts: 27
Nikh is on a distinguished road
Default

If you mean MainWindow.nib, you can try to use defines in info.plist, as it is preprocessed.
__________________
ToDo Lists by AntLogic - quick and powerful tasks management
Nikh is offline   Reply With Quote
Old 05-27-2011, 08:35 AM   #5 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 180
shnaps is on a distinguished road
Default

Quote:
Originally Posted by Nikh View Post
If you mean MainWindow.nib, you can try to use defines in info.plist, as it is preprocessed.
Thanks - and i found the same suggestion at

iphone - how do i change the default ViewController in xcode - Stack Overflow
__________________
Regards,
=S=
******************
Currently in AppStore:
******************
iNotate - Annotate pictures, re-edit the text, upload them to FB or email them
MultiSnaps - Shoot pictures and send multiple pictures from the app to custom distribution list
TimeSnaps - Schedule a shoot, shoot pictures and send multiple pictures from the app to custom distribution list
GoalBugger - Free app to set and track goals that you want to achieve
******************
shnaps is offline   Reply With Quote
Reply

Bookmarks

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: 344
6 members and 338 guests
doffing81, dre, iOS.Lover, jenniead38, Kirkout, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

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