韌館-LearnHouse

[轉]How to call Objective C code from Swift or Swift code from Objective C

Using Objective-C Classes in Swift

** If you have an existing class that you'd like to use, perform Step 2 and then skip to Step 5. (For some cases, I had to add an explicit #import <Foundation/Foundation.h to an older ObjC File) **

Step 1: Add Objective-C Implementation -- .m

Add a .m file to your class, and name it CustomObject.m

Step 2: Add Bridging Header

When adding your .m file, you'll likely be hit with a prompt that looks like this:

enter image description here

Click YES !

If you did not see the prompt, or accidentally deleted your bridging header, add a new .h file to your project and name it <#YourProjectName#>-Bridging-Header.h

Read more...

2016年7 月 posted by admin in 程式&軟體 and have No Comments

[轉]iOS的沙盒機制(SandBox)

轉貼來源:

http://www.superqq.com/blog/2015/07/20/ioskai-fa-zhi-sha-he-ji-zhi-%28sandbox/
http://www.superqq.com/blog/2015/07/22/ioskai-fa-zhi-huo-qu-sha-he-lu-jing

iOS APP可以在自己的沙盒裡讀寫文件,但是,不可以訪問其他APP的沙盒。每一個APP都是一個信息孤島,相互是不可以進行通信的,唯獨可以通過URL Scheme。沙盒裡面的文件可以是照片、聲音文件、文本、屬性列表等。

Read more...

2016年3 月 posted by admin in 程式&軟體 and have No Comments

Don't reboot it just patch

心有戚戚焉?

[http://www.youtube.com/watch?v=zbABy9ul11I]

Read more...

2016年3 月 posted by admin in 影視娛樂 and have No Comments

清除XCode暫存避免MAC空間不足

DerivedData
影響:會刪除build生成的專案索引、build輸出以及日誌。重新打開項目時會重新生成,大的專案會耗費一些時間。
路徑:~/Library/Developer/Xcode/DerivedData

移除模擬器的臨時文件
影響:如果需要保留較新版本的模擬器,但tmp文件夾很大。放心刪吧,tmp文件夾裡的內容是不重要的。在iOS Device中,存儲空間不足時,tmp文件夾是可能被清空的。
路徑:~/Library/Application Support/iPhone Simulator/8.0/tmp

移除對舊設備的支持
影響:再連接舊設備調試時,會重新自動生成。
路徑:~/Library/Developer/Xcode/iOS DeviceSupport
Read more...

2016年2 月 posted by admin in 程式&軟體 and have No Comments

How to create an iOS distribution certificate, provisioning profile and ANPS certificate

http://www.folio3.com/blog/how-to-create-an-ios-distribution-certificate-provisioning-profile-and-apns-certificate/

2016年2 月 posted by admin in 程式&軟體 and have Comment (1)

[轉]從 NSURLConnection 到 NSURLSession

轉貼位址:http://objccn.io/issue-5-4/

iOS 7 和 Mac OS X 10.9 Mavericks 中一個顯著的變化就是對 Foundation URL 加載系統的徹底重構。

現在已經有人在深入蘋果的網絡層基礎架構的地方做研究了,所以我想是時候來分享一些對於我對於這些新的 API 的看法和心得了,新的 API 將如何影響我們編寫程序,以及它們對於 API 設計理念的影響。

Read more...

2016年1 月 posted by admin in 文獻參考 and have No Comments