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];

 

相关文章:

  • 2021-08-29
  • 2022-01-27
  • 2021-08-02
  • 2022-12-23
  • 2021-10-30
  • 2021-10-16
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案