iPhone 앱에서 두 개의보기를 통해 문자열을 전달하려고합니다. 나는 - 안녕 문자열을 복구 할 내 두 번째보기에 있습니다 보기를 통해 문자열을 전달하는 iPhone SDK
#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"
#import "RootViewController.h"
@interface PromotionViewController : UITableViewController {
NSString *currentCat;
}
@property (nonatomic, retain) NSString *currentCat;
@end
그리고 .mi에서
가 있습니다@synthesize currentCat;
그러나, 첫 번째보기 컨트롤러에서 내가 시도하고 설정할 때 를 찾을 수없는 클래스 방법 + currentCat : 세 번째 줄은 나에게 있습니다
PromotionViewController *loadXML = [[PromotionViewController alloc] initWithNibName:@"PromotionViewController" bundle:nil];
[self.navigationController pushViewController:loadXML animated:YES];
[PromotionViewController currentCat: @"Test"];
그건 : 그 변수 I는 찾을 수 없습니다 오류내가 뭘 잘못 했니?
NSString* myString = controller.currentCat; // where controller is an instance of PromotionViewController