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 Implementing Designs for iPhone Customizing Table View Controllers Styling the Tab Bar

Michael Hulet
Michael Hulet
47,911 Points

Deprecation Warning

@Ben Jakuben: There's a little deprecation warning at around 5:40 in the attached video. It comes when we call the method setFinishedSelectedImage:withFinishedUnselectedImage:. This method was deprecated in iOS 7.0. Unfortunately, the new way of doing it involves separating this out into 2 lines.

The old code (for one UITabBarItem) is this:

[tabInbox setFinishedSelectedImage:@"inbox" withFinishedUnselectedImage:@"inbox"];

However, the new, non-deprecated code to do the same thing looks like this:

tabInbox.image = [[UIImage imageNamed:@"inbox"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
tabInbox.selectedImage = [[UIImage imageNamed:@"inbox"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

Unfortunately, as you can see, you now must split setting the image and selectedImage properties into 2 separate lines, and with each assignment, you must specify the UIImageRenderingMode for each image

1 Answer

Anthony Martinez
Anthony Martinez
13,111 Points

Great post. This deprecation warning should be included in the teachers notes of the lecture - Xcode pops up an alert bubble to let users know - students should get a heads up to avoid confusion :)