设置 delegate 1. 输入长度限制: 2. 限制输入空格: ...
分类:
移动开发 时间:
2019-01-20 15:59:06
阅读次数:
430
说明: <1>阅读本问,请参照block前述文章加以理解; <2>环境:ARC; <3>变量类型:基本数据类型或者对象类型的auto局部变量; 一、三种情形 //代码 //打印 //clang:xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc - ...
分类:
其他好文 时间:
2019-01-17 15:12:02
阅读次数:
165
Non-fragile instance variables are a headline feature of the modern Objective-C runtime available on iPhone and 64-bit Mac. They provide framework dev ...
分类:
其他好文 时间:
2019-01-16 13:18:30
阅读次数:
145
dispatch_sync 线程同步、dispatch_async线程异步 这些代码输出的结果是 1 2 3 4 依次输出、无论你运行多少次都会是这一种结果 但是来看下面的异步呢? 输出的结果是 1 2 3 4 随机输出、有时 2 1 3 4 有时 1 3 2 4 等 在iOS中是无法使用 disp ...
分类:
其他好文 时间:
2019-01-10 10:58:10
阅读次数:
127
iOS Category实现原理 (补充) load 和 initialize load 1. load方法会在程序启动就会调用,当装载类信息的时候就会调用。 调用顺序看一下源代码。在 objc loadmethod.m 文件中实现 2. 通过源码我们发现是优先调用类的load方法,之后调用分类的l ...
分类:
移动开发 时间:
2019-01-08 17:15:09
阅读次数:
150
```swift
import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let items = ["optionA","optionB","opt... ...
分类:
编程语言 时间:
2019-01-06 11:56:18
阅读次数:
235
```swift
import UIKit class ViewController: UIViewController,UITextFieldDelegate { var textField:UITextField!//声明一个UItextField类型变量 override func viewD... ...
分类:
编程语言 时间:
2019-01-06 11:17:08
阅读次数:
235
1、分类中原则上只能增加方法(能添加属性的的原因只是通过runtime的objc_setAssociatedObject和objc_getAssociatedObject方法添加setter/getter方法);2、扩展不仅可以增加方法,还可以增加实例变量(或者属性),只是该实例变量默认是@priv ...
分类:
其他好文 时间:
2019-01-02 15:06:13
阅读次数:
320
学习总结: 1. nil 和null? 2.Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead。 ...
分类:
移动开发 时间:
2018-12-31 15:52:22
阅读次数:
166
gcd常见用法 ObjC (IBAction)aaaa:(id)sender { // [self gcdBlockCancel]; // CFRunLoopGetCurrent(); // for (int i = 0; i ...
分类:
其他好文 时间:
2018-12-20 14:38:14
阅读次数:
167