.h代码如下@interface demo4ViewController : UIViewController
<UIAlertViewDelegate>{}-(IBAction)myclick:(id)sender;
.m代码如下-(IBAction)myclick:(id)sender
{
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"title" message:@"message" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:@"option 1",@"option2",nil];
[alert show];
}-(void)alertView:(UIAlertView *)alertView buttonAtIndex:(NSInteger)buttonIndex{
NSLog([NSString stringWithFormat:@"%d",buttonIndex]);
}为什么运行了以后控制台不输出东西??根本就进不了alertView方法.怎么办?
<UIAlertViewDelegate>{}-(IBAction)myclick:(id)sender;
.m代码如下-(IBAction)myclick:(id)sender
{
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"title" message:@"message" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:@"option 1",@"option2",nil];
[alert show];
}-(void)alertView:(UIAlertView *)alertView buttonAtIndex:(NSInteger)buttonIndex{
NSLog([NSString stringWithFormat:@"%d",buttonIndex]);
}为什么运行了以后控制台不输出东西??根本就进不了alertView方法.怎么办?
解决方案 »
- cocos2d-x操作xml后进行保存,结果xml中没有变化
- jsp页面问题
- Xcode做ios开发编译成功之后模拟器黑屏
- ios中一个页面怎么获取到另一个页面UIImageView的image
- navigationcontroller向右滑动返回的功能
- IOS即时通信__十句代码完成登陆发消息功能__强大的SDK,XMPP里面的代码再也不用去写了。。。
- xcode 6 真机测试
- 有知道升级后出现了这个错误怎么解决吗 谢谢
- 友盟 无法获取crash日志
- Message from debugger: Terminated due to memory issue
- ★★Aptana Studio 3开发iPhone★★
- UIPickerView使用上的一些问题
NSLog([NSString stringWithFormat:@"%d",buttonIndex]);
} 这个里面只有一个log 输出你想有什么反应
貌似方法必须叫这个名字