So I wanted to write a simple class.
header file
#import <Foundation/Foundation.h>
@interface Player : NSObject
@property (readonly, copy) NSString *PlayerName;
@end
class file
#import "Player.h"
@implementation Player
- (NSString*) PlayerName
{
return _PlayerName;
}
- (void)setPlayerName:(NSString *)PlayerName
{
_PlayerName = PlayerName;
}
@end
But now Xcode gives me an error, saying that the _PlayerName variable does not exist. But I thought that's the way you need to write properties access functions.