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 trialChristine Rose
6,745 PointsI think I'm using another version of Xcode. The class wasn't UIViewController, & the Cocoa template was quite different
The class is UIView, not ViewController, and I couldn't change it. ViewController wasn't even an option. The second View Controller I added also has the class UIView.
When I added a new file using the Cocoa template (called Cocoa, not Cocoa Touch), the contents were quite different indeed.
What's up?
8 Answers
Steve Hunter
57,712 PointsHi Christine,
I'm on the up-to-date version of Xcode and don't get the behaviour you describe.
I'm wondering, have you selected iOS
rather than OS X
on the left? That should give you Cocoa Touch, rather than Cocoa.
Let me know i that helps.
Steve.
Christine Rose
6,745 PointsI'm sure I selected iOS. The top right says: iOS SDK 8.2, and I'm using the iPhone 5s size because my simulator runs SO SLOW normally, and with iPhone 6, it takes 5 minutes just to load the simulator. Any tips on how to run that faster? I'm working on a rather old MacBook Pro (late 2008) with 4GB RAM. I'm considering an iMac in the near future with 16GB.
I figured out what I was doing wrong on the first bit. In the storyboard, I was selecting the entire storyboard instead of just the yellow View Controller button at the top, so I got that figured out.
Christine Rose
6,745 PointsEven with the Cocoa Touch, the override func methods still aren't in there they way they are in the video. Maybe I'm doing something else wrong?
Thanks for your help, Steve.
Christine Rose
6,745 PointsI tried an Android simulator once, and I gave up quickly. Too much for a n00bie like me! So far this at least works and I'm finally seeing the relevance to the coding I've learned by seeing it in action. That's the best thing!
Love StackOverflow. I'll try there. Thanks.
Paulo Braga
5,381 PointsI'm having the same problems... When I create the new class PlaylistDetailViewController inherited from PlaylistMasterViewController I do not get it the standard functions (viewDidLoad() and didReceiveMemoryWarning()).
My Xcode version: Version 6.3 (6D570)
Julian Scharf
2,007 PointsI also took a wrong turn here.
I made the same mistake by picking OS X (cocoa) instead of iOS (cocoa touch).
Aubrey Taylor
2,991 PointsI also ran into this. Thanks for the help!
Christine Rose
6,745 PointsYep. You're right. When I added the new file, it was OS X, even though the project was iOS. THANKS! !!
Steve Hunter
57,712 PointsMy Xcode doesn't tell me about the SDK version - I might have turned that off, though.
I've never had a problem with the iOS simulator - the standard Android one really does take about a week to run a basic 'Hello World' - drives me nuts! I don't if there are any tips to make the iOS one run more quickly. Have a look around in StackOverflow, there's all the answers in there!
As long as you can get your class up and working, that's great!
Steve.
Jivago Raymond
1,851 PointsJivago Raymond
1,851 PointsProbably because when creating your PlaylistDetailViewController class, you selected the wrong subclass.. IE: You selected "Subclass of UIView" instead of "Subclass of UIViewController". The methods generated with UIView are different.