使用 Cocoapods 将 Parse 更新为 UIAlertController

Updating Parse to UIAlertCotroller with Cocapods

在 IOS 上休息一段时间后,我刚刚更新到 Xcode 7.1 版本 7.1.1 (7B1005)。

更新后我遇到了问题 运行 一个使用 Parse 框架的项目有效,所以我再次 运行 pod install 以更新所有内容。 (下面pods输出)

Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Using Bolts (1.2.2)
Using Parse (1.8.5)
Using ParseUI (1.1.6)
Using PercentEncoder (1.0.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 4 total
pods installed.

这工作正常,现在项目构建并再次完美运行,但有一个明显的例外。

我现在收到有关在 IOS9 中弃用 UIAlertView 的警告(我知道这已被 UIAlertCotroller 取代)。这些警告指向 ParseUI 框架文件。

'UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead

以下所有罚款都会收到相同的警告。

PFUIAlertView.h
PFLogInViewController.m
PFQueryCollectionViewController.m
PFQueryTableViewController.m
PFUIAlertView.m

发生这种情况是因为 Parse UI 已过时吗?或者我错过了什么或做错了什么?

None 我的代码有任何错误或警告。

我看了好几遍,似乎没有其他人遇到过这个问题。

请帮帮我,我卡住了,不知道怎么穿。

Parse-UI 项目似乎已过时。查看 header,它扩展了 UIAlertView:

// PFUIAlertView.h
#import <UIKit/UIKit.h>

@interface PFUIAlertView : UIAlertView

+ (void)showAlertViewWithTitle:(NSString *)title
                         error:(NSError *)error;
+ (void)showAlertViewWithTitle:(NSString *)title
                       message:(NSString *)message;
+ (void)showAlertViewWithTitle:(NSString *)title
                       message:(NSString *)message
             cancelButtonTitle:(NSString *)cancelButtonTitle;
@end

// PFUIAlertView.m
+ (void)showAlertViewWithTitle:(NSString *)title
                       message:(NSString *)message
             cancelButtonTitle:(NSString *)cancelButtonTitle {
    UIAlertView *alertView = [[self alloc] initWithTitle:title
                                                 message:message
                                                delegate:nil
                                       cancelButtonTitle:cancelButtonTitle
                                       otherButtonTitles:nil];
    [alertView show];
}

有一个 open issue 就其价值而言,但相关工作似乎已停滞。也许把它放在那里将有助于进行更新。

您可以找到完整的来源 here