LearnHouse

Archive for the '程式&軟體' Category

[iOS]如何同時存在新舊兩套Xcode

身為iOS的開發人員很常會遇到iOS升級,Xcode也要跟著升級才能繼續開發

但很奇怪的是iOS每次升級,舊的APP就一定有問題,寫法都會有不相容新的SDK

勢必就要一一的去修正(真不懂為什麼Android就不用這麼麻煩)

有時候APP很趕著要上架,沒空一一修正和改寫不相容的錯誤

這時一個舊版的Xcode就很重要了,以下就教你如何安裝新舊兩套版本的Xcode

Read more...

posted by admin in 程式&軟體 and have No Comments

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

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...

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...

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/

posted by admin in 程式&軟體 and have Comment (1)

Android iOS 語法傻傻分不清楚

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

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

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

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

Read more...

posted by admin in 程式&軟體 and have No Comments