TapForTap iOS SDK を Monotouch C# アプリケーションに移植しようとしています。
ドキュメントとバインディング ジェネレーターを使用して、次のバインディング ApiDefintion を作成しました。
namespace TapForTap {
[BaseType (typeof (NSObject))]
interface TapForTap {
[...]
[Static]
[Export ("initializeWithAPIKey:")]
void InitializeWithAPIKey (string key);
}
[BaseType (typeof (NSObject))]
[Model]
interface TapForTapAdViewDelegate {
[Abstract]
[Export ("rootViewController")]
UIViewController RootViewController ();
[...]
}
[BaseType (typeof (UIView))]
interface TapForTapAdView {
[Static]
[Export ("initWithFrame:delegate:")]
NSObject Init (RectangleF frame, TapForTapAdViewDelegate d);
[Export ("loadAds")]
void LoadAds ();
[Export ("stopLoadingAds")]
void StopLoadingAds ();
[...]
}
}
私のプロジェクトでは、TapForTapAdViewDelegate を実装するクラス TapForTapDelegate を作成しました。
public partial class TapForTapAdDelegate : TapForTapAdViewDelegate {
public override UIViewController RootViewController () {
return Application.mainViewController;
}
[...]
}
問題は、initWithFrame:delegate: 関数を正しく実装したかどうか本当にわからないことです。
次のコードを使用しようとするたびに、NSInvalidArgumentException Reason: +[TapForTapAdView initWithFrame:delegate:]: unrecognized selector sent to class 0x36dac4
bannerAd = (TapForTapAdView) TapForTapAdView.Init (new System.Drawing.RectangleF(0, y, 320, 50), new TapForTapAdDelegate());
私は何を間違っていますか?何時間も試しましたが、解決策が見つかりませんでした。私は C# や Objective-C ではなく、Java に慣れています ;)