NSString responds to rangeOfString:, not rangeWithString:.
urlAddress if, else. , . , if/else, .
URL- , (, "http://" ), apple.http://.com .
hasPrefix:, :
BOOL result = [[check lowercaseString] hasPrefix:@"http://"];
NSURL *urlAddress = nil;
if (result) {
urlAddress = [NSURL URLWithString: textField.text];
}
else {
NSString *good = [NSString stringWithFormat:@"http://%@", [textField text]];
urlAddress = [NSURL URLWithString: good];
}
NSURLRequest *requestObject = [NSURLRequest requestWithURL:urlAddress];