NSUrlConnection.SendRequestAsync(NSUrlRequest, NSOperationQueue) 方法

定义

加载数据并在完成后调用方法。

[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.None, "Use 'NSUrlSession.CreateDataTask' instead.")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.TvOS, 9, 0, ObjCRuntime.PlatformArchitecture.None, "Use 'NSUrlSession.CreateDataTask' instead.")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.MacOSX, 10, 11, ObjCRuntime.PlatformArchitecture.None, "Use 'NSUrlSession.CreateDataTask' instead.")]
public static System.Threading.Tasks.Task<Foundation.NSUrlAsyncResult> SendRequestAsync (Foundation.NSUrlRequest request, Foundation.NSOperationQueue queue);
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public static System.Threading.Tasks.Task<Foundation.NSUrlAsyncResult> SendRequestAsync (Foundation.NSUrlRequest request, Foundation.NSOperationQueue queue);
static member SendRequestAsync : Foundation.NSUrlRequest * Foundation.NSOperationQueue -> System.Threading.Tasks.Task<Foundation.NSUrlAsyncResult>

参数

request
NSUrlRequest

要执行的请求

queue
NSOperationQueue

要将完成调度到的操作队列。

返回

表示异步 SendAsynchronousRequest 操作的任务。 TResult 参数的值的类型为 Action<Foundation.NSUrlAsyncResult>

属性

注解

SendRequestAsync 方法适合用于 C# 异步,方法是将控件返回给具有表示操作的 Task 的调用方。

适用于