Just My Life & My Work

Archive for the ‘教學’ Category

[iOS] 在Objective C使用Swift的Singleton

隨著Swift發展日益盛行,以Objective C為主開發的我要開始與Swift「交互作用」,這次主題是在Objective C使用Swift的Singleton,這看似很容易達成的用法,卻在我又多了C語言來混用,就變得複雜啊~

[iOS] 在Objective C使用Swift的Singleton.png

(繼續閱讀…)

廣告

[iOS] 系統藍芽綁定

最近在搞藍芽裝置,它是IoT相關的硬體裝置,只要搞定藍芽連線部分,就能實現許多智慧家庭的應用。現在我想要在iOS連結藍芽裝置,照理說綁定藍芽裝置沒什麼稀奇,直到自己進入開發模式,才發現有許多眉眉角角要去深入瞭解,以老闆之前做藍芽眼罩的經驗來看,他說這就是為什麼IoT還無法普及的原因之一,因為光是藍芽連線,就有許多問題要去克服。「連線」是最基本的門檻,很多應用到死在這條線上⋯⋯

ios oserio 藍芽體脂計

註:物聯網(英語:Internet of Things,縮寫IoT)。

(繼續閱讀…)

寄送藍芽裝置給Apple測試

開發單純的iOS App沒什麼難度,可是送審後的議題總會出其不意。原以為可以只拍攝影片給審核人員看,如何連結我們的產品(藍芽裝置)來操作App,可惜我們沒能逃過高人的「法眼」,於是請老闆將一個貴重的藍芽裝置寄送給Apple測試。約莫一週左右,App總算順利上架啦⋯⋯我也順理成章去環島九天:D~

bluetooth peripheral service characteristics

以下就是在iTunes Connect被reject的原因與描述:

From Apple

  • 2. 1 Performance: App Completeness

Guideline 2.1 – Information Needed

We have started the review of your app, but we are not able to continue because we need the associated hardware to fully assess your app features.

Next Steps

To help us proceed with the review of your app, please send the necessary hardware/accessory to the address below.

NOTE: Please include your app name and app ID in the shipment; failure to provide this information can delay the review process.

Additionally, it may take several business days for us to receive the hardware once it has been delivered to Apple.

Apple, Inc.
1 Infinite Loop, M/S: 124-2APP
Cupertino, CA 95014
USA

ATTN: Marcus East
App Name: 快樂健康+
App ID: 1317204377

Once you’ve shipped the hardware, please reply to this message with the shipping carrier and tracking information. Once we have received the hardware, we will continue your app’s review.

IMPORTANT: for non-US Developers

To avoid delays with US Customs, please provide the following information with your shipment (required for all radio-frequency devices imported in the US):

– Description of the equipment
– Quantity
– Device Model/Type Name or Number
– FCC ID
– Original Manufacturer’s Name and Address

Please use FCC form 740 for details on how to provide this information.

Remember:

* A separate FCC Form 740 must be used for each different radio-frequency device or component in the shipment; however, a form is not required for subassemblies, parts, or components of radio-frequency devices.

* The form may be completed by the shipper or recipient, but if the form is not sent with the original shipping documents by the shipper, the shipment may be delayed in customs.

* Ensure all serial and ID numbers are available as well as the name and address of the original manufacturer.

以上問題,2017年11月的時光都耗在這裡啦⋯⋯

之後送審更新版,都不到一天就審核通過!

話說,Apple拿到藍芽裝置且測試過後,不會寄送回來給開發者呢⋯⋯

參考:

[iOS] IAP 驗證發票 (IAP Verify Receipt)

四年前(2014年)實作過應用內購買 (In App Purchase),經歷讓人三溫暖的刺激感,終於跟偉大的後台工程師JK,攜手合作打造出給幼兒使用的iOS App,那可是要在美國運行的呢!

[iOS] IAP 驗證發票 (IAP Verify Receipt).png

如今要再次研究Apple金流部分,IAP 驗證發票 (IAP Verify Receipt)是個必經程序,那我可以怎麼驗證購買真實性?

(繼續閱讀…)

[iOS] 混編Objective C、Swift、C/C++

在Swift剛釋出沒多久,我就研究過如何在同專案整合Objective C和Swift。文章:

儘管還是傾向以Objective C來開發產品,然而Swift的發展日趨重要,不過我大膽推測,就算Apple再怎麼強推Swift,十年內Objective C領導地位依然屹立不搖!為什麼呢?實際接觸4年Swift後,發現Swift變化多端,若猶豫要學Swift還是Objective C可以參考:要學Objective-C還是Swift?

現在想要混編Objective C、Swift、C/C++,應也不是問題~

[iOS] 混編Objective C、Swift、C:C++.png

(繼續閱讀…)

關於 Swift 4.1

最近又「逼不得已」要更新Xcode 9.3(原9.2),原本沒有很想趕上潮流,不過因為老闆把自己的iPhone升級到11.3,我要幫他灌App測試,Xcode就跳出不支援該版本⋯⋯使得我被迫要升級Xcode!更沒想到的是,要安裝Xcode 9.3,還要先升級Mac OS 10.13(原10.12.6),這過程要花我整個下午的時間啊⋯⋯

本篇議題是關於 Swift 4.1,Xcode 9.3就能以Swift編程,以為只是小更新並不大礙,沒想到我所使用的Libray/Framework出現問題!!!

Swift第4版本提到Charts套件超好用,它要以Swift 4.0來編譯,所以要到某處選擇設定。今日更新到Swift 4.1

關於 Swift 4.1 Xcode2

想說編譯執行會很順利,誰知出現⋯⋯

關於 Swift 4.1 Xcode1

這不符合Swift版本問題很神奇啊~

error: The following binaries use incompatible versions of Swift:
/Users/happyboy/Library/Developer/Xcode/DerivedData/TestDeviceSDK-deuhrepxfcygzyguaogwmklmzddz/Build/Products/Debug-iphoneos/TestDeviceSDK.app/Frameworks/Charts.framework/Charts
/Users/happyboy/Library/Developer/Xcode/DerivedData/TestDeviceSDK-deuhrepxfcygzyguaogwmklmzddz/Build/Products/Debug-iphoneos/TestDeviceSDK.app/Frameworks/Zip.framework/Zip

目前還在找解法ORZ,依然有經驗地翻舊文章下載舊版Xcode,先成功編譯後推Git。

想問熟悉寫Swift的高人,到底有多少時間在改Swift語法和設定呀⋯⋯

參考:Swift和Objective-C混編的注意啦

[Xcode] 例外中斷點 (Exception Breakpoint)

Xcode中使用Breakpoint來debug是非常平常的事情,優秀的我們都能從Breakpoint來得知上下文狀態,如各個變數值。有時候崩潰(Crash)來得突然,Xcode沒有提供詳細的Crash訊息,像是我這個例子是:存取Empty Array

[Xcode] 例外中斷點 (Exception Breakpoint)2

此時例外中斷點 (Exception Breakpoint)就非常好用!

(繼續閱讀…)

標籤雲

%d 位部落客按了讚: