开发者

How to reorder a NSMutable array on the basis of NSString stored into it?

I have an array of NSString, I want to move a particu开发者_C百科lar NSString onto zero index of that array. I am getting values into array after sorting it.

How can I implement it?


You can use exchangeObjectAtIndex:withObjectAtIndex: method if you want to swap two strings in the mutable array.


Have a look at -[NSArray sortedArrayUsingComparator:] and -[NSMutableArray insertObject:atIndex:].

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜