好的,這可能是一個新手問題,但我需要幫助它.. 我有一個someview.m,並在其中定製的自定義單元格customCell.h和.m 所以在someview.mi有objective-c從自定義單元格訪問方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
customCell *cell=[tableView dequeueReusableCellWithIdentifier:@"charCell"];
if (cell == nil || (![cell isKindOfClass: customCell.class]))
{
cell=[[customCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"charCell"];
}
return cell;
}
我有一個方法太
-(void) printStuff
{
NSLog(@"stuff");
}
現在定製細胞工作正常,但我需要從
訪問方法printStuff這是customCell.m 我已經嘗試的東西一樣[[self super] printStuff]
但我總是得到一個錯誤...... 我希望我正確地說明了問題
建議:在編寫代碼時請遵循camelCasing。 'customCell * cell'應該是'CustomCell * cell' 看起來很專業:) –