tags:

views:

49

answers:

1

How would I declare this code in the header file (.h) in iPhone SDK?

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

    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
}
+3  A: 

Have you tried this?

- (void) save;
DyingCactus
Yes in the .h file I did. Gives me an error
Henry D'Andrea
What is the error?
DyingCactus
Would this be right? #import <QuartzCore/QuartzCore.h>#import <UIKit/UIKit.h>@interface testViewController : UIViewController <UIWebViewDelegate> { }- (void)save;@end
Henry D'Andrea
Yes, that looks fine. Are you getting an error?
DyingCactus
Nope, not anymore!
Henry D'Andrea