I have two xcode projects one is a Gstreamer project( using Gstreamer single view templet) and other is a single view ios application. Now I want to integrate them into a single project. How can I do that.
Few things that I have tried:
1. I created a new project and copied the .xcodeproj files of both projects but I did not know what to do with the main.m file and storyboard file(I have one storyboards in gstreamer project and one in the other).
2.I tried copying the the UI project into Gstreamer project.
3.Tried copying gstreamer into UI project.
Should I create a Gstreamer project and the UI project into it or vice-versa or should I create a normal project and add both the projects into it.
I am really confused.
Please suggest the right way of doing this.
This makes a lot of sense when you are trying to integrate two project into one. There are a couple steps required for doing this.you can refer following link to do this. Xcode 4.2 how include one project into another one?
simple drag .xcodeproj files to xcode navigator area -> your folder.
something like this.
Related
I have a Xcode project and it's running well.
But now I want to convert my Xcode project into importable cocoapods, so I can import same cocoapods in multiple Xcode project and create new separate app with same features. (by changing some UI configuration only)
(Basically, I want to move whole app/project into cocoapods, including storyboards, assets and all files. so I can create another similar app by just re-branding UI)
Can someone please help me how to configure and setup for this kind of structure?
Thanks.
I know this is a very simple - maybe obvious - question, but I've been struggling with it for a while. I'm working on a SpriteKit project in XCode (using Swift) and I'm trying to add this SKEasing Framework from GitHub.
I've already downloaded and extracted the zip file, and I did everything that 孙博弘 answered including the bridging header (which I made the with the help of this site);
However, the framework doesn't seem to be working. I can't use any of the actions provided by this library. Is there something I'm missing? What am I doing wrong?
You don't add the project to your project.
First open the SKEasing project in xcode by itself. Set the build target to generic iOS device. (With the pop up in the top left corner of the xocde project window.) Then use the Build command (under Product) and when that's done run Archive. There should be a library built now under the products folder (left side of project window). Control click on the library name and select Show in Finder. This will lead you to the library. Copy this file to your project and you should be good to go.
if you use .a, you should use it as follow img.
A while ago I developed an iOS application using Xcode that and created a bunch of classes that work together to communicate with a RESTful API. Now I'm creating a second app, totally separate but communicates with the same API. I want to reuse these classes, what is the best way to approach this? Should I be do the via some Version control system? Or should I use an Xcode workspace?
Thanks in advance for any help.
I prefer to create separate Git repository for selected files, and embed this repository as submodule in both projects (old and new one)
In similar situation I done it using XCode Workspace and Static Library.
I added the common classes to a Static Library project and added that to the XCode Workspace.
In my second project I added that Static Library Project.
I have two options there:
Adding that Static Library project to the new project workspace
Adding the static library (.a) project to the new project
I chose the first option because, I can add the other common files to that Static Library and also modify the existing files if needed.
As Midhun and yourself mentioned, the best way to do it us by making a workspace and adding your projects to that.
Your shared code can go into a new project that's basically empty and dragged/linked from there into any projects in your workspace.
Changes made to that code from any project will also update the shared code base, which I think is what your ultimate goal was.
I'm working on an iOS app where I use third party libraries. I want to migrate my project to use ARC, but the third party libraries are still using the old memory management. So I want to separate third party code and put it in a separate project without ARC, and then somehow link that project into my iOS-app project, so that they will be built together using the same configuration.
Is this possible to do in a very simple way, or am i better of just turning off ARC for the individual files? (seems very tedious..)
Can I use a workspace? Where one project is my iOS app and the other just contains third party code?
I've played around a bit and googled a lot, but there just doesn't seem to be any simple soultion, or am I wrong?
So I figured it out myself, with a lot of help from different blogs. Something this basic should be more trivial and well documented... But here we go, this is what I did to get a library for AsiHttpRequest:
Create a new iOS project. Select the 'Cocoa Touch Static Library' template. Call it whatever you like. You don't want to tick 'Use automatic reference counting', since AsiHttpRequest does not support it.
Select a location for your library project (will matter later on).
Delete the default .h- and .m-file created by Xcode.
Drag and drop the AsiHttpRequest files into the project
You can add the frameworks that AsiHttpRequest is dependent of, but you will have to add them to your main project anyway, so it is not necessary.
Try to build the project, it should do so without errors.
Open your main project
From finder, drag your library .proj-file into your main project (in Xcode, so that it 'lands' onto the main project file)
The library project should now appear under your main project (still in XCode). It should be expandable and you should be able to see the library project files as well. If it doesn't, try closing all open projects and reopen the main project.
Select the main project, and select target. Under Build Phases - Link Binary With Libraries, click the +-sign.
In the list of frameworks you should see your library project (called something like libname.a). Select that file
The newly added file might appear red in the list of frameworks, don't worry, it works anyway. Guess it's a bug.
Still under target, go to Build Settings
Under Header Search Paths add the relative search path to where the library .h-files are. This is relative to your main projects .proj-file. (For example ../some folder/libproject/)
Hopefully your main project will build without errors and the library project will be built at the same time, using the same configuration as the main project.
I have no idea if this is a good approach or if there is some easier way to do it. However, I like this, since I can use the library project in several projects. And if I want to update the library project, I only have to do it in one place, and the other projects will be updated as well, since they all reference the same project.
Edit1:
I had some problems with library projects using objective c categories. I received unrecognized selector sent to instance errors in runtime when trying to call those methods. This problem was solved by following the answer given here.
Go to build settings of the target in the main project and add -ObjC to the entry called Other Linker Flags
Edit2:
I found this template for creating Universal frameworks. I haven't tried it, but I guess something like this would work as well.
I'm trying to pick up some better code organization practices. Over time, I've developed a collection of utility-type files that I import into all of my iOS projects. Rather than continuing to copy them in, I want to setup a separate "Library" project which builds these files to a static library. Then, I reference the static library in my app's project.
In Xcode 4.2 I created a new project "JTLibrary" with a static library as the target, added some files, and it builds as expected.
Now, I created a new project "LibraryTest" which should behave like any other app project I might be working on. My understanding was that I should be able to drag the JTLibrary project into this project to create a cross project reference. Once that was done, I would link LibraryTest's binary against the static library from JTLibrary.
However, when I drag the JTLibary project into the LibraryTest project, it does not appear expandable. I expected I should be able to see the files in it, etc. See screenshot below:
Can anyone offer some insight to why the project appears like this rather than expandable? Once it is expandable, I should be able to see the static library in the app's project.
Thanks!
EDIT 11/7
It's worth mentioning that I'm working with a VERY basic project now. From the new project window, select Framework & Library >> Cocoa Touch Static Library. Add one function to the default class and build.
I can copy the header and .a files into another project and use them successfully, but if I try to drag the project itself, it appears like the picture above.
To create a subproject simply drag a project node from Finder into Xcode.
DO NOT open two Xcode instances and drag the project node from one to the other (that's why the subproject is not expandable).