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
Rashii Henry
16,433 PointsCustom Classes
How come for certain view controllers it wont let you add the custom class you created? For some view controllers it will list all of them and for others it wont.
4 Answers
Chris McKnight
Courses Plus Student 11,045 PointsI have had trouble with XCode not refreshing properly as well. I have had to restart XCode in some cases. Also, make sure that you drag out the correct type of view controller. Interface Builder won't let you set the custom class of a controller to a view controller that isn't the correct subclass. In other words, you can't select a subclass of UITableViewController for a UICollectionViewController IB object.
Stone Preston
42,016 Pointssometimes Xcode just doesnt refresh properly and doesnt see the viewcontroller you create. So either close the storyboard and reopen, and if it still doesnt show it in the drop down you can manually type in the name of the view controller.
Patrick Cooney
12,216 PointsAlso, make sure you're selecting the view controller and not the view within it or an element in the view. I know that sounds rookie but I still make that mistake on occasion after almost half a year.
Rashii Henry
16,433 PointsI've actually tried both of those suggestions before i made this post. It's actually frustrating and makes me feel like im doing something incorrectly.
Rashii Henry
16,433 PointsRashii Henry
16,433 PointsOMG! thank you that was exactly what i needed.
Chris McKnight
Courses Plus Student 11,045 PointsChris McKnight
Courses Plus Student 11,045 PointsAwesome. Glad to help. I have made that mistake before and after about 30 minutes realized that was my problem.