나는 보았지만 합리적인 답을 찾지 못했습니다. 나는 첫 번째 TableViewController
을 보유하고, 4 행을 말하게하고, 사용자가 한 행 (탐색 계층 구조)을 탭할 때 두 번째 tableViewController
문자열 또는 두 번째 데이터를 확인할 int를 전달하려고합니다. tableViewController
/두 번째 테이블에로드하십시오. 내가 어떻게 그럴 수 있니?탐색을 사용하여 한 tableViewController에서 다른 tableViewController로 문자열을 전달하는 방법
ARC를 사용하지만 스토리 보드를 사용하지 않는 Xcode 4.2를 사용하고 있습니다.
업데이트 :
좋아, 내가 그것을 가지고 있는지 볼 수 있습니다. 내가 것이다 내 secondVC에서 내 첫 번째보기 제어기
--
.h --
@property(nonatomic, strong) NSString *strReceived; --
.m --
@syntesize strReceived; --
할 것이다 : 다음
--
.h --
@property (nonatomic, strong) SecondViewController *secondViewController --
.m --
@syntesize secondViewController --
및 상기 방법 didSelectRowAtIndexPath 나는 할 것이다
--
if(indexPath.row == 1) --
self.secondViewController.strReceived = @"one"; --
else --
self.secondViewController.strReceived = @"other";
인 맞지? 사용자가 돌아가서 다른 행을 선택할 수 있기 때문에 내 문자열은 NSMutableString
일 필요가 있습니까?