Mac Tips and Tricks

Xcode Object-C NSUrl to NSString

In Object-C to convert back and forth from NSUrl and NSString take a look at this example:

NSString *urlstring = [NSString stringWithFormat:@""];
NSURL *url = [NSURL URLWithString:urlstring];
NSLog(@"url = %@",url);

This will first save a NSString, then create a NSUrl from the String, and last output the NSUrl in the log