Я пытаюсь добавить подпредставление в ячейку таблицы и, конечно же, использовать CGRect как часть этого. Тем не менее, я получаю синтаксическую ошибку при сборке:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
switch (indexPath.section) {
case 1:
CGRect <<- SYNTAX ERROR cellFrame = CGRectMake(0, 0, 300, 65);
cell = [[[UITableViewCell alloc] initWithFrame:cellFrame reuseIdentifier: CellIdentifier] autorelease];
CGRect infoRect = CGRectMake(0, 5, 295, 55);
UILabel *infoLabel = [[UILabel alloc] initWithFrame:infoRect];
infoLabel.tag = 1;
[cell.contentView addSubview:infoLabel];
[infoLabel release];
break;
default:
break;
}
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
Я попытался щелкнуть правой кнопкой мыши на Frameworks -> добавить существующий каркас, и это не помогло. Я думаю, кажется, что компилятор все еще не видит рамки?
Редактировать: фактически, я только что заметил, что CoreGraphics.framework фактически уже загружен в проект. Так что я сейчас в замешательстве.