Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Apr 13, 2009, 10:07 PM   #1
macrumors newbie
Join Date: Jan 2009
How to add these object with name to the array by this order?

I have some object with name , just like button 1 , button 2 , button 11 ,button 111 , I want to add this object to a array by this order: button 1 ,button 2 , button 11 , button 111, but I found that these object can add the array by thhis order: button 1 , button 11,button 111 , button 2.why ? Thank you for your answer!
xiaohuli170 is offline   0 Reply With Quote
Old Apr 13, 2009, 10:15 PM   #2
macrumors 68040
lee1210's Avatar
Join Date: Jan 2005
Location: Dallas, TX
Are you sorting before you insert or inserting then sorting? The issue is that a lexicographical sort instead of a numeric sort on the second "token". You should have options on sorting this differently. What are you using to sort now?

lee1210 is offline   0 Reply With Quote
Old Apr 13, 2009, 10:16 PM   #3
macrumors 6502a
Join Date: Oct 2006
Location: Virginia
You can add items to an array in whatever order you like.

If you post the code you used to add these items, someone can point out why it didn't work as you expected.
eddietr is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
How to supercharge Mini? ranny2 Mac mini 18 Oct 27, 2011 08:53 PM
How To Remove Server Part Of Lion? hhaydenn iMac 2 Aug 18, 2011 05:21 PM
How to init object using string name of the class? Sergio10 iPhone/iPad Programming 1 Jan 18, 2010 06:56 AM
How to manipulate multiple objects with similar names happybob iPhone/iPad Programming 10 Apr 23, 2009 12:29 AM
Safari -- How to Add More Favorite Item Icons to the ToolBar? tolive Mac Applications and Mac App Store 5 Feb 4, 2007 10:06 PM

All times are GMT -5. The time now is 04:22 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC