Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Diary App Using Core Data Inserting and Saving Data UI for Inserting Diary Entries

Guilherme Akio Sakae
Guilherme Akio Sakae
8,383 Points

Missing window property

Hi,

I was getting this error when I hit the run button: The app delegate must implement the window property if it wants to use a main storyboard file.

Sounds like a have to add one line in my AppDelegate.h with this new property.

@property (strong, nonatomic) UIWindow *window;

It's correct? Because I didn't saw this explanation in the video

Thanks

2 Answers

Guilherme,

In this episode you create a new Storyboard user interface file. As the instructor mentions, doing this requires you to make a change to the app delegate file to remove the creation of the window property. This is because the storyboard will be responsbile for creating the initial application window. The video instructed you to remove the line below in the app delegate .m file:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

You also need to make sure that in the project target you set the Main Interface parameter to the new storyboard file that you created. Have you done both of these steps? I suspect that the Main Interface parameter is not set to your new storyboard file.

Guilherme Akio Sakae
Guilherme Akio Sakae
8,383 Points

Yes i have done this steps, I don't know why but my app delegate .h file doesn't have the window property, I probably have deleted accidentally so I added back and everything started working again.

Thanks for the reply.