# 请问如何将Objective-C代码和虚幻4整合发布在IOS上？

**URL:** <https://forums.unrealengine.com/t/objective-c-4-ios/358089>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 21, 2016, 6:35am UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089 "2016-05-21T06:35:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_f94ccbc0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f94ccbc0](https://forums.unrealengine.com/u/anonymous_user_f94ccbc0)\
**Post date:** [May 21, 2016, 6:35am UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/1 "2016-05-21T06:35:37Z")

</div>

如题，请问如何将Objective-C写的IOS原生XCODE代码整合进虚幻4引擎然后发布在IOS上？提前谢谢大家的回复，在线等！

---

<div class="post-metadata">

**Author:** ![Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://forums.unrealengine.com/u/Anonymous_22f547d62f00bac65c2343d67ba1c173)\
**Post date:** [May 21, 2016, 8:23pm UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/2 "2016-05-21T20:23:13Z")

</div>

> **[How to add iOS Plugin's .bundle??](https://forums.unrealengine.com/questions/371629/how-to-add-ios-plugins-bundle.html)**
>
> In Unity 4, just locate files(source , resource) to ’ Assets/Plugins/iOS '. It was very easy… How can I do with unreal engine? modify build script?? locate resource file to valid path? ex) Plugins/My Plugin/Content ?.. I try below, plugin’s...

---

<div class="post-metadata">

**Author:** ![Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://forums.unrealengine.com/u/Anonymous_22f547d62f00bac65c2343d67ba1c173)\
**Post date:** [May 21, 2016, 8:44pm UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/3 "2016-05-21T20:44:41Z")

</div>

build 系统  
[https://docs.unrealengine.com/latest/INT/Programming/UnrealBuildSystem/TargetFiles/](https://docs.unrealengine.com/latest/INT/Programming/UnrealBuildSystem/TargetFiles/)

> <https://stackoverflow.com/questions/24203425/unreal-engine-4-linking-ios-libraries>

> **[Can we use Objective-C code and iOS framework in UE4?](https://forums.unrealengine.com/questions/89830/ads-billing-3rd-party-libraries.html)**
>
> Hi guys, I’m new in Unreal Engine and am just in the investigation way but I have very important questions about UE functionality. I would like to clarify if UE(4, or eralier) has In-App purchases support (iOS, Android, etc.) Or, the most...

> **[IOS - How to add a framework with bundle.](https://forums.unrealengine.com/questions/338300/ios-how-to-add-a-framework-with-bundle.html)**
>
> Hello, I am trying a create a plugin for UE which requires me to add a framework and a bundle. I know,how to add framework as i have been able to create few plugins successfully,but,i don't know,how to add bundle. I have looked into the source...

> **[Universal Mobile Ads for iOS & Android](https://forums.unrealengine.com/showthread.php?93915-Universal-Mobile-Ads-for-iOS-amp-Android)**
>
> http://gamednastudio.com/plugins/images/UniversalMobileAds/Wiki1.jpg Universal Mobile Ads 15 ad networks for iOS & Android + AdMob mediation system Universal Mobile Ads integrates the AdMob ad mediation system for iOS & Android which lets...

> **[IOS AdProvider with third party framework](https://forums.unrealengine.com/showthread.php?80246-IOS-AdProvider-with-third-party-framework)**
>
> Hi, I am currently trying to add an AdProvider via a Plugin (for IOS mainly, Android was fairly simple compared). Plugin.Build.cs : // Add the framework PublicAdditionalFrameworks.AddRange( new UEBuildFramework\]{ new...

例子

> **[GitHub - getsetgames/Fabric: A plugin for Unreal Engine 4 that integrates...](https://github.com/getsetgames/Fabric)**
>
> A plugin for Unreal Engine 4 that integrates Twitter's Fabric SDK. - GitHub - getsetgames/Fabric: A plugin for Unreal Engine 4 that integrates Twitter's Fabric SDK.

> **[GitHub - gameDNAstudio/ParsePlatform: A plugin for Unreal Engine 4 that lets...](https://github.com/gameDNAstudio/ParsePlatform)**
>
> A plugin for Unreal Engine 4 that lets you integrate Parse.com native features into your project. - GitHub - gameDNAstudio/ParsePlatform: A plugin for Unreal Engine 4 that lets you integrate Parse....

> **[GitHub - getsetgames/Sharing: A plugin for Unreal Engine 4 that enables...](https://github.com/getsetgames/Sharing)**
>
> A plugin for Unreal Engine 4 that enables native sharing on iOS - GitHub - getsetgames/Sharing: A plugin for Unreal Engine 4 that enables native sharing on iOS

> **[GitHub - GameAnalytics/GA-SDK-UNREAL: A repository containing the...](https://github.com/GameAnalytics/GA-SDK-UNREAL)**
>
> A repository containing the GameAnalytics Unreal4 Plugin including documentation. - GitHub - GameAnalytics/GA-SDK-UNREAL: A repository containing the GameAnalytics Unreal4 Plugin including document...

> **[GitHub - getsetgames/Upsight: Unreal plugin for integrating the Upsight SDK. ...](https://github.com/getsetgames/Upsight)**
>
> Unreal plugin for integrating the Upsight SDK. Details can be found on their website http://www.upsight.com/ - GitHub - getsetgames/Upsight: Unreal plugin for integrating the Upsight SDK. Details...

---

<div class="post-metadata">

**Author:** ![Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://forums.unrealengine.com/u/Anonymous_22f547d62f00bac65c2343d67ba1c173)\
**Post date:** [May 21, 2016, 8:46pm UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/4 "2016-05-21T20:46:07Z")

</div>

打包以及发布

> **[Publishing a game on ios](https://forums.unrealengine.com/questions/220233/publishing-a-game-on-ios.html)**
>
> Do i actually need a mac to publish my game on the app store ?

---

<div class="post-metadata">

**Author:** ![TIANMIN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TIANMIN](https://forums.unrealengine.com/u/TIANMIN)\
**Post date:** [May 22, 2016, 2:02am UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/5 "2016-05-22T02:02:46Z")

</div>

帮你整理下格式。赞收集。

**简单结论**

1. [How to add iOS Plugin's .bundle?? - Plugins - Epic Developer Community Forums](https://answers.unrealengine.com/questions/371629/how-to-add-ios-plugins-bundle.html)

**Build 系统**

1. [https://docs.unrealengine.com/latest/CHN/Programming/UnrealBuildSystem/TargetFiles/index.html](https://docs.unrealengine.com/latest/CHN/Programming/UnrealBuildSystem/TargetFiles/index.html)
2. [c# - Unreal Engine 4 linking iOS Libraries - Stack Overflow](http://stackoverflow.com/questions/24203425/unreal-engine-4-linking-ios-libraries)
3. [Can we use Objective-C code and iOS framework in UE4? - Mobile - Epic Developer Community Forums](https://answers.unrealengine.com/questions/89830/ads-billing-3rd-party-libraries.html)
4. [IOS - How to add a framework with bundle. - Plugins - Epic Developer Community Forums](https://answers.unrealengine.com/questions/338300/ios-how-to-add-a-framework-with-bundle.html)
5. [Universal Mobile Ads for iOS & Android - Marketplace - Epic Developer Community Forums](https://forums.unrealengine.com/showthread.php?93915-Universal-Mobile-Ads-for-iOS-amp-Android)
6. [IOS AdProvider with third party framework - Mobile - Epic Developer Community Forums](https://forums.unrealengine.com/showthread.php?80246-IOS-AdProvider-with-third-party-framework)

**示例**

1. [GitHub - getsetgames/Fabric: A plugin for Unreal Engine 4 that integrates Twitter's Fabric SDK.](https://github.com/getsetgames/Fabric)
2. [GitHub - gameDNAstudio/ParsePlatform: A plugin for Unreal Engine 4 that lets you integrate Parse.com native features into your project.](https://github.com/gameDNAstudio/ParsePlatform)
3. [GitHub - getsetgames/Sharing: A plugin for Unreal Engine 4 that enables native sharing on iOS](https://github.com/getsetgames/Sharing)
4. [GitHub - GameAnalytics/GA-SDK-UNREAL: A repository containing the GameAnalytics Unreal4 Plugin including documentation.](https://github.com/GameAnalytics/GA-SDK-UNREAL)
5. [GitHub - getsetgames/Upsight: Unreal plugin for integrating the Upsight SDK. Details can be found on their website http://www.upsight.com/](https://github.com/getsetgames/Upsight)

**打包以及发布**

1. [Publishing a game on ios - Mobile - Epic Developer Community Forums](https://answers.unrealengine.com/questions/220233/publishing-a-game-on-ios.html)

由 **[肖吉星](https://answers.unrealengine.com/users/80722/%E8%82%96%E5%90%89%E6%98%9F.html)** 收集整理

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f94ccbc0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f94ccbc0](https://forums.unrealengine.com/u/anonymous_user_f94ccbc0)\
**Post date:** [May 22, 2016, 2:13am UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/6 "2016-05-22T02:13:39Z")

</div>

谢谢你这么详细的回答，但是并没有解决我面临的问题。虽然可以改成.mm后缀让虚幻4识别并发布，但是必须全部整合进一个.mm中才能识别。有很多第三方的代码，要全部整合进一个.mm里很复杂也不利于管理和以后开发。请问有什么办法能让引擎识别这些Objective-C的第三方的代码？ 不知道我表达清楚没有，再次感谢。 请先Uncheck accepted我的问题，谢谢。

---

<div class="post-metadata">

**Author:** ![TIANMIN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TIANMIN](https://forums.unrealengine.com/u/TIANMIN)\
**Post date:** [May 22, 2016, 2:47am UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/7 "2016-05-22T02:47:13Z")

</div>

这个问题就更清楚一些了。

看起来应该是将第三方的 mm 文件编译成静态库，然后通过 Unreal 的 UBT 把所需静态库链接到 Unreal 的编译链接环境中？

---

<div class="post-metadata">

**Author:** ![Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://forums.unrealengine.com/u/Anonymous_22f547d62f00bac65c2343d67ba1c173)\
**Post date:** [May 22, 2016, 1:13pm UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/8 "2016-05-22T13:13:46Z")

</div>

源码和静态库 framework 均可以 只要 build.cs 设置好 会自动复制 且链接库

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f94ccbc0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f94ccbc0](https://forums.unrealengine.com/u/anonymous_user_f94ccbc0)\
**Post date:** [May 23, 2016, 3:18am UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/9 "2016-05-23T03:18:03Z")

</div>

谢谢你们的回复，我尝试着在Build.cs里面设置，但是报错称找不到TestViewControl.h。如图，为什么会找不到？

 ![91550-qq图片20160523110602.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/b/41b4e4c19e10d86949111fde8f3400c55ea2aac5.jpeg)

 ![91571-qq图片20160523110533.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/3/9/c3961034ace3ef7a193af4eea848a5d3a0891526.jpeg)

 ![91573-qq图片20160523110943.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/e/78e7da4e78081a8a244364896b701dd57f7eb4a0.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f94ccbc0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f94ccbc0](https://forums.unrealengine.com/u/anonymous_user_f94ccbc0)\
**Post date:** [May 23, 2016, 10:09am UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/10 "2016-05-23T10:09:19Z")

</div>

再次感谢你的回答，现有的功能基本上都能正常使用了。但是.a的文件还是无法识别。请问如何加载动态库？在APP里想使用第三方的支付，例如支付宝和微信。

---

<div class="post-metadata">

**Author:** ![Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://forums.unrealengine.com/u/Anonymous_22f547d62f00bac65c2343d67ba1c173)\
**Post date:** [May 24, 2016, 12:34pm UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/11 "2016-05-24T12:34:22Z")

</div>

至于framework 上面链接中已经提及  
下面是windows 平台的

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

下面的是ios 静态库.a 的

> **[How can I get a plugin to start on iOS device?](https://forums.unrealengine.com/questions/36890/plugin-doesnt-start-on-ios-device.html)**
>
> Hello, I'm developing custom game plugin with Xcode. It runs on editor, but doesn't run on iOS device. Followings are what I have done: Copy BlankPlugin and changed name and contents to MyBlankPlugin. Add log to StartupModule. Make a dummy...

> **[How can I use iOS Libraries?](https://forums.unrealengine.com/questions/55969/using-ios-libraries.html)**
>
> I'm using a mac to write a game for iOS, I'm trying to use UIKit from xCode however when I import the framework I receive the error that it can't be found. "Shell Script Invocation Error 'UIKit/UIAlertView.h' file not found. Someone asked a similar...

> **[Thirdparty static library in mac](https://forums.unrealengine.com/questions/157210/thirdparty-static-library-in-mac.html)**
>
> hi, i am trying to add boost library into my UE4 project(4.6), but it can't find .a file when I try to compile it using xcode.(it is working in VisualStudio). I add library search path by using "PublicLibraryPaths.Add(LibrariesMacPath);", but it...

你可以在像ios 开发那样 链接静态库

> **[Creating a Static Library in iOS Tutorial](https://www.raywenderlich.com/2658-creating-a-static-library-in-ios-tutorial)**
>
> Learn how to create a static library in iOS in this tutorial, and how to use it from within different projects and architectures.

你也可以用示例中将静态库放在plugin 里你的module 或者ThirdParty module里 在 build.cs 指明库路径 库和头文件路径 加入宏定义也可 或者 引用plugin 里的ThirdParty 的module（

> **[What is the correct way to link to 3rd party software?](https://forums.unrealengine.com/questions/34660/correct-way-to-link-to-3rd-party-software.html)**
>
> Usually I’d specify the include and lib paths for a project in Visual Studio in the project properties. This works, but understandably as soon as you run the UE4 tool for refreshing the VS project it is wiped. How would I go about placing a 3rd...

> <https://stackoverflow.com/questions/31039406/unreal-engine-4-linking-static-3rd-party-library-sdk-libzplay>

---

<div class="post-metadata">

**Author:** ![Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://forums.unrealengine.com/u/Anonymous_22f547d62f00bac65c2343d67ba1c173)\
**Post date:** [May 24, 2016, 12:53pm UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/12 "2016-05-24T12:53:10Z")

</div>

参照 [ComScore/ComScore.Build.cs at master · getsetgames/ComScore · GitHub](https://github.com/getsetgames/ComScore/blob/master/Source/ComScore/ComScore.Build.cs)  
里面的写法 已经文件结构 里面有静态库 和安卓包

而且 [Get Set Games · GitHub](https://github.com/getsetgames) 有客观的针对移动端的UE4 插件 既有 framework 也有静态包 也有安卓的jar 包 so 我没看到， 仔细参照 build.cs 写法 和 upplugin 里的 module type 和 loading phrase [Plugins | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/Programming/Plugins/index.html#moduledescriptors)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f94ccbc0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f94ccbc0](https://forums.unrealengine.com/u/anonymous_user_f94ccbc0)\
**Post date:** [May 26, 2016, 10:32am UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/13 "2016-05-26T10:32:30Z")

</div>

十分感谢你耐心详细的解答，目前这个问题已经成功解决了。现在我面临着另一个问题，希望能得到帮助。  
【如何在手机端[IOS][Android]使用APEX模拟布料？】

> **[请问如何在手机端\[IOS\]\[Android\]使用APEX模拟布料？](https://forums.unrealengine.com/questions/425845/)**
>
> 如题，请问如何在手机端\[IOS\]\[Android\]使用APEX模拟布料？提前谢谢了！

再次感谢。

---

<div class="post-metadata">

**Author:** ![Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://forums.unrealengine.com/u/Anonymous_22f547d62f00bac65c2343d67ba1c173)\
**Post date:** [May 26, 2016, 1:02pm UTC](https://forums.unrealengine.com/t/objective-c-4-ios/358089/14 "2016-05-26T13:02:21Z")

</div>

提及不相关的 请另开主题 保持帖子 主题集中和篇幅 便于其他人查找  
UE4 并不是3dmax  
直接在3dmax 或者maya

[Unreal Engine 4 Tutorial: APEX Cloth (english) - YouTube](https://www.youtube.com/watch?v=oRaStTw0-l0)  
[PhysX SDK | NVIDIA Developer](https://developer.nvidia.com/apex-clothing-3dsmax-tutorials)  
一个是Physx Lab
