2012-05-12 30 views
1

我正在向Prestented View Controller添加一个协议,以在Presenting View Controller和Presented View Controller之间建立关系。自动__weak引用错误,但为iOS 5构建

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上,我有点困惑。我究竟做错了什么?

THX

+0

项目的部署目标是什么? –

+0

iPhone 5.1模拟器 – timpone

回答

4

我瞄准iPhone 5.1模拟器。

你是说你已经在工具栏的下拉菜单中选择了它?这不是部署目标,当您选择产品>运行时,这是您运行应用程序的设备。这个特定设备运行足够高版本的iOS的事实并不重要;如果您的目标版本较低,则必须能够在较低版本上运行。部署目标是您正在构建的平台。在您的构建设置中,检查条目iOS部署目标。这会让你只瞄准iOS 5以上。

+0

thx - 就是这样。我的(菜鸟)错误 – timpone