2011-10-31 2 views
0

첫 번째 탭의 테이블 뷰에서 두 번째 탭의 뷰 레이블로 선택된 행 텍스트를 전달하고 싶습니다. 나는 이것을 시도했지만 작동하지 : S의 stringdir이있는있는 NSString 당신이 컨트롤러 스택을 탐색 할 수있는 뷰 컨트롤러를 밀어 넣기 전에firstviewcontroller의 테이블 뷰와 tabBarController의 secondviewcontroller 사이에 데이터 전달하기

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
SecondViewController *detailViewController = [[SecondViewController alloc]initWithNibName:@"SecondView" bundle:nil]; 
// ... 
// Pass the selected object to the new view controller. 
[self.navigationController pushViewController:detailViewController animated:YES]; 
detailViewController.stringdir= [ws2.CustomerName objectAtIndex:[indexPath row]]; 
NSLog(@"şişşşt %@ ", detailViewController.stringdir); 

[detailViewController release]; 
} 

답변

0

이동 detailViewController.stringdir = ....

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
SecondViewController *detailViewController = [[SecondViewController alloc]initWithNibName:@"SecondView" bundle:nil]; 

detailViewController.stringdir= [ws2.CustomerName objectAtIndex:[indexPath row]]; 
NSLog(@"şişşşt %@ ", detailViewController.stringdir); 

// Pass the selected object to the new view controller. 
[self.navigationController pushViewController:detailViewController animated:YES]; 

[detailViewController release]; 
} 
+0

여전히 작동하지 않습니다. S 네비게이션 컨트롤러가 아닐 수도 있습니다. ??? –

+0

NSLog가 예상대로 올바르게 인쇄합니까? 어떻게 secondViewController에서 stringdir 속성을 설정 했습니까? – ARC

+0

secondViewController viewDidLoad에서 enyakinfirma.text = stringdir; nslog로 detailViewController.stringdir의 값을 볼 수 있습니다. 그것은 내가 선택한 것이다. –

관련 문제