0

detailTexts私はfloatからの彼のデータを持っているという名前の配列を持っています:

CLLocation *location = [[CLLocation alloc] initWithLatitude:dlog longitude:dlig];
**CLLocationDistance meters = [userLocation distanceFromLocation:location];**
**float detailFloat = meters * 1000;**
if (meters < 10000) {
    NSLog(@"%@", detailText);
    [tableData addObject:name];
    **detailText = [NSString stringWithFormat:@"%f", detailFloat];**
    **[detailTexts addObject:detailText];**
}

配列を並べ替えて、最初にほぼ位置を取得するにはどうすればよいですか?(私はmysqlでそれを知っています:SORT BY ...)

Xcode 4.3(更新バージョン)、Mac OS X Lion

4

1 に答える 1

2
NSArray *sortedArray =
             [detailTexts sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
于 2012-07-03T18:44:48.763 に答える