共用方式為


HMHome.AddAccessory(HMAccessory, Action<NSError>) 方法

定義

將 新增 accessory 至首頁,並在新增之後執行 completion

[Foundation.Export("addAccessory:completionHandler:")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual void AddAccessory (HomeKit.HMAccessory accessory, Action<Foundation.NSError> completion);
abstract member AddAccessory : HomeKit.HMAccessory * Action<Foundation.NSError> -> unit
override this.AddAccessory : HomeKit.HMAccessory * Action<Foundation.NSError> -> unit

參數

accessory
HMAccessory
completion
Action<NSError>

在成功時傳 null 回的處理常式,或在失敗時傳回錯誤物件。

屬性

適用於