Saturday, November 26, 2011

extern variable in iPhoneSDK 5.0

extern or global variable

Create a new project,

Create extern variable in the header class
extern NSString *myexternalString;

in the implementation file define it at the top
NSString *myexternalString;

Now extern variable is ready you can set the value and use it in any other class you just have to import the header before using it in other classes.


here is the sample code

No comments:

Post a Comment