1

我正在向 Prestented View Controller 添加一个协议,以建立 Presenting View Controller 和 Presented View Controller 之间的关系。

The current deployment target does not support automated __weak references

我已经在呈现的视图控制器(DistanceModalViewController.h)中声明了如下协议:

@protocol DistanceModalViewControllerDelegate <NSObject>
-(void)dismissDistanceModalViewControllerWithData: (id) data;
@end

并在界面(DistanceModalViewController.h)中:

@property (nonatomic, weak) id<DistanceModalViewControllerDelegate> delegate;

在我合成的实现中(DistanceModalViewController.m):

@synthesize delegate;

但我得到了上面的错误。我的目标是 iPhone 5.1 模拟器。

我可以理解给我问题的弱参考,但在 iOS5 上,我有点困惑。我究竟做错了什么?

谢谢

4

1 回答 1

4

我的目标是 iPhone 5.1 模拟器。

你的意思是你已经在工具栏的下拉菜单中选择了它?这不是部署目标,而是您在选择Product > Run时运行应用程序的设备。这个特定设备运行足够高的 iOS 版本这一事实并不重要;如果您的目标是较低版本,它也必须能够在较低版本上运行。部署目标是您为其构建的平台。在您的构建设置中,检查条目iOS Deployment Target。这将让您仅针对 iOS 5 及更高版本。

于 2012-05-12T20:20:22.300 回答