Эти ответы корректны для спорных вопросов, которые они формулируют, но существует тихое проблема при выполнении сценария из другого сценария с помощью 'исходного' ключевого слова (так, чтобы это работало в той же оболочке). В этом случае Вы получаете 0$ сценария выполнения вызова. И в этом случае, я не думаю, что возможно получить название самого сценария.
Это - пограничный случай и не должно быть отнесено СЛИШКОМ серьезно. При выполнении сценария из другого сценария непосредственно (без 'источника') использование 0$ будет работать.
Вместо использования обычного метода
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
Вы хотите реализовать этот:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
Как видите, второй возвращает UIView вместо простой строки для текста. Поэтому вы можете настроить собственное представление (с метками и т. Д.) И вернуть его.
Вот пример того, как вы могли бы это сделать (для реализации в вышеупомянутом методе):
// create the parent view that will hold header Label
UIView* customView = [[[UIView alloc] initWithFrame:CGRectMake(10,0,300,60)] autorelease];
// create image object
UIImage *myImage = [UIImage imageNamed:@"someimage.png"];;
// create the label objects
UILabel *headerLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
headerLabel.backgroundColor = [UIColor clearColor];
headerLabel.font = [UIFont boldSystemFontOfSize:18];
headerLabel.frame = CGRectMake(70,18,200,20);
headerLabel.text = @"Some Text";
headerLabel.textColor = [UIColor redColor];
UILabel *detailLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
detailLabel.backgroundColor = [UIColor clearColor];
detailLabel.textColor = [UIColor darkGrayColor];
detailLabel.text = @"Some detail text";
detailLabel.font = [UIFont systemFontOfSize:12];
detailLabel.frame = CGRectMake(70,33,230,25);
// create the imageView with the image in it
UIImageView *imageView = [[[UIImageView alloc] initWithImage:myImage] autorelease];
imageView.frame = CGRectMake(10,10,50,50);
[customView addSubview:imageView];
[customView addSubview:headerLabel];
[customView addSubview:detailLabel];
return customView;
Надеюсь, что это поможет