I am using an NSMutableArry to access ids at another viewController. when I add the object to the array I close the window go to another object. when I add the second object it shows only one object in the array.
ViewCotrlloerA.h
@property (strong, nonatomic)NSMutableArray *bookMarkItems;
ViewControllerA.m
- (IBAction)saveForLater:(UIButton *)sender
{
[self.bookMarkItems addObject:story_id];
NSLog(@"%@", bookMarkItems);
NSLog(@"%lu", (unsigned long)[bookMarkItems count]);
}
ViewControllerB.h
@class ViewControllerA;
@property (strong, nonatomic)ViewControllerA *sc;
ViewControllerB.m
self.sc.bookMarkItems = [[NSMutableArray alloc] init];
NSString *story_ids = [self.sc.bookMarkItems componentsJoinedByString:@","];
At this point story_ids is nil. Can anyone tell me why? I need to be able to store many story ids in controllerA and view them in ControllerB.