一、用户在使用APP的过程中,会产生各种各样的事件。iOS中的事件可以分为3大类型: 二、响应者对象 在iOS中只有继承了了UIResponder的对象才能接受并处理事件,这样的对象称之为“响应者对象” UIApplication、UIViewController、UIView都继承自UIRespo ...
分类:
移动开发 时间:
2016-04-01 00:52:57
阅读次数:
195
导入头文件 #include <sys/types.h> #include <sys/sysctl.h> 直接调用 1 //获得设备型号 2 + (NSString *)getCurrentDeviceModel:(UIViewController *)controller 3 { 4 int mi ...
分类:
移动开发 时间:
2016-03-31 16:24:28
阅读次数:
223
主视图控制器类头文件 #import <UIKit/UIKit.h> //UITextField与文本框相关的方法 @interface MainViewController : UIViewController<UITextFieldDelegate> { int flag; NSTimer* t ...
分类:
其他好文 时间:
2016-03-30 22:21:17
阅读次数:
243
在ios第一版中: 我们为输出口同时声明了属性和底层实例变量,那时,属性是oc语言的一个新的机制,并且要求你必须声明与之对应的实例变量,例如: 注意:(这个是以前的用法) @interface MyViewController :UIViewController { UIButton *myButt ...
分类:
移动开发 时间:
2016-03-29 23:55:34
阅读次数:
385
用jquery实现的Post方法可能如下 .xx.h @interface ChatViewController : UIViewController<ASIHTTPRequestDelegate> { } xx.m - (void) postMessage { NSString *s = [NSS ...
分类:
其他好文 时间:
2016-03-29 12:21:18
阅读次数:
157
当使用 initWithNibName 函数, 并使用 由nib文件生成的ViewController 的view属性时候,遇到这个问题。 //load loc.xib UIViewController * UIVC = [[UIViewController alloc] initWithNibNa ...
分类:
其他好文 时间:
2016-03-29 00:52:20
阅读次数:
156
#import <UIKit/UIKit.h> @interface ViewController : UIViewController @property(strong,nonatomic) UILabel *lblNums; @end #import "ViewController.h" @in ...
分类:
移动开发 时间:
2016-03-28 21:38:35
阅读次数:
217
方式一 注册cell -> 无需为cell绑定标识符 [使用UIViewController完成!] l 1> static NSString * const ID = @"cell"; // 全局ID变量 l 2> 在视图加载完成后使用tableView进行注册cell - (void)viewD ...
分类:
其他好文 时间:
2016-03-28 01:55:37
阅读次数:
166
先上效果图: 这个程序分2个层次,一个是顶部的带UITextField的bar,一个是下拉选择的view,下拉选择的view带有4个自己定义的UIView 我们先定义一个UIViewController叫MyViewController,然后顶部的bar叫TopBarView,下拉选择的view叫T ...
分类:
移动开发 时间:
2016-03-26 18:36:51
阅读次数:
228