![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
IOS
文章平均质量分 74
Ginvar
这个作者很懒,什么都没留下…
展开
-
iOS多线程编程技术NSThread、Cocoa NSOperation、GCD三者使用详解
简介iOS有三种多线程编程的技术,分别是:[html] view plaincopy(一)NSThread (二)Cocoa NSOperation (三)GCD(全称:Grand Central Dispatch) 三种方式的优缺点介绍:1)NSThread优点:NSThread 比其他两个轻量转载 2016-01-08 11:04:56 · 593 阅读 · 0 评论 -
OC中Block的原理、实现及注意事项
Block在Objc中,GCC编译器的更新引入了Block语法,这为objc语言提供了良好的闭包的功能,并为 Mac OS 与 iOS 的多个系统API所使用。它的基本语法如下//语法形式return_type (^block_name)(parameters)//实现int addtional = 5;int (^addBlock)(int a,int b) = ^(in转载 2016-01-09 15:24:13 · 3466 阅读 · 0 评论 -
IOS探索之Block的内部实现
首先,看看没有block的C函数以及编译后的结果:#include int main(){ return 0;}12345编译代码中的block:这里我们可以看到一个block的C实现。#ifndef BLOCK_IMPL#define BLOCK_IMPLstruct __block_impl { void *isa; int Flags; int转载 2016-01-09 15:27:16 · 466 阅读 · 0 评论 -
IOS探索之从拍照中获取图像对应的ALAsset
打开相机//先设定sourceType为相机,然后判断相机是否可用(ipod)没相机,不可用将sourceType设定为相片库 UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;// if (![UIImagePickerController isSour原创 2016-01-07 11:40:02 · 3785 阅读 · 1 评论 -
IOS探索之调整UILabel行高间距(利用iOS 6的特性来手动调整行间矩)
http://www.cocoachina.com/bbs/read.php?tid=178403 #define LINESPACE 20 UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 100, 320, 200)]; [label setBackgroundColor:[U转载 2016-03-03 18:11:33 · 517 阅读 · 0 评论