从 ViewController 类导入时 NSString 返回为 NULL
我想将字符串变量从一等导入到二等..但它没有导入
请在下面找到满足代码供您参考
ViewController:
@interface ViewController : UIViewController{
NSString * string;
@property(nonatomic, retain)NSString * string;
@end
@implementation ViewController
@synthesize string;
-(IBAction) login:(id) sender{
string = @"HI";
}
class2:
#import"ViewController.h"
@interface class2 : UIViewController{
ViewController * vc;
NSString * string1;
@property(nonatomic, retain)NSString * string1;
@end
@implementation ViewController
@synthesize string1;
-(IBAction) login:(id) sender{
NSLog(@"%@",vc.string);
@end
}
NSLog 在哪里返回 NULL!!!!
请帮助我!提前致谢