Video Tutorial: NSArray

Learn about one of the most useful classes in iOS development, NSArray, along with the most common ways you’ll use it in practice. By Ray Wenderlich.

Leave a rating/review
Save for later
Share

Contents

Hide contents

Video Tutorial: NSArray

1 min

Challenge

Your challenge is to add this code to the end of your project and implement the TOODs:

NSMutableArray *favoriteFood = [NSMutableArray 
  arrayWithObjects:@"Pizza", @"Sushi", @"Toe Jam", @"Yellow Snow", nil];
// TODO 1: Convert to use literal syntax
// TODO 2: Remove any non-favorite food
// TODO 3: Add at least 1 new favorite food
// TODO 4: Iterate through list and print out each item (use for loop and literal syntax)

Download demo code

Download challenge solution

Helpful links

Errata

  • At 12:45, when discussing literal syntax, I say “and you don’t have to put nil”. For clarifiation, it’s an error if you *do* put nil. It won’t compile if you put plain nil, and if you try casting nil to a type, it will compile but crash at runtime.

Contributors

Over 300 content creators. Join our team.