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

Help answer

Hi,

can someone give the answer to this statement...I wrote in my opion write but it gives me error...

thanks romesh

Stone Preston
Stone Preston
42,016 Points

can you please post your code

Hi Stone,

thanks for the answer...the chellenge ask: Create an array named 'booksArray' with the following book titles: 'Hamlet', 'King Lear', 'Othello', 'Macbeth'.

then i wrote this:

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

but doesn't work gives me error...

thanks...

3 Answers

Gareth Borcherds
Gareth Borcherds
9,372 Points

self.booksArray would only work if you had already created the property in your header file for booksArray. Since it doesn't you need create the pointer to booksArray and the initialize it. So it would look like:

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

Thanks for the answer...as I followed again the video it says to set the property on the header file and then initialized on implementation file but can't really understand how this challenge works...Can you give me the answer so I understand how it works?sorry I am new be and dummy,,,,

:(

Gareth Borcherds
Gareth Borcherds
9,372 Points

Same challenge or a different one? You might want to go back and complete the intro to C course to help you get a better understanding of all of these concepts. They are crucial to understand.

No Gareth, the challenge number 1 of the Build a Blog Reader Iphone App... I need just a hint to understand how it works...

Gareth Borcherds
Gareth Borcherds
9,372 Points

the full set of answers to this challenge is

NSArray *booksArray = [NSArray arrayWithObjects:@"Hamlet", @"King Lear", @"Othello", @"Macbeth", nil];
NSString *bookTitle = [booksArray objectAtIndex:2];
[bookTitle uppercaseString];

Thanks a lot....

Best

Romesh

Hi Stone,

thanks for the answer...the chellenge ask: Create an array named 'booksArray' with the following book titles: 'Hamlet', 'King Lear', 'Othello', 'Macbeth'.

then i wrote this:

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

but doesn't work gives me error...

thanks...

Stone Preston
Stone Preston
42,016 Points

the reason its not workng is because you need to create a new NSArray object, and not use a property. try

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

Ok...now I try...

thanks