iPhone常用控件、UIActionSheet、UIAlertView
2010-12-18 08:05:25 来源:WEB开发网leftSwitch.hidden = YES; rightSwitch.hidden = YES; doSomethingButton.hidden = NO; break; }}- (IBAction) buttonPressed: (id)sender{ UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure?"
delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Yes,I'm sure." otherButtonTitles:nil]; [actionSheet showInView:self.view]; [actionSheet release];}- (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload { // Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
self.leftSwitch = nil; self.rightSwitch = nil; self.doSomethingButton = nil; [super viewDidUnload];}- (void)dealloc { [leftSwitch release]; [rightSwitch release]; [doSomethingButton release]; [super dealloc];}#pragma mark -
#pragma mark ActionSheet Delegate Methods
- (void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ if (buttonIndex != [actionSheet cancelButtonIndex]) { NSString *text = [[NSString alloc] initWithFormat:@"test alert"]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Something was done." message:text delegate:self cancelButtonTitle:@"OK!" otherButtonTitles:nil]; [alert show]; [alert release]; [text release]; }}//- (void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
//{
// NSLog(@"%d",buttonIndex);
//}
@end
- ››iphone图片拉伸的几种方法
- ››iphone正则表达式的简单使用
- ››iPhone开发Unresolved Symbols CAKeyframeAnimati...
- ››IPhone开发-“此证书是由未知颁发机构签名”解决方...
- ››IPhone开发-整合私钥和证书,生成.p12文件
- ››iPhone应用开发-UIPickerView选取器详解
- ››iphone 获取屏幕的宽度和高度
- ››iPhone读取工程包中的二进制文件
- ››iPhone新手机 不挂YouTube APP
- ››iPhone 获取指定格式的时间和日期
- ››控件一:Gallery 之无限循环的问题
- ››控件一:Gallery 之基础用法
更多精彩
赞助商链接