Xcode 4.2 iOS Empty Application and storyboards

后端 未结 3 1594
北荒
北荒 2020-12-13 09:16

I\'m an Xcode newbie, and I\'m trying to make my first training app. Since apparently Empty Application template is the only template that offers pre-integrated Core Data, I

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 09:58

    The Master-Detail and Utility project templates also offer Core Data as an option.

    The Apple templates for Core Data are pretty horrible. They stuff far too much functionality into the app delegate and they use lazy loading unnecessarily, which just complicates things even further.

    You're better off looking at the generated code and adding the functionality as a separate class in a project you start without Core Data.

    To answer your immediate question though, the default empty template creates a window programmatically in the app delegate's application:didFinishLaunchingWithOptions: method. The story board sets a window up itself, so you need to remove that code from the app delegate. The only thing you need in that method is return YES;.

提交回复
热议问题