04 2016 档案

摘要:#import "ViewController.h" #import @interface ViewController () @property (nonatomic, strong) AVAudioPlayer *player; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoa... 阅读全文
posted @ 2016-04-30 20:32 o.0...w 阅读(166) 评论(0) 推荐(0)
摘要:#import "PlayAudioTool.h" #import //定义一个全局的缓存池变量, 因为音效它会一直添加到内存中,当继续添加音效时, 内存储存不了,此时就会将内存底部的一个音效移除, 然后添加新的, 虽然这个能够存储音效, 但是对与内存而言,任然是饱满, 所以我们这个就定义一个缓存池, 第一是不让相同的音效重复加载到内存中区,第二是当内存发出内存警告时, 我们可以在app... 阅读全文
posted @ 2016-04-30 20:30 o.0...w 阅读(234) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading t... 阅读全文
posted @ 2016-04-30 17:06 o.0...w 阅读(181) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import @interface ViewController () @property(nonatomic ,strong) AVCaptureFileOutput * outPut; @property(nonatomic ,strong)AVCaptureSession * session; @end @impleme... 阅读全文
posted @ 2016-04-30 16:26 o.0...w 阅读(140) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import @interface ViewController () @property (weak, nonatomic) IBOutlet UIImageView *imageView; @property(nonatomic ,strong)AVAssetImageGenerator * generatorl; @end ... 阅读全文
posted @ 2016-04-30 15:31 o.0...w 阅读(346) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import #import #import @interface ViewController () @property(nonatomic ,strong)MPMoviePlayerController * PlayerController; @end @implementation ViewController -... 阅读全文
posted @ 2016-04-29 23:09 o.0...w 阅读(247) 评论(0) 推荐(0)
摘要://系统的大头针 MKPinAnnotationView * pin = [[MKPinAnnotationView alloc]init]; 系统的大头针 可以就该大头针的颜色 等等 阅读全文
posted @ 2016-04-28 14:27 o.0...w 阅读(202) 评论(0) 推荐(0)
摘要:-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ //定位 CLGeocoder * gercode = [[CLGeocoder alloc]init]; self.gercode = gercode; //地理编码 [gercode geocod... 阅读全文
posted @ 2016-04-28 14:13 o.0...w 阅读(115) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import #import @interface ViewController () @property(nonatomic ,strong)MKMapView * map; @end @implementation ViewController - (void)viewDidLoad { [super vie... 阅读全文
posted @ 2016-04-28 13:49 o.0...w 阅读(184) 评论(0) 推荐(0)
摘要:Objective C的runtime技术功能非常强大,能够在运行时获取并修改类的各种信息,包括获取方法列表、属性列表、变量列表,修改方法、属性,增加方法,属性等等,本文对相关的几个要点做了一个小结。 目录: (1)使用class_replaceMethod/class_addMethod函数在运行 阅读全文
posted @ 2016-04-28 11:38 o.0...w 阅读(290) 评论(0) 推荐(0)
摘要:推送通知跟NSNotification有所区别: NSNotification是抽象的,不可见的 推送通知是可见的(能用肉眼看到) iOS中提供了2种推送通知 本地推送通知(Local Notification) 远程推送通知(Remote Notification) 推送通知有5种不同的呈现效果: 阅读全文
posted @ 2016-04-26 23:15 o.0...w 阅读(315) 评论(0) 推荐(0)
摘要:iOS的应用程序的生命周期,还有程序是运行在前台还是后台,应用程序各个状态的变换,这些对于开发者来说都是很重要的。 iOS系统的资源是有限的,应用程序在前台和在后台的状态是不一样的。在后台时,程序会受到系统的很多限制,这样可以提高电池的使用和用户体验。 //开发app,我们要遵循apple公司的一些 阅读全文
posted @ 2016-04-26 11:28 o.0...w 阅读(273) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import @interface ViewController () @property(nonatomic ,strong)CLLocationManager * manager; @end @implementation ViewController - (void)viewDidLoad { [super vie... 阅读全文
posted @ 2016-04-26 00:25 o.0...w 阅读(297) 评论(0) 推荐(0)
摘要:正则表达式在编写处理字符串的程序时,经常会有查找符合某些复杂规则的字符串的需要。正则表达式就是用于描述这些规则的工具。换句话说,正则表达式就是记录文本规则的代码正则表达式是对字符串操作的一种逻辑公式,用事先定义好的一些特定字符、及这些特定字符的组合,组成一个"规则字符串",这个"规则字符串"用来表达 阅读全文
posted @ 2016-04-25 19:46 o.0...w 阅读(512) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import "Person.h" @interface ViewController () @property(nonatomic ,strong)Person * people; @end @implementation ViewController - (void)viewDidLoad { [super viewDi... 阅读全文
posted @ 2016-04-25 17:27 o.0...w 阅读(190) 评论(0) 推荐(0)
摘要:#import "ViewController.h" #import #import @interface ViewController () @property (weak, nonatomic) IBOutlet UIImageView *codeImage; @property (weak, nonatomic) IBOutlet UIButton *makeCode; @pr... 阅读全文
posted @ 2016-04-25 15:32 o.0...w 阅读(237) 评论(0) 推荐(0)
摘要:摇一摇功能: -(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{ NSLog(@"开始摇一摇"); }-(void)motionEnded:(UIEventSubtype)motion withEvent:(UI 阅读全文
posted @ 2016-04-25 11:30 o.0...w 阅读(191) 评论(0) 推荐(0)
摘要:以上是CoreMotion框架实现加速计的demo,下面是已经过期的API 实现加速计的代码: iOS 5.0 推出的UIAccelerometer 后不更新 被CoreMotion 框架替代 •加速计使用步骤 –1. 获取共享加速计对象 –2. 设置加速计数据更新频率 –3. 设置加速计对象代理 阅读全文
posted @ 2016-04-25 11:03 o.0...w 阅读(225) 评论(0) 推荐(0)
摘要:iOS 8.0 有界面通讯录: 导入<AddressBookUI/AddressBookUI.h> iOS 9.0 无界面通讯录: 导入<Contacts/Contacts.h> iOS 9.0 有界面通讯录 导入<ContactsUI/ContactsUI.h> 总结://获取选择的属性 记住C语 阅读全文
posted @ 2016-04-24 00:07 o.0...w 阅读(324) 评论(0) 推荐(0)