弹出窗口中的按钮不起作用
对不起。刚刚点击。我在最后松开了按钮。
好的,我的第一个 iPad 应用程序几乎完成了,一切看起来都很好,除了......
我有一个按钮会导致弹出窗口出现。弹出窗口包含数量可变的按钮。由于外观和感觉有限,企业品牌需要一个包含图像的 UIImageView,顶部有一个标签,最后是一个覆盖所有内容的自定义按钮,以充当漂亮的按钮。
我想在关闭按钮之前对我们的数据库执行快速事务,因为弹出窗口中的信息对时间高度敏感,如果有人让它可见超过 30 秒,则内容可能不是最新的。
因此 DetailViewController 启动弹出窗口,弹出窗口检索当前数据并生成内容,该内容可能是按钮的多个实例。理论上,当按下按钮时,它会通过...
UIButton *pButton = [UIButton buttonWithType:UIButtonTypeCustom];
[pButton addTarget:self action:@selector(execute:) forControlEvents:UIControlEventTouchUpInside];
pButton.tag = [[[[pLines objectAtIndex:loop] componentsSeparatedByString:@":"] objectAtIndex:0] intValue];
[pButton setFrame:CGRectMake(0, (((loop-1)*40)+5), 200, 30)];
[self.view addSubview:pButton];
[pButton release];
在 popoverViewController 中调用 popoverVeiwController 中的执行函数,我已立即定义了对 NSLog 的执行,但是什么也没有发生。
我知道我错过了一些简单的东西,但是 stackOverflow 并没有完全回答我的问题,Google 无法为我解决这个问题,甚至不要问 Siri!
我的结构正确吗?在 popoverViewController .m 中调用“execute”是正确的方法吗?
提前致谢 克里斯·H
SORRY. Just clicked. I was releasing the button at the end.
OK, almost finished on my first iPad app, all is looking good EXCEPT.....
I have a button that causes a popover to appear. The popover contains a variable number of buttons. With the limited look and feel, the corporate branding calls for a UIImageView containing an image, a label on top, then finally a custom button covering it all to act as a pretty button.
I would like to perform a quick transaction against our database prior to dismissing the button as the info in the popup is highly time sensitive and if anyone leaves it visible for more than 30 seconds, the content may not be current.
So DetailViewController starts the popover, the popover retrieves the current data and generates the content, which may be a number of instances of the button. Theoretically, when the button is pressed, it calls an execute function within popoverVeiwController via.....
UIButton *pButton = [UIButton buttonWithType:UIButtonTypeCustom];
[pButton addTarget:self action:@selector(execute:) forControlEvents:UIControlEventTouchUpInside];
pButton.tag = [[[[pLines objectAtIndex:loop] componentsSeparatedByString:@":"] objectAtIndex:0] intValue];
[pButton setFrame:CGRectMake(0, (((loop-1)*40)+5), 200, 30)];
[self.view addSubview:pButton];
[pButton release];
within popoverViewController I have defined execute to NSLog immediately, however nothing happens.
I know I am missing something simple, however stackOverflow does not quite answer my question, Google has not been able to clear it up for me, and dont even ask about Siri!
Have I the right structure? Is calling 'execute' within the popoverViewController .m the correct method?
Thanks in advance
Chris H
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是我松开了按钮。
The issue was that I released the button.