iOS的三种事件:触摸事件/运动事件/远程控制事件
typedef enum {
UIEventTypeTouches,
UIEventTypeMotion,
UIEventTypeRemoteControl,
} UIEventType;
只有继承UIResponder类的对象才能处理事件,如UIView、UIViewController、UIApplication都继承自UIRespo...
分类:
移动开发 时间:
2015-07-08 21:00:22
阅读次数:
136
系统提供的AVCaptureSession只适用于iOS7.0以上的系统;之前的请用Zbar来替代
配置工程:
引入:
import Foundation
import AVFoundation
接受AVCaptureMetadataOutputObjectsDelegate(如: class QrcodeVC: UIViewController,AVCaptureMetadataOut...
分类:
编程语言 时间:
2015-07-08 19:03:34
阅读次数:
162
1、延迟操作:[selfperformSelector:@selector(nextQuestion)withObject:nilafterDelay:0.5];2、创建控制器系统会先调initWithNibName方法3、storyboard创建控制器UIViewController *vc = ...
分类:
其他好文 时间:
2015-07-08 12:23:10
阅读次数:
106
自定义导航控制器,重写下面的方法,创建一个返回箭头按钮 1 - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated 2 3 { 4 5 if (self.viewContr...
分类:
其他好文 时间:
2015-07-08 09:19:20
阅读次数:
99
一、控制器部分
#import "JRTabBarConroller.h"
#import "JRTabBar.h"
@interface JRTabBarConroller ()
@property(nonatomic,weak) UIViewController * currentVC;
@end
@implementation JRTabBarConrol...
分类:
其他好文 时间:
2015-07-07 23:00:36
阅读次数:
187
UIResponder* nextResponder = [self.view.superview.superview nextResponder]; if ([nextResponder isKindOfClass:[UIViewController class]]) { ...
分类:
移动开发 时间:
2015-07-06 21:39:10
阅读次数:
190
importUIKitclassViewController:UIViewController{overridefuncviewDidLoad(){super.viewDidLoad()self.initView()}overridefuncdidReceiveMemoryWarning(){sup...
分类:
编程语言 时间:
2015-07-06 13:54:24
阅读次数:
142
常见问题集锦1.重复调用2次loadView和viewDidLoad2.按钮无法点击3.@2x和-568h@2x4.启动app时全屏显示Default.png1.重复调用2次loadView和viewDidLoad最好不要在UIViewController的loadView方法中改变状态栏的可视性(...
分类:
其他好文 时间:
2015-07-05 18:29:13
阅读次数:
170
新建RootViewController 继承于 UIViewController
新建RootView 继承于 UIView
AppDelegate.m 中引入 #import "RootViewController.h"#pragma mark - 重写
#pragma mark dealloc
- (void)dealloc
{
[_window release];
[su...
分类:
Web程序 时间:
2015-07-04 18:26:34
阅读次数:
177
大前提是UIViewController有一个UIView.同时,需要厘清两个概念,创建一个类和实例化一个类.在XCode中创建一个类和实例化一个类很容易区分,但是在IB(Interface Builder)中有时候就会迷糊.其实也很好区分,孤零零地创建了一个nib文件,没有和其他可被实例化的类有直...
分类:
其他好文 时间:
2015-07-04 13:50:01
阅读次数:
68