Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 15, 2013, 04:32 PM   #1
nashyo
macrumors 6502
 
Join Date: Oct 2010
Location: Bristol
Loading a storyboard manually

I want to change how the storyboard is loaded in my App. I am having immense difficulty. All my searchings through Google has failed.

I am using an Apple Dev Video for guidance 'WWDC 2012 Adopting Storyboards in your App' - which describes how to add a storyboard (in the hope that I can learn more of what little support is out there).

So far: I have removed the storyboard name from 'Main Storyboard' in the 'summary' section of project settings.

I have updated the App delegate as follows:

Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    UIStoryboard *authStoryboard = [UIStoryboard storyboardWithName:@"Authenticate_iPad" bundle:nil];
    UINavigationController *navigationController = [authStoryboard instantiateInitialViewController];

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        
    self.window.rootViewController = navigationController;
        
    [self.window makeKeyAndVisible];
    return YES;
}
Error: Could not instantiate NSLayoutConstraint

Any ideas?
__________________
Xcode 4.5.2, SDK 6.0, OSX Mountain Lion, ARC
nashyo is offline   0 Reply With Quote
Old Jan 16, 2013, 07:15 AM   #2
KoolStar
macrumors Demi-God
 
KoolStar's Avatar
 
Join Date: Oct 2006
Location: Kentucky
Send a message via AIM to KoolStar Send a message via Skype™ to KoolStar
Quick question, are you building and targeting for iOS 5? If so you need to disable AutoLayout as it is not supported in iOS 5, its only supported in iOS 6. The reason I ask is that you are probably using XCode 4.5.x and when you create a new nib or storyboard autolayout is enabled by default. If you are targeting iOS 5 it will not work.

You can disable auto layout on the storyboard by opening the storyboard and pressing command option 1 which will open the inspector view for the nib/storyboard. About half way down it will have a check box for auto layout. You simply need to uncheck the box.

See image below:
__________________
"Innovation distinguishes between a leader and a follower." : S.J.
KoolStar is offline   1 Reply With Quote
Old Jan 18, 2013, 09:40 AM   #3
nashyo
Thread Starter
macrumors 6502
 
Join Date: Oct 2010
Location: Bristol
Thank you KoolStar this worked!
__________________
Xcode 4.5.2, SDK 6.0, OSX Mountain Lion, ARC
nashyo is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Tags
manual, remove, storyboard

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
App Store loading...loading...loading evilrt iPhone Tips, Help and Troubleshooting 0 Sep 22, 2013 09:05 AM
Storyboard error hassoon iPhone/iPad Programming 0 Mar 15, 2013 07:19 PM
Storyboard problem ildandi iPhone/iPad Programming 9 Nov 12, 2012 02:59 PM
Storyboard and languages ildandi iPhone/iPad Programming 0 Nov 11, 2012 09:24 AM
Storyboard Question RagingGoat iPhone/iPad Programming 1 Sep 28, 2012 12:07 PM

Forum Jump

All times are GMT -5. The time now is 07:21 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC