I’m a newbie in iOS development. Sometimes my API server returns a nil value. This is raising an error when I try to create a NSURL instance.
Here is the condition:
NSString *tmpURL = nil;
NSURL *url = [NSURL URLFromString:tmpURL];
In this condition, it will make the app crash. I just want to make the url variable nil, not raise an error.
How about: