我正在为小马调试器写一个绑定,这应该是非常简单的权利? - 但是当我打电话“PDDebugger.DefaultInstanceMonoTouch绑定到小马调试器 - PDDebugger.DefaultInstance始终为空
[assembly: LinkWith ("libPonyDebugger.a", LinkTarget.Simulator, ForceLoad = true)]
namespace PonyDebugger
{
[BaseType (typeof (NSObject))]
interface PDDebugger
{
[Static] [Export ("defaultInstance")]
PDDebugger DefaultInstance { get; }
[Export ("enableViewHierarchyDebugging")]
PDDebugger EnableViewHierarchyDebugging();
}
}
我可以编译绑定罚款:
小马通过类成员“defaultInstance”
@interface PDDebugger : NSObject
+ (PDDebugger *)defaultInstance;
,我有这样的执行访问“我只是回到空。我错过了什么?
我怎么能确定消息被传递给底层的ObjC对象?
谢谢!
[编辑] 我已经更新我的绑定到: 使用系统;使用MonoTouch.Foundation的 ;使用MonoTouch.ObjCRuntime的 ;
** ** libPonyDebugger.linkwith.cs
[assembly: LinkWith ("libPonyDebugger.a", LinkTarget.Simulator, ForceLoad = true,
Frameworks = "Security CFNetwork Foundation CoreGraphics UIKit CoreData", LinkerFlags = "-ObjC -licucore")]
namespace PonyDebugger
{
[BaseType (typeof (NSObject), Name="PDDebugger")]//, DisableDefaultCtor]
interface PDDebugger
{
//+ (PDDebugger *)defaultInstance;
[Static, Export ("defaultInstance")]
PDDebugger DefaultInstance();
[Export ("enableViewHierarchyDebugging")]
PDDebugger EnableViewHierarchyDebugging();
}
}
** ** libSocketRocket.linkwith.cs
using System;
using MonoTouch.ObjCRuntime;
[assembly: LinkWith ("libSocketRocket.a", LinkTarget.ArmV7 | LinkTarget.Simulator,
Frameworks = "Security CFNetwork Foundation CoreGraphics UIKit CoreData", ForceLoad = true, LinkerFlags = "-ObjC -licucore")]
而这一切都btouches /编译为本地和运行 - 但PDDebugger。 DefaultInstance()仍然返回null。
您好jstedfast - 感谢您的答复。 我编译它和模拟器的示例应用程序 - 然后将libPonyDebugger.a和libSocketRocket.a从DEveloper/XCode/DerivedData复制到我的项目目录中,并使用'btouch -unsafe --outdir = tmp -out: PonyDebugger.dll libPonyDebugger.linkwith.cs -x libSocketRocket.linkwith.cs --link-with = libPonyDebugger.a,libPonyDebugger.a --link-with = libSocketRocket.a,libSocketRocket.a -v'我认为你是对的 - 我不认为这是加载,因为我在小马启动日志消息,但不要让他们在控制台中出现。 – Adam 2013-04-22 20:02:37
哦 - 我进行模拟器的所有运行 - 我实际上不需要设备支持... – Adam 2013-04-22 20:06:23