如何提升iOS开发技能
一、阅读博客:https://github.com/tangqiaoboy/iOSBlogCN 40多位iOS开发博主的博客地址
二、读书:每一年阅读一本高质量的iOS开发书籍
三、看WWDC视频
四、看苹果的官方文档
五、看开源项目的代码
六、多写代码,多思考
七、多和同行进行交流
八、分享ios
一、虚拟机集成
二、真机集成(iOS开发进阶P47)git
vim ~/.lldbinit command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2); command alias reveal_load_dev expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2); command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil]; command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:nil];
国外:Flurry(不会被墙)
国内:友盟github
Crashlytics
Bugly(腾讯)json
App Annievim
CFStringCreateWithCString(kCFAllocatorDefault, “Hello World”, kCFStringEncodingUTF8)
- __bridge:只作类型转换,不修改相关对象的引用计数,原来的CF对象在不用时,须要调用CFRelease方法
- __bridge_retained:类型转换后,将相关对象的引用计数加1,原来的CF对象在不用时,须要调用CFRelease方法
- __bridge_transfer:类型转换后,将对象的引用计数交给ARC管理,CF对象在不用时,不在须要调用CFRelease方法
dispatch_once
代码提示dispatch_after
代码提示dispatch_queue_t urls_queue = dispatch_queue_create(“blog.devzhang.com”, NULL); dispatch_async(urls_queue, ^{ }); dispatch_release(urls_queue);
dispatch_group_t group = dispatch_group_create(); dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{ // 并行执行的线程一 }); dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{ // 并行执行的线程二 }); dispatch_group_notify(group, dispatch_get_global_queue(0, 0), ^{ // 汇总结果 });
NSJSONSerialization
比 NSKeyArchiver
更好在选择持久化方案时,系统提供的
NSJSONSerialization
比NSKeyArchiver
在效率和体积上都更好。
NSJSONSerialization
比NSKeyArchiver
快了7倍,体积小了一半
网上有详细的测试:https://github.com/randomsequence/NSSerialisationTests安全
block
容易产生循环引用问题
从架构层面来看,若是在使用block
时须要时刻注意避免循环引用问题。那么还不如不使用block
。用delegate
来实现要安全的多多线程
注意:类方法毫不会产生循环引用!架构
https://blog.csdn.net/denggun12345/article/details/83586790app