domain:错误域 code:错误编码 userInfo:错误原因 NSString *domain = @"xxxxxx"; NSString *desc = NSLocalizedString(@"xxx", @"xxx");//NSLocalizedString国际化 NSDictionary *userInfo = @{NSLocalizedDescriptionKey : desc }; NSError *error = [NSError errorWithDomain:domain code:-101 userInfo:userInfo];
自定义NSError
猜你喜欢
转载自www.cnblogs.com/lulushen/p/10689677.html
今日推荐
周排行