About Me
Blog Archive
-
►
2011
(1)
- ► 01/02 - 01/09 (1)
-
►
2010
(7)
- ► 08/29 - 09/05 (5)
- ► 08/22 - 08/29 (2)
-
►
2008
(14)
- ► 12/14 - 12/21 (1)
- ► 12/07 - 12/14 (1)
- ► 11/02 - 11/09 (12)
Followers
Wednesday, August 22, 2012
Iphone Numeric sorting
Iphone Numeric sorting For Array objects
NSArray *unsortedArray = [NSArray arrayWithObjects:@"Hello", @"4", @"Hi", @"5", @"2", @"10", @"1", nil];
NSArray *sortedArray = [unsortedArray sortedArrayUsingComparator:^(id firstObject, id secondObject) {
return [((NSString *)firstObject) compare:((NSString *)secondObject) options:NSNumericSearch];
}];Iphone Numeric sorting string For Array objects
Subscribe to:
Comments (Atom)
