在.h文件中声明? iPhone SDK

时间:2010-05-26 01:07:17

标签: iphone xcode

如何在iPhone SDK的头文件(.h)中声明此代码?

- (void) save {
    UIGraphicsBeginImageContext(self.view.frame.size); 
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];

    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
}

1 个答案:

答案 0 :(得分:2)

你试过这个吗?

- (void) save;