@synchronized(self)的用法: @synchronized 的作用是创建一个互斥锁,保证此时没有其它线程对self对象进行修改。这个是objective-c的一个锁定令牌,防止self对象在同一时间内被其它线程访问,起到线程的保护作用。 例如:一个电影院,有3个售票员。一场电影的总数 ...
分类:
移动开发 时间:
2016-06-08 15:49:18
阅读次数:
215
1、 [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:_currentRow inSection:0] animated:YES scrollPosition:UITableViewScrollPositionMid ...
分类:
其他好文 时间:
2016-06-08 15:34:32
阅读次数:
105
1.首先对playerItem 进行监听 [playerItem addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:nil];[playerItem addO ...
分类:
其他好文 时间:
2016-06-08 15:23:25
阅读次数:
209
UIPageControl UILabel UITextField 注意:以下方法均是系统自带的代理方法,需要设置:textField.delegate = self; pragma mark 关闭键盘及显示输入内容 pragma mark 文本框将要被编辑的时候调用 pragma mark 文本框 ...
分类:
其他好文 时间:
2016-06-08 12:26:16
阅读次数:
225
Objective-C的推荐init方法写法如下: - (id) init { if(self = [super init]) { //为子类增加属性进行初始化 } return self; } 这里涉及了几个问题, 1. [super init]的作用: 面向对象的体现,先利用父类的init方法为 ...
分类:
其他好文 时间:
2016-06-08 10:36:07
阅读次数:
202
IOS 关键字self,super,copy, retain, assign , readonly , readwrite, nonatomic、 @synthesize、@property、@dynamic #synthesize关键字: 根据@property设置,自动生成成员变量相应的存取方法 ...
分类:
移动开发 时间:
2016-06-08 10:24:48
阅读次数:
209
转自:http://www.cnblogs.com/xinus/archive/2013/01/22/ios-keybord-notification.html 注册监听键盘事件的通知 [[NSNotificationCenter defaultCenter] addObserver:self se ...
分类:
移动开发 时间:
2016-06-07 23:57:23
阅读次数:
282
<?php /*class Ren { public static $color; static function Show() { Car::$name; self::$color; } } class Car { public static $name; }*/ //抽象类 /*abstract ...
分类:
Web程序 时间:
2016-06-07 22:05:31
阅读次数:
146
iOS开发拓展篇—音频处理(音乐播放器3) 说明:这篇文章主要介绍音频工具类和播放工具类的封装。 一、控制器间数据传递 1.两个控制器之间数据的传递 第一种方法:self.parentViewController.music=self.music[indexPath.row];不能满足 第二种做法: ...
分类:
移动开发 时间:
2016-06-07 14:44:31
阅读次数:
275
苹果一直都在人机交互中尽力做到极致,在iOS7中,新增加了一个小小的功能,也就是这个api:self.navigationController.interactivePopGestureRecognizer.enabled = YES; 这个api功能就是在NavigationController堆 ...
分类:
移动开发 时间:
2016-06-07 13:07:03
阅读次数:
351