0

要約されたコードは次のとおりです。

 - (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)

誰がこれがどのように可能か考えていますか?

4

1 に答える 1

1

currentLocation は nil のようです。正しく設定されていることを確認しましたか?

于 2009-10-03T20:29:35.757 に答える