Language

CBCentralManager コンストラクター

定義

オーバーロード

Name 説明
CBCentralManager()

パラメーターなしでこのクラスの新しいインスタンスを初期化する既定のコンストラクター。

CBCentralManager(DispatchQueue)

指定したCBCentralManagerを使用して新しいdispatchQueueを作成します。

CBCentralManager(NSObjectFlag)

初期化をスキップし、単にオブジェクトを割り当てるために派生クラスを呼び出すコンストラクター。

CBCentralManager(NativeHandle)

アンマネージ オブジェクトのマネージド表現を作成するときに使用されるコンストラクター。 ランタイムによって呼び出されます。

CBCentralManager(ICBCentralManagerDelegate, DispatchQueue)

指定した中央デリゲートとディスパッチ キューを使用して新しい CBCentralManager を作成します。

CBCentralManager(ICBCentralManagerDelegate, DispatchQueue, CBCentralInitOptions)

指定した中央デリゲート、ディスパッチ キュー、およびオプションを使用して新しい CBCentralManager を作成します。

CBCentralManager(ICBCentralManagerDelegate, DispatchQueue, NSDictionary)

指定した中央デリゲート、ディスパッチ キュー、およびオプションを使用して新しい CBCentralManager を作成します。

CBCentralManager()

パラメーターなしでこのクラスの新しいインスタンスを初期化する既定のコンストラクター。

public CBCentralManager();

適用対象

CBCentralManager(DispatchQueue)

指定したCBCentralManagerを使用して新しいdispatchQueueを作成します。

public CBCentralManager(CoreFoundation.DispatchQueue dispatchQueue);
new CoreBluetooth.CBCentralManager : CoreFoundation.DispatchQueue -> CoreBluetooth.CBCentralManager

パラメーター

dispatchQueue
DispatchQueue

中央マネージャー イベントがディスパッチされるディスパッチ キュー。

適用対象

CBCentralManager(NSObjectFlag)

初期化をスキップし、単にオブジェクトを割り当てるために派生クラスを呼び出すコンストラクター。

[ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)]
protected CBCentralManager(Foundation.NSObjectFlag t);
[<ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)>]
new CoreBluetooth.CBCentralManager : Foundation.NSObjectFlag -> CoreBluetooth.CBCentralManager

パラメーター

t
NSObjectFlag

未使用の Sentinel 値を渡し、NSObjectFlag.Empty を渡します。

属性

注釈

このコンストラクターは、マネージド コードでオブジェクトを完全に構築し、ランタイムが NSObjectを割り当てて初期化するだけの場合に、派生クラスによって呼び出される必要があります。 これは、Objective-C 使用する 2 段階の初期化プロセスを実装するために必要です。最初の手順はオブジェクトの割り当てを実行し、2 番目の手順はオブジェクトを初期化することです。 開発者がこのコンストラクターを呼び出すときは、オブジェクトのメモリを割り当て、Objective-C オブジェクトと C# オブジェクトをバインドするだけで、 NSObject までの直接パスを利用します。 オブジェクトの実際の初期化は開発者が行います。

このコンストラクターは通常、バインディング ジェネレーターによってオブジェクトを割り当てるために使用されますが、実際の初期化が行われるのを防ぎます。 割り当てが行われたら、コンストラクターはオブジェクトを初期化する必要があります。 バインディング ジェネレーターによって生成されたコンストラクターでは、オブジェクトを初期化するために "init" メソッドの 1 つを手動で呼び出します。

このコンストラクター チェーンを使用してチェーンアップする場合、オブジェクトを完全に初期化するのは開発者の責任です。

一般に、開発者のコンストラクターが対応する基本実装を呼び出す場合は、Objective-C init メソッドも呼び出す必要があります。 そうでない場合、開発者は代わりにクラス内の適切なコンストラクターにチェーンする必要があります。

引数の値は無視され、実行される唯一のコードが構築フェーズであることが、基本的な NSObject 割り当てとランタイム型の登録であることを保証するだけです。 通常、チェーンは次のようになります。

//
// The NSObjectFlag constructor merely allocates the object and registers the C# class with the Objective-C runtime if necessary.
// No actual initXxx method is invoked, that is done later in the constructor
//
// This is taken from the iOS SDK's source code for the UIView class:
//
[Export ("initWithFrame:")]
public UIView (CGRect frame) : base (NSObjectFlag.Empty)
{
    // Invoke the init method now.
    var initWithFrame = new Selector ("initWithFrame:").Handle;
    if (IsDirectBinding) {
        Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSend_CGRect (this.Handle, initWithFrame, frame);
    } else {
        unsafe {
            var __objc_super__ = new ObjCRuntime.ObjCSuper (this);
            Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_CGRect (&__objc_super__, initWithFrame, frame);
        }
        GC.KeepAlive (this);
    }
}

適用対象

CBCentralManager(NativeHandle)

アンマネージ オブジェクトのマネージド表現を作成するときに使用されるコンストラクター。 ランタイムによって呼び出されます。

[ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)]
protected internal CBCentralManager(ObjCRuntime.NativeHandle handle);
[<ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)>]
new CoreBluetooth.CBCentralManager : ObjCRuntime.NativeHandle -> CoreBluetooth.CBCentralManager

パラメーター

handle
NativeHandle

アンマネージ オブジェクトへのポインター (ハンドル)。

属性

注釈

このコンストラクターはランタイム インフラストラクチャ (GetNSObject(IntPtr)) によって呼び出され、アンマネージ Objective-C オブジェクトへのポインターの新しいマネージド表現が作成されます。 開発者は、このメソッドを直接呼び出すべきではありません。代わりに、マネージド オブジェクトの 2 つのインスタンスが同じネイティブ オブジェクトを指すのを防ぐので、 GetNSObject(IntPtr) を呼び出す必要があります。

適用対象

CBCentralManager(ICBCentralManagerDelegate, DispatchQueue)

指定した中央デリゲートとディスパッチ キューを使用して新しい CBCentralManager を作成します。

[Foundation.Export("initWithDelegate:queue:")]
[ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)]
public CBCentralManager(CoreBluetooth.ICBCentralManagerDelegate? centralDelegate, CoreFoundation.DispatchQueue? queue);
[<Foundation.Export("initWithDelegate:queue:")>]
[<ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)>]
new CoreBluetooth.CBCentralManager : CoreBluetooth.ICBCentralManagerDelegate * CoreFoundation.DispatchQueue -> CoreBluetooth.CBCentralManager

パラメーター

centralDelegate
ICBCentralManagerDelegate

追加する。

このパラメーターは、null に設定できます。

queue
DispatchQueue

追加する。

このパラメーターは、null に設定できます。

属性

適用対象

CBCentralManager(ICBCentralManagerDelegate, DispatchQueue, CBCentralInitOptions)

指定した中央デリゲート、ディスパッチ キュー、およびオプションを使用して新しい CBCentralManager を作成します。

[ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)]
public CBCentralManager(CoreBluetooth.ICBCentralManagerDelegate? centralDelegate, CoreFoundation.DispatchQueue? queue, CoreBluetooth.CBCentralInitOptions options);
[<ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)>]
new CoreBluetooth.CBCentralManager : CoreBluetooth.ICBCentralManagerDelegate * CoreFoundation.DispatchQueue * CoreBluetooth.CBCentralInitOptions -> CoreBluetooth.CBCentralManager

パラメーター

centralDelegate
ICBCentralManagerDelegate
属性

適用対象

CBCentralManager(ICBCentralManagerDelegate, DispatchQueue, NSDictionary)

指定した中央デリゲート、ディスパッチ キュー、およびオプションを使用して新しい CBCentralManager を作成します。

[Foundation.Export("initWithDelegate:queue:options:")]
[ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)]
[ObjCRuntime.DesignatedInitializer]
public CBCentralManager(CoreBluetooth.ICBCentralManagerDelegate? centralDelegate, CoreFoundation.DispatchQueue? queue, Foundation.NSDictionary? options);
[<Foundation.Export("initWithDelegate:queue:options:")>]
[<ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)>]
[<ObjCRuntime.DesignatedInitializer>]
new CoreBluetooth.CBCentralManager : CoreBluetooth.ICBCentralManagerDelegate * CoreFoundation.DispatchQueue * Foundation.NSDictionary -> CoreBluetooth.CBCentralManager

パラメーター

centralDelegate
ICBCentralManagerDelegate

追加する。

このパラメーターは、null に設定できます。

queue
DispatchQueue

追加する。

このパラメーターは、null に設定できます。

options
NSDictionary

追加する。

このパラメーターは、null に設定できます。

属性

適用対象