私はNSMutableArray
のプロパティを定義しました。 initWithObjects
を呼び出した直後は、count
は0です。私はここで何が欠けていますか?ここに私のコードは次のとおりです。initWithObjectの後のNSMutableArray数は0です
@interface MainViewController()
@property NSMutableArray *photos;
@end
- (void)viewDidLoad {
[super viewDidLoad];
_photos = [_photos initWithObjects:@"1", @"2", @"3", nil];
NSLog(@"Photos count: %lu",(unsigned long)_photos.count); //prints 0
}
ありがとうございます。しかし、1つしか受け入れられません:) – MayaReo