我有一個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