韌館-LearnHouse

Archive for the '程式&軟體' Category

[轉]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

清除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)

Android iOS 語法傻傻分不清楚

因為興趣的關係,所以同時有在寫Android與iOS的APP,但人的人腦是有限的,我更是如此

尤其是近年來,不知道是老了還是怎樣,覺得記憶力衰退的很嚴重

如果不靠寫網誌來紀錄,很多研究過或做過的最後就都會只有印象,但不記得最後的結論是什麼

以下我就紀錄Android的JAVA(左)與iOS的Objective-C(右)中做同樣的事的一些語法差異

Read more...

2015年10 月 posted by admin in 程式&軟體 and have No Comments

[Alljoyn] Build from source - iOS

繼上一篇build Linux之後,iOS的部分也是有些問題,但問題比較不大

主要是在Run sample code的project時,裡面所指向的openssl路徑不太對

只要按照你的build完後的openssl位置設定好,正常應該都可以 run

至於,為什麼我沒有寫Android的部分,主要是因為Android在Build code沒什麼問題

只要project import進來,就可以將程式佈到你的手機了。

Read more...

2015年8 月 posted by admin in 程式&軟體 and have No Comments