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
karl croft
458 PointsiOS > Getting to Know Arrays: Code Challenge
Hi, im stuck arrays, can anybody help.? Trying to acces first object in array
NSArray *myArray = [[NSArray alloc] initWithObjects: @"Apple", @"Orange", @"Banana", @"Plum",nil]; self.myArray.text = [myArray objectAtIndex:1];
3 Answers
Amit Bijlani
Treehouse Guest Teacher@karl you can always use the search and find answers on the forum because this has been asked previously: http://teamtreehouse.com/forum/access-the-first-fruit-in-your-array
Ezequiel Amaya
3,094 Pointsarrays start from index 0, so the first element is [myArray objectAtIndex:0];
karl croft
458 PointsThanks Ezequiel, my first trip to the forum and your response helped a lot more than only being passed on. K