On Oct 21, 2008, at 3:13 PM, douglas welton wrote:


On Oct 21, 2008, at 4:00 PM, DKJ wrote:

OK, I tried this:

NSURL *url = [NSURL fileURLWithPath:fname];
CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL);
        CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL);
        CFRelease(source);
        
        theView.layer.contents = image;

and now I get an incompatible pointer type warning on the last line. But the CALayer contents property has an id type.

change your line of code to:

        theView.layer.contents = (id)image;


And then add:

        CGImageRelease(image);

(because otherwise you're still leaking the CGImageRef).


Glenn Andreas                      [EMAIL PROTECTED]
 <http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to