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 choose that. However, after that, I can't get UI to work (it remains empty).
What I did:
I tried diffing against another project that I created as a Tab Bar Application (which does reflect my Storyboard changes), without any insight.
Comment out (or remove) the window creation and display code in AppDelegate.m as follows:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
// self.window.backgroundColor = [UIColor whiteColor];
// [self.window makeKeyAndVisible];
return YES;
}
When using a storyboard, a main UIWindow is created for you automatically. What is happening in your case is that you are creating another white window and putting it over the top of the tab UI.
ALSO - note that the Master/Detail template also gives you a core data option.
For an Empty Application project, you have to do two things, after you've added your Storyboard file...
Add a row to your project Info.plist file:
Key: Main storyboard file base name
Value: Storyboard
(or whatever you named your storyboard file)
Delete the contents of application:didFinishLaunchingWithOptions:
except return YES;
:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
return YES;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With