您好我可以从firstviewcontroller
中的fourthviewcontroller
访问字符串。我使用以下代码。但是当我转到fourthviewcontroller
字符串时为空。
firstviewcontroller.m
#import "Fourthviewcontroller.h"
Fourthviewcontroller view = [[Fourthviewcontroller alloc] init];
view.devInText = devInput.text; //devInput is a UItextfield
NSLog(@"%@",view.devInText); // output is correct
fourthviewcontroller.h
@property (nonatomic, strong) NSString *devInText;
fourthviewcontroller.m
NSLog(@"%@",_devInText); // output displays null
答案 0 :(得分:1)
我看到两种方法: