Ios 财产';代表';在类型的对象上找不到
有人会遇到这种情况吗? 基本上我在Dynamics Protocols中创建了Ios 财产';代表';在类型的对象上找不到,ios,objective-c,xcode,uitableview,uistoryboardsegue,Ios,Objective C,Xcode,Uitableview,Uistoryboardsegue,有人会遇到这种情况吗? 基本上我在Dynamics Protocols中创建了UITableViewController, 想知道为什么我不能设置UIStoryboard Segue 错误,“在类型的对象上找不到属性'delegate' “SettingTableViewController” 我想要每个分配屏幕 这是源代码 提前谢谢。当您使用代码设置tableview的数据源时,为什么不设置委托? 我认为您应该在设置dataSource之后添加代码: self.settingTableV
UITableViewController
,
想知道为什么我不能设置UIStoryboard Segue
错误,“在类型的对象上找不到属性'delegate'
“SettingTableViewController”
我想要每个分配屏幕
这是源代码
提前谢谢。当您使用代码设置tableview的数据源时,为什么不设置委托? 我认为您应该在设置dataSource之后添加代码:
self.settingTableView.delegate = self;
如果要将当前的
viewcontroller
设置为任何viewcontroller
的委托,则需要确认协议。例如,如果您的viewcontroller具有tableview,并且您正在使用tableview的datasource和delegate
方法,则需要确认UITableViewDelegate
和UITableViewDataSource
协议类似
@interface MyViewController : UIViewController <UITableViewDelegate,UITableViewDataSource>
@接口MyViewController:UIViewController
这里的错误是,您不能将pvc或cpvc或buvc
设置为当前viewcontroller的代理。现在为什么?有很多因素会影响这一点
有关协议和委托的更多信息,请参阅!使用以下行更改您的segue方法可能有效:
settingTableViewViewController * Vc = (settingTableViewViewController *)segue.destinationViewController;
self.delegate = vc ;
根据您的视图控制器进行管理。不要发布代码截图,而是直接发布代码!我发布了。但是未使用的变量“ifvc”:)在声明委托属性的地方以及您想对其执行的操作?.post.h代码也仔细阅读图像,在Tableview和Destation viewchange I之间正在进行自定义委托传递直接初始化如下:SettingTableViewController*Vc=(SettingTableViewController*)segue.destinationViewController;self.delegate=Vc;