I get a warning in this line in my header, but I use a class variable in my implementation (both in class methods and in instance methods):
#import <UIKit/UIKit.h> static NSMutableArray *classVar; // Xcode warning: 'classVar' defined but not used @interface MyViewController : UIViewController {
This variable is not a class / instance variable. Each time a header file is included in the .m file, the compiler creates a new static variable with a scope limited by the file that includes this header. If you are trying to get a class level variable, move the declaration to the top of the corresponding .m file.
A static . Xcode , , . , , . , .
static
classVar . , , (.h), , . , , MyViewController.m, .
EDIT My suggestion is that you move classVar to a .m file for MyViewController (you misinterpret what you are after)
Here is the right way to do this:
In .h
extern NSString *const DidAddRecordNotification;
In .m
NSString *const DidAddRecordNotification = @"DidAddRecordNotification";