@interface SimataDetailViewController()
@property Simata *simata;
@property (nonatomic, copy) NSMutableArray *simataList;
@end
@implementation SimataDetailViewController
@synthesize simataDataController=_simataDataController;
@synthesize category=_category;
@synthesize simata=_simata;
@synthesize simataList=_simataList;
#pragma mark - Managing the detail item
- (void) getSimataForCategory: (NSString *) inputCategory {
unsigned count = [self.simataDataController.masterList2 count];
while (count--) {
if ([[[self.simataDataController objectSimataInListAtIndex:count] categoryCode] isEqual:inputCategory]){
self.simata= [self.simataDataController objectSimataInListAtIndex:count];
[self.simataList addObject:self.simata];
}
}
NSLog(@"count, %u", [self.simataList count]);
}
안녕하세요. 첫 번째 게시물입니다.NSMutableArray 배열에 객체를 추가 할 수 없습니다.
배열 에 객체 self.simata
을 추가하려고하지만 배열에 0 개의 객체가 남아 있습니다. 객체 self.simata
은 nil
이 아니며 오류가 발생하지 않습니다.
내가 뭘 잘못하고 있니?
초보자로 상당히 알기 쉬운 게시물을 만들기위한 +1 크레딧) –
[NSMutableArray addObject not working] 가능한 복제본 (http : // stackoverflow. co.kr/questions/1827058/nsmutablearray-addobject-not-working) 및 [항목을 NSMutableArray에 추가 할 수 없습니다] (http://stackoverflow.com/questions/7125326/cannot-add-items-to-an-nsmutablearray-ivar) –