作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 MRC(不要使用 ARC)
节.h
@property (nonatomic, assign) NSString* headerTitle;
section.m
- (instancetype)initwhithHeaderTitle:(NSString *)headerTitle {
self.headerTitle = headerTitle;
}
- (void)dealloc {
self.headerTitle = nil;
}
表格 View .m
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return self.sections[section].headerTitle;
}
但滚动时出现错误 BAD ACCESS。帮帮我
最佳答案
你的 headerTitle 是 assign
和 weak 一样,你必须保留它 retain
替换你的代码
@property (nonatomic, assign) NSString* headerTitle;
与
@property (nonatomic, retain) NSString* headerTitle;
编辑
您需要使用非 ARC。 发布
关于ios - 我试过这段代码,但在 titleForHeaderInSection 中出现错误 "EXC_BAD_ACCESS",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46440276/
我想将 jasmine 测试与 bamboo 集成,但我不确定是否可行。到目前为止我发现的最好的是 https://bitbucket.org/atlassian/bamboo-nodejs-plug
我是一名优秀的程序员,十分优秀!