Tôi có một NSMutableArraythêm đối tượng NSInteger để NSMutableArray
@interface DetailViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
NSMutableArray *reponses;
}
@property (nonatomic, retain) NSMutableArray *reponses;
@end
và tôi đang cố gắng để thêm vào mảng NSInteger đối tượng của tôi:
@synthesize reponses;
NSInteger val2 = [indexPath row];
[reponses addObject:[NSNumber numberWithInteger:val2]];
NSLog(@"the array is %@ and the value is %i",reponses, val2);
nó sẽ không làm việc đối tượng đã không được thêm vào mảng, đây là giao diện điều khiển hiển thị:
the array is (null) and the value is 2
đúng thx –