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 Blog Reader iPhone App Exploring the Master-Detail Template Modifying the Master-Detail Template

Swapnil Kapse
Swapnil Kapse
1,162 Points

Query in first challenge in app development for blog reader with Master details template.

HI For below challenge :

Create an array named 'booksArray' with the following book titles: 'Hamlet', 'King Lear', 'Othello', 'Macbeth'.

I have written code lines as

self.booksArray = [NSArray arrayWithObjects:@"Hamlet", @"King Lear", @"Othello", @"Macbeth", nil]; This is same as shown in tutorial and working in xcode too. But, not in editor shown in the challenge. It asks me to check variable name. Has anyone faced this? I am not able to proceed further due to this issue. Please help.

self.booksArray  = [NSArray arrayWithObjects:@"Hamlet", @"King Lear", @"Othello", @"Macbeth", nil];

2 Answers

NSArray *booksArray = [NSArray arrayWithObjects:@"Hamlet", @"KingLear", @"Othello", @"Macbeth",nil];

Stephen Wall
Stephen Wall
Courses Plus Student 27,294 Points

NSArray *booksArray = [NSArray arrayWithObjects: @"Hamlet", @"King Lear", @"Othello", @"Macbeth", nil];

You wouldn't use self in this situation as self has not yet been defined. Just wants you to create a new array.