NSNumber *number = [[NSNumber new];
For (int i = 0, i<10 , i++){
number = [NSNumber numberWithInt:i];
[array addObject:number];
}
這樣的結果會是
10
10
10
10
10
10
10
10
10
10
For (int i = 0, i<10 , i++){
NSNumber *number = [[NSNumber new];
number = [NSNumber numberWithInt:i];
[array addObject:number];
}
而這樣的結果才會是
1
2
3
4
5
6
7
8
9
10
沒有留言:
張貼留言