0

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.

skaffman
  • 398,947
  • 96
  • 818
  • 769
pratik
  • 4,419
  • 8
  • 41
  • 65

1 Answers1

1

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

Static string variable in Objective C on iphone

Community
  • 1
  • 1
Jonathan
  • 1,592
  • 1
  • 14
  • 28