UILabel not updating
Posted
by iFloh
on Stack Overflow
See other posts from Stack Overflow
or by iFloh
Published on 2010-04-27T11:20:41Z
Indexed on
2010/04/27
11:23 UTC
Read the original article
Hit count: 488
Sorry the basic question, but this bugs me for a while now.
I create a details view from a UITable and try to dynamically set its labels, but they are not updating:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
myObject *tmpObj = [[myObject objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
myViewController *tmpVC = [[myViewController alloc] initWithNibName:@"NIBfile" bundle:nil];
[tmpVC.myLabel setText:tmpObj.myTitle]; // The debugger shows the text: myTitle = "myText"
NSLog(@"%@", tmpVC.myLabel); // NSLog SHOWS NULL
[self.navigationController pushViewController:tmpVC animated:YES];
[tmpObj release];
}
any ideas why the value is not coming through?
© Stack Overflow or respective owner