Ios 无法将插座连接到通用类
似乎xcode中存在一个bug,阻止它“识别”包含泛型声明的类 以类声明为例:Ios 无法将插座连接到通用类,ios,objective-c,xcode,Ios,Objective C,Xcode,似乎xcode中存在一个bug,阻止它“识别”包含泛型声明的类 以类声明为例: @interface ABEBaseParseQueryViewController<CellType: UITableViewCell *, Object: id> : UIViewController <UITableViewDelegate, ABEDatasourceResponder> 侧栏中表示未连接出口的点不会出现。此外,在IB中尝试将文件的所有者设置为此类时,我没有得到任何自
@interface ABEBaseParseQueryViewController<CellType: UITableViewCell *, Object: id> : UIViewController <UITableViewDelegate, ABEDatasourceResponder>
侧栏中表示未连接出口的点不会出现。此外,在IB中尝试将文件的所有者设置为此类时,我没有得到任何自动完成,这使得xcode似乎根本无法“识别”该类。即使手动设置文件所有者,我也无法将插座连接到文件
如果我从类中删除泛型声明,则此问题已修复。(侧边栏中的圆圈再次出现,我可以再次连接插座)
还有其他人有这个问题吗?现在我可以删除通用声明,连接插座并将其放回原处,但这似乎是一个糟糕的解决方法
这是xcode 7.2。您完全正确。一旦有了泛型(如本例所示): 在Interface Builder中,稍后将
.h
更改为
ABEBaseParseQueryViewController<CellType: UITableViewCell *, Object: id>
ABEBaseParseQueryViewController
请注意,此时您甚至不能在界面生成器中选择通用的自定义类
ABEBaseParseQueryViewController<CellType: UITableViewCell *, Object: id>
ABEBaseParseQueryViewController
ABEBaseParseQueryViewController<CellType: UITableViewCell *, Object: id>