我是新來的客觀C編程,我處於一個需要真正快速創建iPhone應用程序的位置。 我正在使用XCode 4.2objective C從視圖切換到另一個
我有一個問題,從一個視圖轉移到另一個視圖的NSString變量。 這兩種觀點都在兩套不同的.h和.M類
在.hi一流都在的firstView的.M像這樣
@interface firstview : UIViewController {
NSString *test;
}
-(IBAction)testbutton
@end
我有
-(IBAction)testbutton{
secondView *second;
[second setText:text]; //set text is a function that will take an NSString parameter
second= [[secondView alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:second animated:YES];
}
在secondView的.H
我寫
@interface secondView : UIViewController{
-IB
}
你的問題是什麼? –