iOS: Duplicate interface definition for class 'EAGLView' - ios

I am developing an iOS project where i'm using Cocos2d,3d and also Augmented reality based Metaio SDK Metaio SDK link in an iOS project.
This Metaio integration uses a file EAGLView.mm and EAGLView.h. Cocos2d is already having EAGLView.m and EAGLView.h. If i build, i get
`Duplicate interface definition for class 'EAGLView'`
How can i make both files working in this project? Please advise!
Thank you!

You can refractor one of the class names. I think the would be the quickest, easiest way. Xcode has an option similar to ^click>refractor and choose name.
I also recommend saying yes, when Xcode asks you if you want to take a snapshot of the project first, just in case.

Related

How to use Cocos2d-Swift in existing project

I got an existing Objective-C project. Now I decided to rewrite some code and add Cocos2d to it. I know this framework for a long time and I recently discovered that they stopped the support for Cocos2d and created a new version called Cocos2d-x. There I found the Swift library and I asked me how to use the Cocos2d-Swift framework in my existing Objective-C project ? A step by step tutorial would be great. I searched a bit in the internet and found this:
Stackoverflow Link
But since the post is from 2011 it does not cover how to add the swift library, since Swift wasn't introduced at this moment.
Cocos2d-swift is a bit of a misnomer : it is currently written in objective-c. The software is now distributed with SpriteBuilder, that is why there is no 'install.sh' as there used to be. So integrating it into your project should not be too difficult. Use SpriteBuilder (from the AppStore) to create a 'blank' SB project, and see how cocos2d is integrated in there. Then, what you see is what you integrate !
caveat : Cocos2d is now ARC, so it is best your project defaults ARC. Otherwise you will have to do a lot of Xcode click-click-click to make the reference count strategy file specific.

Creating an iOS library or framework using libgdx (roboVM)

Is it possible to create an iOS library or framework using libgdx (RoboVM) that can be imported into Xcode?
Background:
One of my colleagues has created a 3D visualisation app as a libgdx project for android and windows desktop. It can be compiled to run on iOS using RoboVM. However, I would like to wrap extra native user interface elements around it using Xcode. I know its possible to build the user interface programmatically via RoboVM but I would be keen to investigate if its possible to bring the existing work into Xcode. I don't need to edit the 3D visualisation component but add extra GUI elements around the 3D Vis window. I thought compiling the libgdx (RoboVM) code to a framework or library might be a solution that could be imported?!
Yes you can do it.
All you need to create a method, say initRoboVM(), This will be called by your code when you want to initialize libgdx. You'll need to pass the app path in, which you can hardcode when you're testing.
initRoboVM() will need some modifications, namely it should not call your Java app's main method, well, at least, that's what well behaving libraries should not do IMO. It should also not call rvmShutdown.
You can get further information from here
Thanks :)
I asked the RoboVM team directly. Their answer: It's not a native function, but it certainly can be done.
The complete message...
Hi,
Sorry for the late reply. This use case is not something we're going
to do now. It is possible though if you're prepared to do some
patching of RoboVM. Search the RoboVM Google Group and you should find
others who have managed to get this working.
We get this request every know and then so we will add support for
this eventually.
Regards, Niklas

Why doesn't Xcode have an ios framework option?

I've seen project such as ios-universal-framework, but I want to know why XCode iOS does not natively support having a framework. Is it some kind of legal issue. The static library option is not good enough because I want to be able to use .dylib files in my framework.
A little background on what I want to do with a framework. I have a project that is generated from Unity3D, and when we update, we have to manually add back all of our project changes.
What I want is to use a framework that can store most of those external libraries and resources to make it easier to upgrade our project when updates are released.
From a security perspective no code is allowed to be dynamically loaded, thus only static libraries are allowed.
It is possible to create static psudo-frameworks. Take a look at GitHub iOS-Universal-Framework.
What you need is a PosprocessBuilder as described in the build pipeline described in the Unity3d Documentation.
You can manage the Xcode configurations in this pipeline using scripts like the Xcode Zerg.
I've used one python script written by a guy called Calvin Rien that worked really well, if you want to know more about this script this blog post should give you a hint.
What you really need to look for to you automate the these steps is to look for posts of Continuous Integration using Unity 3d and iOS like this one:
Unity3d: from commit to deployment onto tester devices in 20 min using Jenkins

How can we create class diagrams in Xcode 4.6.1 with the existing code of iPhone app?

I am using Xcode 4.6.1, I want to create class diagrams from existing code in Xcode please help me with it. I tried with different tools like autograph, Omni Graffle but confused with those.Creating class diagram for documentations in ios.
Please give me help on how to create class diagram for existing code in iOS with Xcode.
There is no built in functionality in Xcode for creating class diagrams. As you mentioned in your answer, your best option is to use a tool like Omnigraffle.
You can simply drag your Xcode project file onto Omnigraffle's icon and it'll scan your project and create a class diagram for you. You're then free to tweak it and make it look how you like.

appcelerator module for existing ios project sdk

I want to use into my titanium project the functionalities provided by an existing sdk (deezer sdk).
I know I must deal with modules, so I found a lot of tutorials that explain well how to create a titanium module from scratch. But I didn't find something about to explain how to "wrap" an existing ios project within a titanium module. I just need the login/signup functionality and to retrieve the logged user (functionalities provided by the deezer ios sdk, of course).
can anybody help me on how to proceed?
thanks in advance
Dario
After creating the vanilla module, you have to include the framework you are wrapping (so deezer SDK) inside the bundle. Then follow these steps to add the framework to the compiler directives. Essentially you just add this:
OTHER_LDFLAGS=$(inherited) -framework DeezerSDK
To the module.xconfig file. Just check what the exact name is of the SDK.
After that, you can use the DeezerSDK just like you would in regular native Xcode development.
EDIT:
If the library is just a *.a file, then you can model what Titanium did for the Google Admob module. Its best to just inspect their project, bt essentially all that you need to do is create the vanilla titanium module, drop in the *.a file, and the headers, and then use it just like a native project.

Resources