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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-05-2010, 01:23 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Location: Wien/Austria
Posts: 242
Default Sorting NSMutableArray Capital Matters

Hi Folks,

I am trying to sort a NSMutableArray with

Code:
[masterList sortUsingSelector:@selector(compare:)];
see what I get as result:

Here I have written Bianca Lehrner with a l

2010-03-05 19:18:04.989 myNetwork[15548:207] masterSorted: (
"Ant, Adam",
"Stremnitzer, Michael",
"lehrner, bianca",
"lehrner, felicitas",
"lehrner, laetitia",
"lehrner, stefan"
)

and here I have written Bianca Lehrner

2010-03-05 19:20:25.851 myNetwork[15562:207] masterSorted: (
"Ant, Adam",
"Lehrner, bianca",
"Stremnitzer, Michael",
"lehrner, felicitas",
"lehrner, laetitia",
"lehrner, stefan"
)

If Lehrner has a capital letter in the beginning, then the array is sorted as expected - that means Capital goes for "small" character... Can this be?

Thanks for your feedback,

Stefan
StefanL is offline   Reply With Quote
Old 03-05-2010, 01:33 PM   #2 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: UK
Posts: 1,886
Default

You can do a case insensitive compare if that's what you want?
Code:
[masterList sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
harrytheshark is offline   Reply With Quote
Old 03-05-2010, 01:37 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2009
Location: Wien/Austria
Posts: 242
Default

Quote:
Originally Posted by harrytheshark View Post
You can do a case insensitive compare if that's what you want?
Code:
[masterList sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
Hi Harry,

that was exactly what I wanted :-)

Thanks a lot and BR,

Stefan
StefanL is offline   Reply With Quote
Reply

Bookmarks

Tags
alphabetically, nsmutablearray, sort

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 261
23 members and 238 guests
ADY, AragornSG, bookesp, chillyh, dacapo, Dani77, Davey555, Desert Diva, Dominus, glenn_sayers, HemiMG, JasonR, LEARN2MAKE, M.A.S., marshusensei, mer10, nobre84, Oral B, prchn4christ, Raggou, Rudy, themathminister
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:30 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0