ここで概説したものと同様の問題があります: Has xcode 4.5 changed sortedArrayUsingComparator + blocks?
int index = [AAjouter indexOfObject:match inSortedRange:NSMakeRange(0, [AAjouter count]) options:NSBinarySearchingInsertionIndex usingComparator:^(id obj1, id obj2) {
Match *match1 = (Match *) obj1;
Match *match2 = (Match *) obj2;
if ([match1.matchDate isEqualToDate:match2.matchDate]) {
if ([match1.paysCompetition isEqualToString:match2.paysCompetition]) {
if ([[NSNumber numberWithInt:match1.ordreCompetition] isEqualToNumber:[NSNumber numberWithInt:match2.ordreCompetition]]) {
if ([match1.equipeANom isEqualToString:match2.equipeANom]) {
return NSOrderedSame;
}
else {
return [match1.equipeANom compare:match2.equipeANom];
}
}
else {
return [[NSNumber numberWithInt:match1.ordreCompetition] compare:[NSNumber numberWithInt:match2.ordreCompetition]];
}
}
else {
return [match1.paysCompetition compare:match2.paysCompetition];
}
}
else {
return [match1.matchDate compare:match2.matchDate];
}
}];
[AAjouter insertObject:match atIndex:index]; 壊す;
次のエラー メッセージが表示されます。
「戻り値の型 'NSComparaisonResult' (別名 'NSComparaisonResult') は、以前の戻り値の型 'NSIntger' (別名 'int') と一致する必要があります」
各コード行の後:
return [[NSNumber numberWithInt:match1.ordreCompetition] compare:[NSNumber numberWithInt:match2.ordreCompetition]];
return [match1.paysCompetition compare:match2.paysCompetition];
return [match1.matchDate compare:match2.matchDate];
アイデアはありますか?