views:

18

answers:

1

I link the xib with the source code, but when I try to update the UILabel, it can't update with no error msg. So, I make a breakpoint. When I inspect to the UILabel, which is a 0x0.

I already made @synthesize in .m, but I created the IBOutlet on the .h, also I did the IBOutlet UILabel *xxxLabel;

@property (retain, nonatomic) UILabel *xxxLabel;

already.

I can display the Nib and the default value that I set on the IB. But I can't update it from code... ...I do something like this:

    MyController *tmpViewController = [[MyController alloc] initWithNibName:@"MyControllerView" bundle:nil];

    [cell addSubview:tmpViewController.view];

and I add it to the cell. But the cell only show the default nib view, instead of a updated one. I tried to update the background color, it successfully update.

What should I do to do so? Thank you.

+1  A: 

It sounds like you didn't link the Outlet to your label in Interface builder.

Just control-click your label, drag it to your "File's Owner" (which should have the class set to "MyController") and select your outlet.

Winder
It can't do so, but I can drag from the File's Owner to the Label, and I did all that. But I update the label in the ViewDidLoad, it is success.
Ted Wong
Ah, I always get those backwards. Glad it worked.
Winder