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 Build a Playlist Browser with Objective-C Managing Playlist Data Using a Playlist Instance

No visible @interface for ‘Playlist’ declares the selector 'initWithIndex:'

Hello guys,

I'm very new to IOS development. I followed every step of this video and the previous videos. It was working until I typed the following in the "PlaylistMasterViewController.m":

Playlist *playlist=[[Playlist alloc] initWithIndex:0];

It gives me the error message:

No visible @interface for ‘Playlist’ declares the selector 'initWithIndex:'

Any ideas? Thanks in advance!

1 Answer

Martin Shay
Martin Shay
5,919 Points

i can only guess at your exact issue, but i am able to recreate the problem by removing the following from my Playlist.h file:

- (instancetype)initWithIndex:(NSUInteger)index;

for me, intuitively, the key phrase is "No visible @interface…"; this means that your code can't find that thing that you know exists. this "visibility" issue is about something being absent from the header, as the header is how classes "publicize" their contents to other classes.