Objective-C, sorting muti-dimensional arrays

后端 未结 2 1465
清酒与你
清酒与你 2021-01-23 21:32

I\'ve been having some trouble with sorting multi-dimensional arrays in Objective-C. I basically have an array of which every element is an array of the form:

(         


        
2条回答
  •  既然无缘
    2021-01-23 21:52

    in most cases, you would create an object:

    @interface MONObject : NSObject
    {
      NSString * a;
      NSDate * b;
      NSString * c;
      NSString * d;
    }
    ...
    

    then teach it to compare itself to others, then use those objects in the array. logical organization of data and implementation.

提交回复
热议问题