Xcode: declaring private @property it complain (Objective-C)

60 Views Asked by At

I'm trying to declare a private property but I'm getting this error:

Unexpected '@' in program

Here is my implementation

@implementation MyClassImplementation

@property (nonatomic,strong) NSArray *new;

@end

Here is where I get the error @property (nonatomic,strong) NSArray *new; any of you knows why I'm getting this error or if there is a work around this?

I'll really appreciate your help

1

There are 1 best solutions below

2
On

Private properties usually are declared in .m file in class unnamed category and for following Cocoa naming convention shouldn't use new keyword:

@interface MyClassImplementation ()

@property (nonatomic, strong) NSArray *array;

@end

@implementation MyClassImplementation

....

@end