what's wrong code
code:
nslog(@"the link %@", [selectedcontent objectforkey:@"link"]); nsstring *string = [[nsstring alloc] initwithstring:[selectedcontent objectforkey:@"link"]]; nslog(@"the string %@", string); nsurl *myurl = [[nsurl alloc] initwithstring:string]; nslog(@"the nsurl %@", myurl); nsurlrequest *myrequest = [[nsurlrequest alloc] initwithurl:myurl];
console:
link http://www.apple.com
string http://www.apple.com
nsurl (null)
make sure string doesn't have unexplained characters. use 1 of percentencoding methods of nsstring produce percent-encoded form, nslog string.
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment