• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sorting Array Alphabetically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting Array Alphabetically


  • Subject: Re: Sorting Array Alphabetically
  • From: Shamyl Zakariya <email@hidden>
  • Date: Fri, 13 Apr 2007 09:57:53 -0400

Look at NSMutableArray
- (void) sortUsingSelector:
- (void) sortUsingFunction:(int (*)(id, id, void *))compare context: (void *)context
- (void) sortUsingDescriptors:(NSArray *)sortDescriptors


I think the first one will work the way you want by passing NSString's compare:

Shamyl Zakariya
	"there is no emoticon, for what I am feeling"



On Apr 13, 2007, at 8:53 AM, Micha Fuhrmann wrote:

Hi there!


I've looked around and couldn't find anything.

I've got a NSMutableArray with Strings in it. Po the Array in gdb gives the list of it with the strings and not objects such as:

<NSCFArray 0x3a3e80>(
Nightmares On Wax,
John Martyn,
The Kinks,....

Now, I'd like to sort this Array Alphabetically, how do I go about?

Any help would be appreciated. Also, if I've missed something, like NSMutableArray shouldn't be filled with plain strings but objects in manner to give me more control please let me know.

Micha
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Sorting Array Alphabetically
      • From: Deborah Goldsmith <email@hidden>
References: 
 >Sorting Array Alphabetically (From: Micha Fuhrmann <email@hidden>)

  • Prev by Date: Re: Getting the context of a context menu
  • Next by Date: Re: Getting the context of a context menu
  • Previous by thread: Sorting Array Alphabetically
  • Next by thread: Re: Sorting Array Alphabetically
  • Index(es):
    • Date
    • Thread