iOS Question problem on debug

Erel

Administrator
Staff member
Licensed User
You will need to change the name of the ImageView variable (copy) to a different name. It causes a conflict in the generated code.
 

Brian Robinson

Active Member
Licensed User
You are getting the same error:
Users/administrator/Documents/UploadedProjects/XXXXXXXXXXXXXXXX/B4iProject/b4i_pageschapter.h:32:43: error: property follows Cocoa naming convention for returning 'owned' objects
@property (nonatomic)B4IImageViewWrapper* _copy1;

I would suggest naming the control imgCopy or something like that.

As with most controls in your app it is better to name them with a prefix (img,txt,sv,btn...) - less chance you will run into similar problems.

A quick explanation here as to why copy can't be used:
http://stackoverflow.com/questions/15365613/why-cant-i-declare-a-variable-like-newvariable-in-obj-c

Basically "copy" is a reserved word used by the compiler for generating it's own code. Even though you have named it "copy1" the second time, it still forms the start of the word and the compiler might also use copy1...copy2... etc.

Cheers
Brian
 
Top