2009-10-03 36 views
0

所以這裏的刪節代碼:的UITextField Crazyness

- (void)viewDidLoad { 
     [super viewDidLoad]; 
     currentLocation = [[UITextField alloc] init]; 
     currentLocation.delegate = self; 
    ........ 
    } 

    -(void) setState:(NSString *)state andCity: (NSString *)city { 

     //currentLocation.text = [NSString stringWithFormat:@"%@, %@",state,city]; 
     currentLocation.text = @"what the shnizzle?"; 

     NSLog(@"state = %@, and city = %@",state,city); 
     NSLog(@"currentLocation.text = %@",currentLocation.text); 
} 

,這裏是控制檯輸出:

2009-10-03 16:00:06.311 iParkNow![1061:207] state = (null), and city = New York 
2009-10-03 16:00:06.315 iParkNow![1061:207] currentLocation.text = (null) 

任何人有任何的想法這怎麼可能?

回答

1

看起來像currentLocation是零。你是否證實它已正確設置?