5

I'm trying to change my App's main interface which currently is set to a .xib file in the project's "General Configuration Pane" to a new storyboard.

I have created the storyboard, and selected it as the main interface. But when I launch the application in simulator, I get a black screen and the following message printed in the console : "There is no app delegate set. An app delegate class must be specified to use a main storyboard file."

How should I do that ?

Sepehrom
  • 1,335
  • 2
  • 16
  • 33
  • 1
    did you set mainWindow – codercat Jan 20 '14 at 06:03
  • I don't know what you mean exactly, but I didn't specifically set anything about main window ! – Sepehrom Jan 20 '14 at 06:05
  • post your code or link your sample project – codercat Jan 20 '14 at 06:18
  • 1
    Seeing your comment suggestion to attention to the "window", I searched about setting the window a bit, and this solved my problem : http://stackoverflow.com/questions/13272346/the-app-delegate-must-implement-the-window-property-if-it-wants-to-use-a-main-st – Sepehrom Jan 20 '14 at 06:23

3 Answers3

5

The app delegate class is generally specified in main.m:

int main(int argc, char *argv[])
{
  @autoreleasepool {
      return UIApplicationMain(argc, argv, nil, NSStringFromClass([TCAppDelegate class]));
  }
}
Dave Batton
  • 8,795
  • 1
  • 46
  • 50
1

did you set mainWindow if you are not please set your window in your project

codercat
  • 22,873
  • 9
  • 61
  • 85
0

In didFinishLaunchingWithOptions method put these code lines .

UIStoryboard *storyBoard; = [UIStoryboard storyboardWithName:@"yourStoryboardName" bundle:nil];
 UIViewController *initViewController = [storyBoard instantiateInitialViewController];
      [self.window setRootViewController:initViewController];

return Yes ;
codercat
  • 22,873
  • 9
  • 61
  • 85
Saurav Mac
  • 82
  • 5