I have created a project without support of storyboards, but later I have added a storyboard. Storyboard work well and i see it's contents when loading app in emulator.
Then I created a view controller (UIViewController), and my problem is I can't bind any control from storyboard to my controller.
So my question is how to connect my controller with storyboard.
Those exact steps (I am using XCode 4.5 and iOS 6.0 ):
That is all. Now you should see your Initial view as you launch the project.
For XCode 6 and iOS8 beta2:
I've found answer on my own question. It's very simple: I should open storyboard, select view controller (it's visual representation on storyboard), then go to identity inspector and replace class UIViewController to your controller class
Add Main.storyboard
Add row in Info.plist > Main storyboard file base name:Main
Edit code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Override point for customization after application launch. return YES; }
Have you checked if the controls you want to connect have an corresponding IBOutlet or IBAction in the controller? Then you should be able to connect them as usual.
Don't forget to check the main.m:
#import <UIKit/UIKit.h>
#import "YourAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([YourAppDelegate class]));
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.