Global Data Declaration
AppDelegate.h :-
@property (nonatomic, retain) NSMutableArray *Selected_Multi_SLC_ID_Array;
@property (nonatomic) BOOL IS_GET_MODE;
@property (nonatomic) NSInteger Consol_Count;
@property (nonatomic, retain) NSString *SELECTED_TAB;
AppDelegate.m :-
@synthesize Selected_Multi_SLC_ID_Array , SELECTED_TAB, IS_GET_MODE, Consol_Count;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
Selected_Multi_SLC_ID_Array = [[NSMutableArray alloc] init];
IS_GET_MODE = NO;
Consol_Count = 0;
SELECTED_TAB = @"First";
}
ViewController.m :-
-(AppDelegate *)appDelegate
{
return (AppDelegate *) [[UIApplication sharedApplication] delegate];
}
//-------------- use Array Wherever you want
for(int i=loopCountSync; i<[[self appDelegate].Selected_Multi_SLC_ID_Array count]; i++)
{
NSLog(@"strSLC_ID : %@ ", [[self appDelegate].Selected_Multi_SLC_ID_Array objectAtIndex:i]);
}
//-------------- use BOOL Wherever you want
[self appDelegate].IS_GET_MODE = YES;
//-------------- use NSInteger Wherever you want
[self appDelegate].Consol_Count = 1;
//-------------- use NSString Wherever you want
[self appDelegate].SELECTED_TAB = @"Second";
No comments:
Post a Comment