块的Monotouch绑定语法

时间:2012-06-04 09:53:45

标签: c# binding xamarin.ios objective-c-blocks

美好的一天,

我正在尝试在Monotouch中为此添加绑定:

- (void)capturePhotoAsImageProcessedUpToFilter:(GPUImageOutput<GPUImageInput> *)finalFilterInChain withCompletionHandler:(void (^)(UIImage *processedImage, NSError *error))block;

我到目前为止:

[BaseType (typeof(GPUImageVideoCamera))]
interface GPUImageStillCamera{
    delegate void [**What should i put here?**](NSData processedJpeg, NSError error);

    [Export ("capturePhotoAsJPEGProcessedUpToFilter:")]
    void CapturePhotoAsJPEGProcessedUpToFilter(GPUImageOutput finalFilterInChain);
}

我已经阅读了作者放置NSSetEnumerator的文档,但我无法绕过他/她从哪里获取它。

请帮我解决这个问题。

谢谢!

1 个答案:

答案 0 :(得分:4)

你用这个:

  delegate void CaptureCallback (UIImage processedImage, NSError);

  [BaseType (typeof (GPUImageVideoCamera))]
  interface GPUImageStillCamera {
       [Export ("capturePhotoAsJPEGProcessedUpToFilter:withCompletionHandler:")]
       void CapturePhotoAsJpeg (GPUImageoutput finalFilter, 
                                CaptureCallback completionCallback);
  }