Skip to content

add Foundation NSNumber#50

Merged
teach310 merged 2 commits intofeature/central_manager_init_optionsfrom
feature/ns_number
Oct 25, 2023
Merged

add Foundation NSNumber#50
teach310 merged 2 commits intofeature/central_manager_init_optionsfrom
feature/ns_number

Conversation

@teach310
Copy link
Copy Markdown
Owner

@teach310 teach310 commented Oct 25, 2023

Description

Native側の数値、bool値をcsharp側で生成するためのNSNumberを追加

以下の CBCentralManagerOptionShowPowerAlertKey の値のbool値を入れるために必要
https://developer.apple.com/documentation/corebluetooth/cbcentralmanager/central_manager_initialization_options

なぜswiftのBoolを使わないのか

後々使うNSMutableDictionaryに入れるならNSObjectが良さそうだったから。
必ず必須というわけではないと思う。

Foundationフォルダ

理想的には別でFoundationライブラリをつくってそれを参照するのが良い。
が、とりあえず機能少ないうちはCoreBluetoothForUnityに組み込んだほうが開発しやすいと判断

releaseについて

NSObjectとしてリリースすれば、NSObject継承してるクラス全てns_object_releaseで済ませられそう

Test

テストコード

teach310 added 2 commits October 26, 2023 00:06
Nativeの数値、boolをcsharp側で生成するために作成
swiftのint, boolは値型だが、NSNumberはクラス。
@teach310 teach310 added the add label Oct 25, 2023
@teach310 teach310 merged commit 3b06423 into feature/central_manager_init_options Oct 25, 2023
@teach310 teach310 deleted the feature/ns_number branch October 25, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant