iphone开发入门教程
2010-12-18 08:05:22 来源:WEB开发网HelloiPhoneViewController.m
1 // 2 // HelloiPhoneViewController.m 3 // HelloiPhone 4 // 5 // Created by Elf Sundae on 11/4/10. 6 // Copyright 2010 Elf.Sundae(at)Gmail.com. All rights reserved. 7 // 8 9 #import "HelloiPhoneViewController.h"10 11 @implementation HelloiPhoneViewController12 13 @synthesize textField;14 15 - (IBAction) buttonPressed: (id)sender16 {17 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello,iPhone!" 18 message:self.textField.text 19 delegate:nil 20 cancelButtonTitle:@"OK!" 21 otherButtonTitles:nil];22 [alert show];23 [alert release];24 }25 26 - (IBAction) textFieldDoneEditing: (id)sender27 {28 // 取消textField第一响应者状态29 [sender resignFirstResponder];30 }31 32 // 通过触摸屏幕关闭键盘33 - (IBAction) backgroundTap: (id)sender34 {35 // 在非第一响应者控件上调用resignFirstResponder是绝对安全的。36 // 因此可以放心的对所有textField调用resignFirstResponder37 [textField resignFirstResponder];38 }39 - (void)didReceiveMemoryWarning {40 // Releases the view if it doesn't have a superview.41 [super didReceiveMemoryWarning];42 43 // Release any cached data, images, etc that aren't in use.44 }45 46 - (void)viewDidUnload {47 // Release any retained subviews of the main view.48 // e.g. self.myOutlet = nil;49 self.textField = nil;50 }51 52 53 - (void)dealloc {54 [textField release];55 [super dealloc];56 }57 58 @end
- ››开发Android 日历教程
- ››开发学院总结 Win 8实用技巧大全
- ››开发学院原创教程:把win8的IE10放桌面上方法(非...
- ››iphone图片拉伸的几种方法
- ››iphone正则表达式的简单使用
- ››iPhone开发Unresolved Symbols CAKeyframeAnimati...
- ››IPhone开发-“此证书是由未知颁发机构签名”解决方...
- ››IPhone开发-整合私钥和证书,生成.p12文件
- ››iPhone应用开发-UIPickerView选取器详解
- ››iphone 获取屏幕的宽度和高度
- ››iPhone读取工程包中的二进制文件
- ››iPhone新手机 不挂YouTube APP
更多精彩
赞助商链接