How to add these object with name to the array by this order?

Discussion in 'Mac Programming' started by xiaohuli170, Apr 13, 2009.

  1. xiaohuli170 macrumors newbie

    Jan 13, 2009
    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!
  2. lee1210 macrumors 68040


    Jan 10, 2005
    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?

  3. eddietr macrumors 6502a

    Oct 29, 2006
    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.

Share This Page