Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

property's synthesized getter follows cocoa naming convention for returning 'owned' objects

Does Cocos2d have any naming conventions for variables?

I have this

//.h
NSMutableArray *newRowForCounter;

and

//.m
@synthesize newRowForCounter;

At @synthesize it's warning me that "property's synthesized getter follows cocoa naming convention for returning 'owned' objects". If I change the name to something else, it work fine.

like image 490
KoKo HL Apinyanont Avatar asked Apr 01 '13 12:04

KoKo HL Apinyanont


1 Answers

new cannot be used in the variable name at the beginning. That is why it shows the error.

Sol : declare a property whose name begins with new unless you specify a different getter:

// Won't work:
@property NSString *newTitle;

// Works:
@property (getter=theNewTitle) NSString *newTitle;

Explanations here and here

like image 178
Lithu T.V Avatar answered Nov 13 '22 09:11

Lithu T.V