Can not use an object as parameter to a method (Obj-C errors, part 2)

This is an easy one to seasoned X-coders, but one that tripped me up a few times when I first got started.

BAD CODE:

-(void) makePhotoFromImage: (UIImage )image;

ERROR:

can not use an object as parameter to a method

TRANSLATION

You probably forgot the “pointer” asterisk in your declaration. Should be:

-(void) makePhotoFromImage: (UIImage *)image;

This entry was posted in Objective C error translation series, Programming. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>