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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.