我有一个UILabel
,它不会在第一次加载时更新,但会在每次其他后续加载时正确加载。iPhone UILabel在第一次加载时不会更新
以下是代码片段。同样,正如我所说,在第一次加载时,它只会显示xib中标签中指定的内容,即label
,并且第二次加载字符串label.text= @"Glass, Paper, Cans, Textiles, Card, Shoes and Books";
。
-(IBAction)showDetails:(id)sender{
NSLog(@"Annotation Click");
self.userProfileVC.title=((UIButton*)sender).currentTitle;
if([((UIButton*)sender).currentTitle isEqualToString:@"Asda"])
self.userProfileVC.label.text= @"Glass, Paper, Cans, Textiles, Card, Shoes and Books";
[UIView beginAnimations:@"Curl Page Down" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown
forView:self.view cache:YES];
//Adjust the Subview by butting up to status bar
self.userProfileVC.view.frame = CGRectMake(0, 0, 320, 480);
//Add userProfileVC as a subview
[self.view addSubview:userProfileVC.view];
[UIView commitAnimations];
}
谢谢你的伴侣,你给我的线索我只是移动视图加载第一! – 2011-03-21 16:42:00