Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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 =