私はintを持っていますが、何らかの理由で16かそこら後に機能しません。これが私のコードです:
NSArray *sortedArray;
sortedArray = [doesntContainAnother sortedArrayUsingFunction:firstNumSort context:NULL];
int count2 = [sortedArray count];
//NSLog(@"%d", count2);
int z = 0;
while (z < count2) {
NSString *myString = [sortedArray objectAtIndex:z];
NSString *intstring = [NSString stringWithFormat:@"%d", z];
NSString *stringWithoutSpaces;
stringWithoutSpaces = [[myString stringByReplacingOccurrencesOfString:intstring
withString:@""] mutableCopy];
[hopefulfinal addObject:stringWithoutSpaces];
NSLog(@"%@", [hopefulfinal objectAtIndex:z]);
z++;
}
編集:それはintではなく、stringWithoutSpaces行です...原因がわかりません。
したがって、それ(NSLog、z ++の上を参照)は次のようになります。
"ここ"
"なんでもいい"
「17何でも」
「18これ」
等