I have assigned class varaible as....
[MyINFO setUsrID:[dict valueForKey:USERID]];
but when i access "usrID" on another view controller it gives EXC_BAD_ACESS error. Please sugges开发者_运维知识库t what changes should be done in MyINFO ?
There's a good Matt Gallagher post about Singletons, along with a clever macro for creating singletons in Objective-C. You can read it here.
Class variables do not work this way in Objective-C. You can create a singleton class and use instance variables of the singleton.
精彩评论