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
sieder villareal
4,016 PointsI 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
kerdeseverin
9,688 PointsWhere are you trying to access it from? Another class?
Have you tried:
[self flip:yourObject]
sieder villareal
4,016 Pointssieder villareal
4,016 Pointsthe same class, thank you! I was trying flip(object), does it not work?
kerdeseverin
9,688 Pointskerdeseverin
9,688 PointsNo flip(object) wont work. The syntax is different in objective C. In java or C++ it would have worked.