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

Changes In iOS Foundations Deep Dive: Notifications?

I think I'v noticed a few changes to this using Xcode 5 / iOS 7.

  • When creating the new project, I do not see a way to not use the StoryBoard.
  • I don't think it's necessary to add the notification code for the 2nd view controller in the AppDelegate. I couldn't figure out the AppDelegate code, so I added this line
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldChanged:) name:@"textFieldChanged" object:nil];  

in my SecondViewController implementation, and the app works.

Am I missing something, or are my observations correct?

Thanks, Rycardo

[EDIT: For some reason Line Returns and formatting isn't coming through above]

1 Answer

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Your observations are right. With Xcode 5, Storyboards are the default experience and there is no other option. Notification observers can be added anywhere, they don't have to be in the AppDelegate. As long as you add the observer within the view controller that needs it then you are fine.