I have defined @property(nonatomic,retain)NSString *usrId;
then assigned a value like this:
usrId=[Screen.Info valueForKey:@"id"];
Then in dealloc I am releasing the string usrId. This code is in a viewController which I am pushing to navController, then I’m popping it. But the next time I again push this viewController, an EXC_BAD_ACESS happens at the statement above.
Try assigning your value as
or
By doing it as you do it you just assign the value of
usrIdto[Screen.Info valueForKey:@"id"]so when you release it in the dealloc you release whatever is stored in[Screen.Info valueForKey:@"id"]also. Let me know if this works for you.