我試圖保存一個屏幕從我的應用程序與使用按鈕,而不是主頁按鈕/關閉事務。林使用self
代碼錯誤。試圖保存屏幕截圖形成一個按鈕xcode
我的視圖控制器」 ...「屬性窗口不是類型的對象中找到」
- (IBAction)saveto:(id)sender {
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
UIGraphicsBeginImageContextWithOptions(self.window.bounds.size, NO, [UIScreen mainScreen].scale);
else
UIGraphicsBeginImageContext(self.window.bounds.size);
[self.window.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData * data = UIImagePNGRepresentation(image);
[data writeToFile:@"my.png" atomically:YES];
(圖像視圖被宣佈爲.H出口)
我知道我在這裏失去了一些東西基本但不能弄清楚,任何幫助greatfully收到
謝謝視圖屬性,這就是固定的錯誤 – JSA986