English 中文(简体)
一项SiCode申请可参考莫奥托库集会吗?
原标题:Can an iOS XCode application reference MonoTouch assemblies?

我正在考虑如何以最佳方式将新项目小组的工作分开。 我们设立了一个Windows C应用服务小组和一个小型的OS-C小组。 还将要求尽早或更晚地申请安乐器。

连接我们服务的仪器和与当地数据库同步操作的域层/大型组件是用C#书写和用Mono Touch汇编的合乎逻辑的组成部分。 然后,目标小组参考了这一构成部分。 这是可能的吗? 我在莫奥·托库奇集会上读了话,但是它能否以其他方式工作?

如果有可能的话,听听听从任何试图采取这种做法的经验是令人费心的!

Thanks Aaron

最佳回答

虽然技术上是可能的,但今天这样做并不容易。

现在,你可以做的是从C#开始申请,然后,如果你想要的话,将控制权转让给你的目标C法典。 在“C#”发射期间,你可使用P/Invoke来登记《目标C法典》所呼吁的方法,如:

delegate void some_callback_t (int parameter1, int parameter2);

[DllImport ("__Internal")]
void SetCallback (some_callback_t callback);

static void mycallback (int parameter1, int parameter2)
{
    // Here goes your C# logic to be called by C
}

然后请:

SetCallback (mycallback);

通知说,背书必须是一种固定方法(限制静态汇编)。 之后,您的《目标法典》可以通过实施诸如:

 typedef (*callback_t) (int p1, int p2);
 callback_t callback;
 void SetCallback (callback_t cb)
 {
     callback = cb;
 }

 void InvokeCSharp ()
 {
     callback (1, 2);
 }
问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签