Create UIImageview
as CustomImageview
class with NSString
variable.Then while showing that image,store the image file path in that string variable.Then you can get it where ever you want with the use of that string.Use the following code
#import <UIKit/UIKit.h>
@interface Imager : UIImageView
{
NSString* imageFileName; @property(nonatomic,retain)NSString* imageFileName;
}
@end
#import "Imager.h"
@implementation
@synthesize imageFileName
and the assign the filepathname where you are assigning the image like your
Imageview.image = UIImage;
your Imageview.imageFileName=yourImageFilepath;
to get the yourImageFilepath add "AssetsLibrary.framework" to your framework folder.Then add #import "AssetsLibrary/AssetsLibrary.h"; to the header file of your class.
then add the following code in "didFinishPickingMediaWithInfo" method
UIImage *viewImage = yourImage;
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library writeImageToSavedPhotosAlbum:[viewImage CGImage] orientation: (ALAssetOrientation)[viewImage imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error)
{
if (error)
{
NSLog(@"error");
}
else
{
NSLog(@"url %@", assetURL);
}
}];
[library release];
It will return a url.that is your yourImageFilepath.