ios - Create NSURL using AssetPath -
using uiimagepickercontroller, i'm able asset path media assets-library://asset/asset.mov?id=2a2ce6c9-c178-4395-977b-e6f159bf6d5e&ext=mov
.
nsurl *instagramurl = [nsurl urlwithstring:[nsstring stringwithformat:@"instagram://library?assetpath=%@&instagramcaption=%@",[referenceurl absolutestring], strinstagramcaption]];
now, want convert asset path nsurl pass following code block :
if ([[uiapplication sharedapplication] canopenurl:instagramurl]) { [[uiapplication sharedapplication] openurl:instagramurl]; }
this way how should convert asset path valid nsurl
:-
nsurl *instagramurl = [nsurl urlwithstring:[[nsstring stringwithformat:@"instagram://library?assetpath=%@&instagramcaption=%@",[asseturl absolutestring],caption]stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]]; if ([[uiapplication sharedapplication] canopenurl:instagramurl]) { [[uiapplication sharedapplication] openurl:instagramurl]; }
referred this
Comments
Post a Comment