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

Rashii Henry
Rashii Henry
16,433 Points

1 of 3 Challenge Tasks Create an array named 'booksArray' with the following book titles: 'Hamlet', 'King Lear', 'Othello', 'Macbeth'.

is there anything wrong with my code?

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

What lesson is this?

2 Answers

Brendan O'Brien
Brendan O'Brien
9,066 Points

For the code challenge, yes. The left side of your equation needs some work.

Rashii Henry
Rashii Henry
16,433 Points

whats the matter with it? how do i know when im suppose to use self on the code challenges?

Rashii you may want to go read some Objective C primers before jumping into iOS development.

Brendan O'Brien
Brendan O'Brien
9,066 Points

Rashii Henry, you won't need to use self in the code challenges. At least I haven't had to so far and I'm just a few lessons ahead of you.

Rashii Henry
Rashii Henry
16,433 Points

okay, i believe thats where i was confused.

Rashii Henry
Rashii Henry
16,433 Points

Ernest, where would i find those?

Trevor Gerzen
Trevor Gerzen
2,749 Points

If you simply remove self from Rashii's statement above it doesn't work. What am I missing?

Rashii Henry
Rashii Henry
16,433 Points

i think i put on the left side

NSArray *booksArray =