0

Please help me to figure this out. I am having two tab bar items in a tab bar application. First tab bar view with UITableView and second tab bar view with a label. I trying to pass table cell value to second tab view, by clicking a table cell and showing the value in the label of second tab view. The tab bar controller at the bottoms should be still visible. The main thing is I want the respective tab should be selected. I am using Xcode 4.3.2. This is something, will look like, I want to open a tab bar view from another tab bar view with a click of table cell. Thanks

4

1 に答える 1

0

ストーリー ボードの線をテーブルビュー セル (セル!) からビューにドラッグます。

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

次のように宛先コントローラーを取得します。

 if ([[segue identifier] isEqualToString:@"my_vc_1"]) {        
        MyViewController *detailViewController = [segue destinationViewController];
        // here you can either reference the outlet directly
        detailViewController.my_label.text = @"my value";
 }

一番上に「MyViewController.h」を含めることを忘れないでください。

チェックアウト:

http://developer.apple.com/library/ios/#DOCUMENTATION/General/Conceptual/iCloud101/ImplementingtheDetailViewController/ImplementingtheDetailViewController.html

于 2012-06-18T07:36:23.683 に答える