Reputation: 1605
I'm using following code to get the NSURL from NSString but I always get NSURL as null :
NSString *CFURL = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,(CFStringRef)[assetURL absoluteString], NULL, CFSTR("!$&'()*+,-./:;=?@_~"), kCFStringEncodingUTF8));
NSString *instagramString = [NSString stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@", (NSURL *)CFURL, strInstagramCaption];
NSURL *instagramURL = [NSURL URLWithString:instagramString];
Upvotes: 0
Views: 640
Reputation: 6899
NSURL
does not natively support the instagram protocol. Here are the supported protocols.
The URL loading system provides support for accessing resources using the following protocols:
File Transfer Protocol (ftp://)
Hypertext Transfer Protocol (http://)
Hypertext Transfer Protocol with encryption (https://)
Local file URLs (file:///) Data URLs (data://)
As stated in the documentation, you will have to create a custom protocol.
Upvotes: 1