hinzufügen NSInteger Objekt NSMutableArray

Ich habe ein NSMutableArray

@interface DetailViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {

NSMutableArray *reponses;
}
@property (nonatomic, retain) NSMutableArray *reponses;

@end

und ich versuche, in meinem array NSInteger Objekt:

@synthesize reponses;



NSInteger val2 = [indexPath row];
[reponses addObject:[NSNumber numberWithInteger:val2]];
NSLog(@"the array is %@ and the value is %i",reponses, val2);

funktioniert es nicht, das Objekt wurde nicht dem array Hinzugefügt, das ist, was die Konsole zeigt:

the array is (null) and the value is 2
Schreibe einen Kommentar