SKRequest didFailWithError
-(void)request:(SKRequest *)request didFailWithError:(NSError *)error
{
}
通过这种方法,人们可以阻止前发生的错误 - (“无法连接到 iTunes”)等。现在,如果有人想将此错误消息显示为警报,这对用户来说确实很有帮助。例如,当“无法连接到 iTunes”错误显示为 UIAlertView 时,它可能会导致用户遇到 Wi-Fi 一直处于关闭状态的问题。他可以纠正此问题并重试。但在选择将这些错误显示为 UIAlertView 之前,必须知道返回的所有可能的错误值,因为用户不会高兴看到类似“Error %^@)$()(!)#()+”的内容!代码 123_123443 等等”他无法理解。如何最好地处理这个问题?事后想想,如果能知道这个方法中抛出的所有可能的 NSError 错误消息就好了。
提前致谢
-(void)request:(SKRequest *)request didFailWithError:(NSError *)error
{
}
With in this method one could arrest the error that happened for ex - ("Failed to Connect to iTunes") etc. Now if one wants to show this error message as an alert it would be really helpful for users. Like one example is when the "Failed to Connect to iTunes" error is shown as an UIAlertView, it can lead the user to the problem that his wi-fi was off all this while. He can rectify this problem and retry. But before one chooses to display these errors as UIAlertView, one must know all the possible error values that are returned because a user won't be pleased to see something like "Error %^@)$()(!)#()+! code 123_123443 blah"i.e.something incomprehensible to him. How to best handle this ? As an after thought, it would be nice to know all the possible error messages of NSError thrown in this method.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道特定方法可能返回的所有可能的错误,但我认为使用
NSError
的localizedDescription
方法将错误呈现 是足够安全的用户。来自 Apple 文档:
I don't know all the possible errors that particular method can return but I think it is safe enough to use the
localizedDescription
method ofNSError
to present the error to the user.From Apple docs: