views:

20

answers:

0

Hi all,

I have a little method that saves an image to the photo library. That works just fine for the iPhone simulator. But when I switch the simulator to iPhone 4 the image saving won't work anymore. I always get the "error"-alert:

    //save actual design in photo library
- (void)savePicture{
    UIImage *myImage = [self combineImages];
    [myImage retain];
    UIImageWriteToSavedPhotosAlbum(myImage, self, @selector(imageSavedToPhotosAlbum:didFinishSavingWithError:contextInfo:), self); 
}

//feedback if picture saving was successfull
- (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {  
    [image release];

    NSString *title;  
    if (!error) {  
        title   = NSLocalizedString(@"Success", @"");  
    } else { 
        title   = NSLocalizedString(@"Error", @"");  
    }  
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title  
                                              message:nil  
                                              delegate:nil  
                                              cancelButtonTitle:NSLocalizedString(@"Ok", @"")  
                                              otherButtonTitles:nil];  
    [alert show];  
    [alert release];  
}