如何在下一个视图的导航栏上获取标签文字?

时间:2009-06-12 11:28:10

标签: objective-c iphone

我有一个customcell,我有一个label.now我想在nextview的导航栏中选定的单元格标签上的文字?我怎么得到它?

1 个答案:

答案 0 :(得分:1)

//in the main controller didSelectRowAtIndexPath method:

MyViewController *controller = [[MyViewController alloc] initWithTitle:label.text];

//in the 2nd controller:

-(id)initWithTitle:(NSString *)theTitle {
    if(![super init]) return nil;
    self.title = theTitle;
}