Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

I cant call this function

-(CGImageRef)flip:(CGImageRef)im{
    CGSize sz = CGSizeMake(CGImageGetWidth(im), CGImageGetHeight(im));
    UIGraphicsBeginImageContextWithOptions(sz, NO, 0);
    CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, sz.width, sz.height), im);
    CGImageRef result = [UIGraphicsGetImageFromCurrentImageContext() CGImage];
    UIGraphicsEndImageContext();
    return result;
}

I declared it also in the header file and the code above is inside implementation file, I can't use the function flip(), how can I use it, please help. I am trying to flip an image.

1 Answer

Where are you trying to access it from? Another class?

Have you tried:

[self flip:yourObject]

the same class, thank you! I was trying flip(object), does it not work?

No flip(object) wont work. The syntax is different in objective C. In java or C++ it would have worked.