Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Sorting NSArray
View Single Post
Old 09-06-2008, 08:00 PM   #1 (permalink)
bergetun
New Member
 
Join Date: Aug 2008
Posts: 31
Default Sorting NSArray

Im having a hard time understanding how sorting of arrays are working in ObjC.

I have a simple class (Person) that have a couple of properties such as name, phoneNumber, address etc.

Then I have a array of Person's in a NSArray.

How can I easily sort the array based on names in the Person class ?

This is how I would do it in C#

Array.Sort(_myPersonArray, delegate(Result x, Result y)
{
return x.Name.CompareTo(y.Name);
});
bergetun is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,825
Threads: 89,207
Posts: 380,637
Top Poster: BrianSlick (7,129)
Welcome to our newest member, srishtimehta
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:39 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.