当我将字符串传递给另一个视图时,我有一个空值。我的代码是:
在视图AddBarView.m
中,我有字符串:
nameAdded = nameField.text; //nameAdded is defined as NSString in AddBarView.h
NSLog(@"namefrom addbarview: %@", nameAdded); OK it works here , NsLog return the textfild
现在在其他视图中 AddLocationController.m
@synthesize nameAdded;
- (void)addViewControllerDidFinish:(AddBarView *)controller
{
AddBarView *controllerAdd;
NSLog(@"namefrom addbarview: %@", controller.nameAdded); //here
[self dismissModalViewControllerAnimated:YES];
}
返回一个(空NSLog
)值。我的错在哪里?
提前发送!