I am trying to validate a URL with this method:
Code:
- (BOOL) validateUrl: (NSString *) candidate { NSString *urlRegEx= @\"((https?|ftp|gop
You can use + (id)URLWithString:(NSString *)URLString method of NSURL, which returns nil if the string is malformed.
NSURL
nil
Use if (URL && URL.scheme && URL.host) for checking URL.
if (URL && URL.scheme && URL.host)