
- (UICollectionReusableVIEw *)collectionVIEw:(UICollectionVIEw *)collectionVIEw vIEwForSupplementaryElementOfKind:(Nsstring *)kind atIndexPath:(NSIndexPath *)indexPath {themeheader *headerVIEw = [[themeheader alloc] init];headerVIEw = [collectionVIEw dequeueReusableSupplementaryVIEwOfKind:UICollectionElementKindSectionheader withReuseIDentifIEr:@"header" forIndexPath:indexPath];Nsstring *Title = @"Title for the header";headerVIEw.Title.text = Title;return headerVIEw; }
它崩溃了,给我以下错误:
– [UICollectionReusableVIEw Title]:无法识别的选择器发送到实例0xac846a0′
我的themeheader类看起来像这样
@interface themeheader : UICollectionReusableVIEw@property (strong,nonatomic) IBOutlet UILabel *Title;@end
我提前感谢您的帮助.
解决方法 这意味着headerVIEw不是您所期望的themeheader的实例,而是一个没有Title属性的UICollectionReusableVIEw实例.可能是因为您可能没有将Storyheader设置为故事板上的身份检查器中的自定义类,以用于此可恢复视图.
总结以上是内存溢出为你收集整理的ios – 用于节标题的UICollectionReusableView不起作用全部内容,希望文章能够帮你解决ios – 用于节标题的UICollectionReusableView不起作用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)