AppDelegate.h
@interface
AppDelegate : UIResponder
<UIApplicationDelegate>
{
NSMutableArray
*testArray;
}
@property(nonatomic,retain)NSMutableArray
*testArray;
AppDelegate.m
@synthesize
testArrayName;
-
(BOOL)application:(UIApplication
*)application didFinishLaunchingWithOptions:(NSDictionary
*)launchOptions
{
testArrayName
= [[NSMutableArray
alloc]init];
}
ViewController.h
#import
<UIKit/UIKit.h>
@class
appDelegate;
@interface
ViewController : UIViewController
{
appDelegate
*appdelegate;
}
ViewController.m
#import
"ViewController.h"
#import
“ appDelegate.h”
-
(void)viewDidLoad
{
appdelegate
= (AppDelegate
*)[[UIApplication
sharedApplication]delegate];
}
To
access the appdelegate varaable
Ex:
NSString
*Desp=[appdelegate.arrayDescList
objectAtIndex:appdelegate.objid1];
No comments:
Post a Comment