當我傳遞一個字符串到另一個視圖時,我有一個空值。 我的代碼是:空值從iphone視圖傳遞到另一個
鑑於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
返回(空)值。我的f Wh聲是什麼?
tx提前!
你記錄了nameField.text嗎? – Lucas 2012-07-13 12:21:29