tags:

views:

110

answers:

1

Hello,

I am declaring a static NSString in .h file as:

static NSString *bowlerName;

@interface PlayMatchController : UIViewController <UIActionSheetDelegate> { ...... }

@end

In the .m file I am assigning that NSString variable with some value:

bowlerName = @"ABC";

Later in the .m file when I try to access that variable using the debugger when I put the mouse on that variable, I get the message like "Out of Scope" and than I continue to debug the program, at the end it will crash and give error like "EXC_BAD_ACCESS".

Please help me.

+1  A: 

Try placing the declaration within the implementation file, rather than the header

http://stackoverflow.com/questions/980083/static-string-variable-in-objective-c-on-iphone

Jonathan