• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: passing argument 1 of 'setContents:' from incompatible pointer type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing argument 1 of 'setContents:' from incompatible pointer type


  • Subject: Re: passing argument 1 of 'setContents:' from incompatible pointer type
  • From: Keary Suska <email@hidden>
  • Date: Sun, 8 Feb 2009 14:30:55 -0700


On Feb 8, 2009, at 1:54 PM, David Blanton wrote:


NSString* imageFileName = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Level 1 top.png"];
CGDataProviderRef provider = CGDataProviderCreateWithFilename([imageFileName UTF8String]);
_level1 = [[CALayer layer] retain];
_level1.contents = CGImageCreateWithPNGDataProvider(provider, NULL, true, kCGRenderingIntentDefault);




CGImageCreateWithPNGDataProvider returns a CGImageRef yet the above _level1.contents = gives the warning specified in the subject line ....

can someone tell me why?


Well, CGImageRef is a pointer to struct, and contents takes an id. Have you tried an explicit cast?

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: passing argument 1 of 'setContents:' from incompatible pointer type
      • From: David Blanton <email@hidden>
References: 
 >passing argument 1 of 'setContents:' from incompatible pointer type (From: David Blanton <email@hidden>)

  • Prev by Date: passing argument 1 of 'setContents:' from incompatible pointer type
  • Next by Date: Re: passing argument 1 of 'setContents:' from incompatible pointer type
  • Previous by thread: passing argument 1 of 'setContents:' from incompatible pointer type
  • Next by thread: Re: passing argument 1 of 'setContents:' from incompatible pointer type
  • Index(es):
    • Date
    • Thread