I’m getting the warning that no ‘-modelLayer’ method is found for the class CALayer in the following code. According to the CALayer class reference the modelLayer method does exist. This code executes correctly, so this confirms that the implementation is there at runtime. I presume I just need to add some casting to get rid of the warning, but I’m not sure what to cast to.
How can I resolve the warning?
I’m using Xcode 4.0 Build 4A278b.
Code:
CALayer * layer = (CALayer *)(coinView.layer);
CGRect newCoinFrame = [[layer modelLayer] frame]; //warning on this line
Warning:
CoinsToSlotViewControllerTest.m:138: warning: no ‘-modelLayer’ method found
I think you need to
#import <QuartzCore/QuartzCore.h>.