Do you want us to help you to create a jingle for you

Check out this new nursery rhyme of kid friendly entertainment.

You’re invited to start mining Bitcoin today. Register Here



iPad apps for 6-8 years old kids : This is my latest iPad project called Oh Mommy - Musical Storybook.


Tuesday, February 28, 2012

iOS : Cannot Save to Photo Album

-(IBAction) saveToPhotoAlbum{
  NSString *saveMyPhoto=[NSHomeDirectory() 
stringByAppendingPathComponent:@"image.png"];
 
  UIImage *saved=[UIImage imageWithContentsOfFile:saveMyPhoto]; 
  NSData *imageData = [NSData dataWithContentsOfFile:(NSString *)
 UIImagePNGRepresentation(saved)];
  [imageData writeToFile:(NSString *)saved atomically:YES ];
 
  UIImageWriteToSavedPhotosAlbum(saved, self, @selector 
(image:didFinishSavingWithError:contextInfo:), nil);


- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error 
contextInfo:(void *)contextInfo{
    UIAlertView *alert;


    if (error)
        alert = [[UIAlertView alloc] initWithTitle:@"Error" 
                                           message:@"Unable to save image to Photo 
Album." 
                                          delegate:self cancelButtonTitle:@"Ok" 
                                 otherButtonTitles:nil];
    else 
        alert = [[UIAlertView alloc] initWithTitle:@"Success" 
                                           message:@"Image saved to Photo Album." 
                                          delegate:self cancelButtonTitle:@"Ok" 
                                 otherButtonTitles:nil];
    [alert show];
    [alert release];
}

Anyone can help me to trouble shoot this iOS code will be much appreciated? 
I want to create a button that can save the current image using a button from 
the thumbnail display. But the real image is in the home xCode home directory

No comments:

Singing Book for Kids

Singing Book for Kids
ipad apps for kids

My Artwork for SALE!