Sunday, July 12, 2009

Cocoa URL's using NSUrl

#import


NSURL *someURL = [NSURL URLWithString:@"http://www.somesite.com:8080/path/targetpage.html"];

NSLog([NSString stringWithFormat:@"Host: '%@' Port: '%d'", [someURL host], [someURL port]]);


Host: www.somesite.com
Port: 8080

No comments:

Post a Comment