我有這樣的代碼,它工作完全按照期望:警告: 「否 '-renderInContext' 的方法找到了」
UIGraphicsBeginImageContext(self.bounds.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
然而,對於這一行:
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
我得到警告(不是錯誤):
找不到'-renderInContext'方法。
如果實際上該方法正在工作,我該如何得到此警告?如果我只是簡單地評論這一行,我的代碼就會失敗;所以顯然這條線和方法實際上是有效的。