Get the full file name (with suffix) from the path to the image taken from the album, the video is valid.
NSString *filename = [FilePath lastpathcomponent];
Get filename (without suffix)
NSString *filename1 = [FilePath stringbydeletingpathextension];
Get the suffix name of the file (without '. ') )
NSString *suffix = [FilePath pathextension];
get the picture name Pro test only valid for the picture
Nsurl *refurl = [info valueforkey:uiimagepickercontrollerreferenceurl];
Define the block to call when we get the asset based on the URL (below)
Alassetslibraryassetforurlresultblock Resultblock = ^ (Alasset *imageasset)
{
Alassetrepresentation *imagerep = [Imageasset defaultrepresentation];
Dnlog (@ "[imagerep filename]:%@", [imagerep filename]);
};
Get the asset library and fetch the asset based on the ref URL (pass in block above)
alassetslibrary* assetslibrary = [[Alassetslibrary alloc] init];
[Assetslibrary Assetforurl:refurl Resultblock:resultblock Failureblock:nil];
[Picker Dismissviewcontrolleranimated:yes Completion:nil];
IOS gets the picture name from the album, intercepts the suffix, the picture name