Iphone 按钮未在“后显示”;“取消隐藏”;信息技术
嘿,大家好,我似乎不知道我做错了什么。我在rootviewcontroller中创建一个按钮。我立即隐藏它,当我的解析器在一个单独的线程上启动时,我将它发送给一个“取消隐藏”按钮的方法。但是这并不是“解除隐藏”它 下面是我的ViewDiLoad中的RootViewControllerIphone 按钮未在“后显示”;“取消隐藏”;信息技术,iphone,iphone-sdk-3.0,uibutton,Iphone,Iphone Sdk 3.0,Uibutton,嘿,大家好,我似乎不知道我做错了什么。我在rootviewcontroller中创建一个按钮。我立即隐藏它,当我的解析器在一个单独的线程上启动时,我将它发送给一个“取消隐藏”按钮的方法。但是这并不是“解除隐藏”它 下面是我的ViewDiLoad中的RootViewController showtimesButton = [UIButton buttonWithType:UIButtonTypeCustom]; image = [UIImage imageNamed:@"homeshowtim
showtimesButton = [UIButton buttonWithType:UIButtonTypeCustom];
image = [UIImage imageNamed:@"homeshowtimes.png"];
[showtimesButton setBackgroundImage:image forState:UIControlStateNormal];
showtimesButton.frame = CGRectMake(27, 390, 265, 63);
[showtimesButton addTarget:self action:@selector(showtimesButtonPressed) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:showtimesButton];
showtimesButton.hidden = YES;
这是一个“取消隐藏”它的方法。我打断了这个方法,所以我知道我正在接近它
-(void)unhideShowtimesButton {
showtimesButton.hidden = NO;
}
有什么想法吗?提前谢谢 确保您正在调用主线程上的
unhideShowtimesButton
:
[anObject performSelectorOnMainThread:@selector(unhideShowtimesButton) withObject:nil waitUntilDone:NO];
其中,anObject
是您在其中进行解析的对象,如果它位于按钮处的同一对象中,请使用self
除了主线程外,您不能与任何其他UI元素交互。Hmm。。。还是没能成功。当我有更多的空闲时间来处理它的时候,我将不得不在这里再试一次。谢谢你的帖子!