swift 各种学习

 

 

 

swift使用cocoapods引用oc第三方库

1. 创建桥接文件

2. 在主工程的 build Settings 搜索 bridge   设置 Objective-C Bridging Heading  为刚刚创建的文件

3. pod update

4. 在主工程的 build Settings 搜索 search paths  设置 User Header Search Path 为  $(SRCROOT)  然后选择 recursive(默认的是 nonrecursive)

 


 

swift lldb 调试出错

http://www.jianshu.com/p/9d030b03dd8b


swift 使用selector 问题

 

@objc func refresh() {
        print("refresh")
        })
    }

let action = #selector(refresh)

 

记得一定需要在 func 前面加上 @objc 要不然会出现错误!!! 



 

swift debug 模式 release 模式

http://www.jianshu.com/p/19f6de25e566 

        #if DEBUG1
            print("无法输出1111111")
        #endif
        
        #if DEBUG
            print("可以输出1111111")
        #endif
        
        #if DEBUGTEST
            print("可以输出1111111")
        #endif
        
        #if DEBUGTEST2
            print("无法输出1111111")
        #endif

 

 编译出错!

 


 

posted on 2017-12-07 10:30  传说中的汽水枪  阅读(147)  评论(0编辑  收藏  举报

导航