22. 使用Objective Sharpie
• Objective Sharpie is a command line tool
(provided by Xamarin) that can assist in
creating the definitions required to bind a
3rd party Objective-C library to C#.
• 下載並安裝
– http://files.xamarin.com/~abock/ObjectiveShar
pie/ObjectiveSharpie-1.1.1.pkg
27. ApiDefinition.cs
• using System;
using System.Drawing;
using ObjCRuntime;
using Foundation;
using UIKit;
using CoreGraphics;
namespace AwesomeMenu {
// @interface AwesomeMenuItem : UIImageView
[BaseType (typeof (UIImageView))]
interface AwesomeMenuItem {
…後面還有
39. 參考
• [Xamarin.iOS] 如何引用Objective-C寫的
Class Library
http://www.dotblogs.com.tw/toysboy21/archive/2013/08/27/115697.aspx
• Xamarin - Walkthrough: Binding an
Objective-C Library
http://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-
c/Walkthrough_Binding_objective-c_library/
Hinweis der Redaktion
ApiDefinition.cs - This file will contain the contracts that define how Objective-C API's will be wrapped in C#.
StructsAndEnums.cs - This file will hold any structures or enumeration values that are required by the interfaces and delegates.