0
我正在嘗試在TableView
中配置單元格。我正在嘗試做的一件事是更改單元格中文本的字體和顏色。下面是代碼:Objective-C語法錯誤「Expected」]'「
- (void)configureView {
UIFont *cellFont = [UIFont fontWithName:@"Raleway-Thin" size:14];
NSDictionary *cellAttributesDictionary = [NSForegroundColorAttributeName: [UIColor whiteColor], NSFontAttributeName: cellFont];
}
在結腸NSFontAttributeName
後,我收到錯誤Expected ']'
。什麼導致了這個錯誤?
格式化錯誤。您的字典未被指定爲字典對象。更改爲:'@ {NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:cellFont}' – Stonz2