我有一个实例方法,我想返回一个CGAffineTransform。我目前收到错误信息
Semantic Issue: Initializing 'CGAffineTransform' (aka 'struct CGAffineTransform') with an expression of incompatible type 'id'我的方法名
- (CGAffineTransform)getEllipse我的呼唤
CGAffineTransform t = [self getEllipse];任何帮助都是最好的。
发布于 2011-04-28 14:09:25
您是否确保该方法被声明在调用它的代码可见的地方?即,如果:
- (CGAffineTransform)getEllipse;位于MyFoo.h中,MyBar.m包含:
CGAffineTransform t = [self getEllipse];然后MyBar.m需要#import "MyFoo.h"。在看不到声明的情况下,调用代码将假定该方法返回未知类型的对象。id。
https://stackoverflow.com/questions/5813008
复制相似问题