iPhone上有非常流畅的用户触摸交互体验,能检测各种手势:点击,滑动,放大缩小,旋转。大多数情况都是用UI*GestureRecognizer这样的手势对象来关联手势事件和手势处理函数。也有时候,会看到第三方代码里会在如下函数中进行处理:-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event;
那么问题就来了,手势和touch到底...
分类:
移动开发 时间:
2015-08-06 15:12:33
阅读次数:
187
今天,在实现play gif时间功能,我看见两个陌生班,只需看看这个纪录:NSSet和NSDictionary是两个经常使用的类,可是他们默认假定了当中对象的内存行为。对于NSSet。object是强引用的,和NSDictionary中的value是一样的。而NSDictionary中的key则是c...
分类:
其他好文 时间:
2015-07-30 18:50:06
阅读次数:
198
int main(int argc, const char * argv[]) {
@autoreleasepool {
// 4 NSArray -> NSSet
NSArray * array = @[@"one",@"two",@"three"];
NSSet * set = [NSSet setWithArray:arr...
分类:
其他好文 时间:
2015-07-27 09:30:05
阅读次数:
103
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{方法1 [self.view endEditing:YES];2 [[UIApplication sharedApplication]sendAction:@select....
分类:
其他好文 时间:
2015-07-25 22:47:33
阅读次数:
132
代码:-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^...
分类:
其他好文 时间:
2015-07-25 00:03:29
阅读次数:
119
代码:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//在后台进行网址的解析操作
...
分类:
其他好文 时间:
2015-07-24 22:39:15
阅读次数:
137
//NSset {()}集//不可变的 //便利构造器创建一个集 NSSet *set1=[NSSet setWithObjects:@"1",@"2",@"3",@"4", nil]; NSLog(@"%@",set1); //使用集 //返回元素个数 [set1 count]; //随机返回.....
分类:
其他好文 时间:
2015-07-24 12:25:29
阅读次数:
97
先要遵循协议 设置代理 self.jiagetextfield.delegate=self; self.mingchengtextfield.delegate=self;//释放第一响应者-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent ...
分类:
移动开发 时间:
2015-07-24 10:41:11
阅读次数:
117
//一: 迭代器
//
数组
NSArray *arr=
@[@"1",@"2",@"3",@"4",@"5"];
NSEnumerator *enumerator = [arr
objectEnumerator];
NSString *str = nil;
while (str = [enumerator
nextObj...
分类:
其他好文 时间:
2015-07-23 21:51:33
阅读次数:
234
ViewController.m -?(void)viewDidLoad?{
????[super?viewDidLoad];
????self.view.backgroundColor?=?[UIColor?redColor];
}
-(void)touchesBegan:(NSSet?*)touches?withEvent:(UIEvent?*)eve...
分类:
其他好文 时间:
2015-07-23 18:00:21
阅读次数:
270