In my Settings.h file I have the line
@property (nonatomic, retain) NSArray * connections;
Also in the Settings.m file there are importing:
#import "Settings.h"
and later I provide the implementation
- (NSArray*)connections
{
return connections;
}
- (void)setConnections:(NSArray*)_connections
{
connections = _connections;
// do some more stuff
}
But both in getter and setter I get an error about use of undeclared identifier 'connections'
I have no idea what do I do wrong, so any of your help would be greatly appreciated!
You are, quite correctly, trying to use an ivar (called
connections) as a backing store for your property, also calledconnections;To get it to work, you should simply declare an ivar like this:
It should go between the curly brackets of the class declaration, like this: