I use NSSortDescriptors to sort my arrays, but there are other ways. The following code is an example.
Code:
NSSortDescriptor *lastNameDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastName" ascending:YES];
[peopleArray sortUsingDescriptors:[NSArray arrayWithObject:lastNameSorter]];
In the in the NSSortDescriptor alloc-init line, you'll have to change the initWithKey parameter from lastName to whatever the name of your last name variable is. You'll also have to have a property declared for your last name variable before you can use is as a key.