Help me in adding objects in array of app delegate from UIViewController in Objective-C I guess I am doing mistake, help me in this regard
I want to add objects in array of app delegate from view controller
in appdelegate.h
@property (nonatomic, retain) NSMutableArray *sharedArray;
in appdelegate.m
@implementation AppDelegate
@synthesize sharedArray;
inside didfinishlaunching
self.sharedArray = [[NSMutableArray alloc] init];
in ViewController
@interface ViewController () {
UIApplication *appDelegate;
Inside viewdidload of viewcontroller
appDelegate = [[UIApplication sharedApplication] delegate];
[appdelegate.sharedArray addObject:array];
appDelegateinViewController