6

In iOS, you can add frameworks when you go to "Your Project" =>"Targets" => "Build Phases" and then press the add button to add frameworks.

So, lets say I wanted to add CoreVideo framework, CoreMedia framework, and CoreGraphics.framework. How can I add these frameworks to my Xamarin iOS project?

I am new to Xamarin iOS. thanks for reading, I appreciate any comments or suggestions.

4

1 回答 1

9

In most cases this is done automagically for you.

E.g. when you use a type from MonoTouch.CoreGraphics, like CGColor, then the tooling will add a reference to the CoreGraphics framework. No further action is required from you.

The only time when you need to manually specify frameworks is when you link with a native library that has dependencies on some framework(s) that your application itself might now have.

In general, when you create bindings to an Objective-C library, you add such requirements inside the [LinkWith] attribute. E.g.

[assembly: LinkWith ("libX.a", LinkTarget.Simulator, Frameworks="CoreGraphics")]

You can add several frameworks by separating them with a space.

You can also use the Additional mtouch arguments (from your Project Options) to specify options to the native linker if you do not use a binding project, e.g.

-gcc_flags="-framework CoreGraphics"
于 2013-07-05T18:54:34.033 回答