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 trialDan Szeezil
2,823 PointsProblem with addNewPun
I am getting an error msg "No none class message for selector 'punWithTitle:rating" when I run the code. My code seems to match Anit's so I dont know the problem. Here is the section and the error shows up on the first line of the method. I suspect I am missing something elsewhere. Thx
(void) addNewPun {
self.pun = [Pun punWithTitle:self.textView.text rating:self.ratingSlider.value];
[self.delegate addPunToList:self.pun];
[self.navigationController dismissModalViewControllerAnimated:YES];
}
9 Answers
Stone Preston
42,016 Pointsdo you have that method declared and defined in your Pun.h and Pun.m files?
Dan Szeezil
2,823 PointsNo, but neither does Anit. I dont know what this custom method does, so I dont know how to implement it. In fact, at the 9:36 mark in the Saving Data Part 1, he gets the same error in the LIstViewController and just deletes the code and sets the array to nil (for some reason). These videos insert & remove code without telling you so often - it is really frustrating.
Stone Preston
42,016 Pointshmm that looks like a custom convenience constructor, which means it has to be defined in your Pun class. are you sure he doesnt have it?
Dan Szeezil
2,823 PointsAt 1:18, he shows both Pun.h & m and neither have a declaration/implementation of punWithTitle:rating:
Stone Preston
42,016 Pointswhen he called that method does he make any mention of "we havent implemented this method yet but we are going to do that later" or something. Did you watch the whole video?
Dan Szeezil
2,823 PointsNot that I recall and I have watched it twice
Stone Preston
42,016 Pointsok tagging Amit Bijlani maybe he can answer whats going on
Amit Bijlani
Treehouse Guest TeacherIf you check out the setup video at the 4 minute mark I show you that the basic model is already created as part of the project. This a short course which is primarily focused on storyboards so the convenience constructor is provided for you. You can download the project files and see the implementation.
Dan Szeezil
2,823 Pointswhy is this constructor no longer in Pun.h & m at the 1:18 mark of Saving Data Part 1 ?
Amit Bijlani
Treehouse Guest TeacherSince that is a stage on Core Data and Pun
is a subclass of NSManagedObject
we do things differently.
Dan Szeezil
2,823 Pointsand where should I start using the provided Pun project file? should I assume we are not using previous Pun project files for every video and download the zip file every time? There is no mention of which file to use in the video; our files from previous videos or the zip on the page.
Amit Bijlani
Treehouse Guest TeacherEach video page has project files associated to it so that you can review the code that was added in that video.
Dan Szeezil
2,823 PointsAnd you can no longer implement punWithTitle statically because title & rating have been changed to dynamic. How should I proceed?
Amit Bijlani
Treehouse Guest TeacherI'm guessing you are now referring to Core Data. You can create a convenience constructor if you want. As the name state it's mainly meant for convenience and not required.
Amit Bijlani
Treehouse Guest TeacherI'd highly recommend following the iOS Development Track which is kind of like a playlist of courses that guides you which course to take next. We are going to be retiring iOS Foundations soon because it is a bit dated.
Thomas Nilsen
14,957 PointsWill there be a replacement for this once it's taken down? Also, the new IOS course is coming soon (can't wait!), but no date set yet. Do you know when it will be released?
Amit Bijlani
Treehouse Guest TeacherThere won't be an exact replacement but we will be replacing it with some exciting new content. We will be releasing the new course on March 24th. I've updated the roadmap.