【发布时间】:2011-09-29 18:33:18
【问题描述】:
TSAlertView 是 TomSwift 的 https://github.com/TomSwift/TSAlertView/ 解决方案,用于呈现类似于 UIAlertView 但完全可定制的模态视图。干得好!
但是我无法响应模式对话框中的按钮按下。我将我的视图控制器设置为委托,但根本没有反应。
在我自己的 ViewController 中编写
@interface MyViewController : UIViewController <TSAlertViewDelegate> {
然后我实现
-(void) alertView: (TSAlertView *) alertView didDismissWithButtonIndex: (NSInteger) buttonIndex {
NSLog(@"inside");
}
但它永远不会被调用。好像
[self.delegate alertView: self didDismissWithButtonIndex: buttonIndex ];
在 TSAlertView.m 中无效。
Demo 中也没有关于此的代码。有人看过 TSAlertView 吗?弄清楚如何代表按钮?谢谢!
【问题讨论】:
-
我在 [link]techques.com/question/1-4798271/… 看到了同样的问题