开发者

how to use extern variable string in iphone

i want to access string from one class to other class in ipho开发者_开发百科ne application

or how to use extern variable in iphone.

thanks in advance


use NSUserDefault or use extern varible...create .h file first clear all syntex in .h file then write extern NSString *name declaration, then inialise into appdelegate initialization file as above the implementation section just like NSString *name; now whenever you want to use name string in any file you just want declare your .h file and you can use your name variable..
example

extern NSString *userBlnc;  
extern NSString *canReq;   
extern NSString *userName; 

declaration in appdelegate.m

#import "Config.h"

NSString *userBlnc;  
NSString *canReq;  
NSString *userName; 

@implementation ***************  


You have to have a look at Setter and Getter theory.


Declare them in your header as follows:

extern NSString *const kExternForExample;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜