Cal*_*ter 0 objective-c uitableview ios
我正在尝试配置一个单元格TableView.我要做的其中一件事是更改单元格中文本的字体和颜色.这是代码:
- (void)configureView {
UIFont *cellFont = [UIFont fontWithName:@"Raleway-Thin" size:14];
NSDictionary *cellAttributesDictionary = [NSForegroundColorAttributeName: [UIColor whiteColor], NSFontAttributeName: cellFont];
}
Run Code Online (Sandbox Code Playgroud)
NSFontAttributeName我收到错误后在冒号Expected ']'.导致此错误的原因是什么?
Objective-C中字典文字的正确语法是 @{...};
NSDictionary *cellAttributesDictionary = @{NSForegroundColorAttributeName: [UIColor whiteColor], NSFontAttributeName: cellFont};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
309 次 |
| 最近记录: |