ios - passing argument 1 of 'setBackgroundColor:' from incompatible pointer type -


- (void)drawrect:(cgrect)rect {     // drawing code.      // backgroundcolor     calayer *mylayer = [self layer];         [mylayer setbackgroundcolor:[uicolor colorwithred:0 green:0 blue:0 alpha:0.5].cgcolor];     ... } 

when want setbackgroundcolor layer, warning occurred. code runs ok.

===========================================================

the best answer : #import <quartzcore/quartzcore.h>

if don't include quartz in module compiler not know cgcolor type , issues warning.

put #import <quartzcore/quartzcore.h> in header , should remove warning.

hope helps,

dave


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -