1.NSString
查找是否包含某字符串:
[str rangeOfString@"xxx"].length
NSString *str = [NSString stringWithFormat:@"a_b_c_d"];
NSArray *ary = [str componentsSeparatedByString:@"_"]; //ary 为[a,b,c,d]
字符串转类
Class class = NSClassFromString(@"className");
2.NSURL
调用URLWithStirng时,返回为nil的解决
urlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [NSURL URLWithString:urlStr];