ios - 在 Parse 中注册后发生错误时如何更改警报消息?

标签 ios objective-c error-handling parse-platform

当用户登录时发生错误时,我想更改警报附带的错误消息。
我试过:

- (void)signUpViewController:(PFSignUpViewController *)signUpController didFailToSignUpWithError:(NSError *)error {
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"me" message:error.debugDescription preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
    [alert addAction:ok];
    [self presentViewController:alert animated:YES completion:nil];
    NSLog(@"Failed to sign up... %@ ", error.debugDescription);

}

日志看起来很好,但警报 Controller 仍然是旧的。 作为记录,当电子邮件已被占用时,它会显示“电子邮件 MyName ...”而不是“电子邮件 MyEmail ... 已被占用”。

你知道怎么做吗?

编辑:
enter image description here

最佳答案

Paul,我的电子邮件地址显示在 MyName 的位置,你那里还有其他事情要发生。

此外,我在 1.6 中一直在研究这个,发现与 this answer 2 years ago 相同的结果。以及来自另一位 Parse 开发人员的更新评论 here 1 year ago .我猜他们只是觉得它现在不是我们的优先事项。这并不能使我的答案正确,其他人可能已经找到了解决方案,但我将 signUpViewController 和您有权访问 self.signUpView.emailField.text 的所有内容子类化以传递您的 UIAlertController。此外,他们的 changelog 中没有任何内容。关于它。所以我的回答是,目前不能直接编辑,但不要觉得这是正确的答案。看起来,如果您想要此功能,您将不得不使用本地化字符串或创建您自己的注册/登录 View Controller ,您可以在其中访问 UITextFields 文本并可以在其中使用任何警报您希望,定制或其他方式

关于ios - 在 Parse 中注册后发生错误时如何更改警报消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28484027/

相关文章:

python - 如果我希望用户输入的数据具有特定格式,如何在python 3中设置格式检查?

ios - 与 Storyboard 连接的 SearchBar 为零

ios - 如何将 UILabel 放在 SKSpriteNode 后面

ios - 将 UIView (Overlay) 与应用程序背景混合

IOS:在 Storyboard中释放 View Controller

swift - Swift 3 中的错误处理

swift - 在 Swift 中的观察者方法中抛出错误

objective-c - 如何仅旋转 MFMailComposeViewController

ios - 解读崩溃报告 - iOS - xCode

ios - xcode sprite kit 背景音乐