UIViewControllerのviewDidLoadメソッドで、次のようにします。
UIButton *b = [[UIButton buttonWithType:UIButtonTypeRoundedRect]
initWithFrame:CGRectMake(0, 0, 100, 100)];
[b setTitle:@"Testing" forState:UIControlStateNormal];
[b setTitleColor: [UIColor blackColor] forState: UIControlStateNormal];
[self.view addSubview:b]; // EDIT: should be 'b'
NSLog(@"button title: %@", [b titleLabel].text);
ボタンは表示されますが、タイトルは表示されません。NSLog行は、コンソールに「テスト」を出力します。私が間違っていることについて何か提案はありますか?