2012-04-05 17 views
5

मेरे पास एक ऐप है जो आईफोन में फोटो एलबम में कस्टम लाइब्रेरी में छवियों को संग्रहीत करता है।कस्टम लाइब्रेरी में छवि सहेजना

मैं अपने saveimage IBAction

-(IBAction)saveToLib:(id)sender 
{ 
    UIImage *savedImage = imgPicture.image; 
    NSLog(@"Saved Image%@",savedImage); 
    [self.library saveImage:savedImage toAlbum:@"Touch Code" withCompletionBlock:^(NSError *error) { 
     if (error!=nil) { 
      NSLog(@"Big error: %@", [error description]); 
     } 
    }]; 
} 

में ALAssetLibrary

के निम्नलिखित समारोह
-(void)saveImage:(UIImage*)image toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock 
{ 
    //write the image data to the assets library (camera roll) 
    [self writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)image.imageOrientation 
         completionBlock:^(NSURL* assetURL, NSError* error) { 

          //error handling 
          if (error!=nil) { 
           completionBlock(error); 
           return; 
          } 

          //add the asset to the custom photo album 
          [self addAssetURL: assetURL 
            toAlbum:albumName 
         withCompletionBlock:completionBlock]; 

         }]; 
} 

कहा जाता है, लेकिन अपने आवेदन अग्रिम में हो रही क्रैश हुआ मेरी मदद धन्यवाद

+0

बयान NSLog आगे बढ़ने से – WaaleedKhan

+0

गैर मान्यता प्राप्त चयनकर्ता उदाहरण – WaaleedKhan

+0

के लिए भेजा कृपया अपना पूरा क्रैश लॉग बता पर ... – Aravindhan

उत्तर

0

ऐसा नहीं है कि लगता है रखना आप [self.library saveImage: savedImage toAlbum: @ ....] को सही नहीं कह रहे हैं। यदि आप इस web site का पालन कर रहे हैं, तो अपने व्यू कंट्रोलर में #import "ALAssetsLibrary + CustomPhotoAlbum.h" जोड़ें।

यह सुनिश्चित नहीं है कि यह समस्या है या नहीं। क्षमा करें अगर यह कामकाज गलत दृष्टिकोण है।

0

समस्या डाउनलोड की गई वेबसाइट से फ़ाइल है।

मेरे पास एक ही समस्या थी और मैंने इसे हल करने वाले कोड को फिर से लिखना था।

शायद एन्कोडिंग या कुछ इस तरह ...

संबंधित मुद्दे