This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
iOS using existing project's class/resource files in another project
I have multiple iOS projects in my Workspace. Is there a way I can use the code of existing projects in my newly created project?
Yes you can reuse those codes.
1.Make a static library of the function which you want to reuse.
2.Add the static library and .h files in your project.And you can call directly those functions in the static library from your new project.
You can find nice tutorial to create static library:here
Related
This question already has an answer here:
Cocoa Touch Framework vs Cocoa Touch Static library
(1 answer)
Closed 4 years ago.
What is the difference between Cocoa Touch Framework and Cocoa Touch Static Library?
In which scenario both can be used?
Yes, they are different things. There's a bit of a discussion here: What are Frameworks?
In a nutshell, though, a static library is a collection of compiled source files which is then linked directly into an app's binary. That is, it becomes a part of your app's binary. A framework is a standalone entity that contains a binary containing compiled code (along with any related resources) that is a standalone unit itself. The page I linked to includes more details on specific differences.
Is this necessary to create static library for creation of framework or we can create it without help of static library what is diffrence betwwen them.
You have two options for creating framework, one is static library (code is linked at compile time) and iOS8 onwards dynamic framework(code is linked at runtime). Refer to following answers for knowing the difference between them :
Library? Static? Dynamic? Or Framework? Project inside another project
This question already has answers here:
Xcode 4.2 how include one project into another one?
(6 answers)
Closed 7 years ago.
May I know how can I use the whole application project in my another project in Xcode.
By simply dragging the whole project in my new project its not working ,showing the file is not imported , if I want to use any class of the existing project in my new project.
Thanks in advance.
Here are some great step-by-step instructions on how to add static library dependencies in more recent versions of Xcode.
Use these links .
Xcode 4.2 how include one project into another one?
XCode 4.2 and Using a Static Library Causing Problems
You need to create workspace (File -> New -> Workspace. In workspace you can add as much projects as you want.
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Is there a way to reconstruct an Xcode project file?
I'm new at ios and xcode. To view the functionality of an app, I'm usually given a project file (.xcodeproj) along with the source code. I double-click the project file and everything opens up nicely in xcode.
This time I wasn't given the project file. I just have a folder that has the source code in it.
How do I take the source code and make a project out of it? I tried Creating a new Xcode project, as well as connecting to a repository, but so far it hasn't been successful. Then again, I'm new at this and not sure what I'm doing. Thank you!
This guide provided by apple should give you a good step by step process to creating a new Project.
Once you have created your project, place all of you header (.h) and main (.m) files and the interface (.xib) files into your Project.
You shouldn't have a problem overall if you have all of the right files, and if the program is correctly built. If you incur more problems after you've done this, then there will most likely be a problem with your files.
Let's suppose that I want to create an Xcode static library.
I use the Xcode provided template for this kind of project "Cocoa Touch Static Library", i want this library in a separate project because:
I want be able to keep this project under git version control
I want to be able to import this static library under other project as a git submodule
Now let's suppose that this library depend on third-part library such as ASIHTTPRequest.
Maybe in my main project (the one that import my static library) i will also depend on the same library. What's the best way to handle this multi-dependecy?
PLUS: Now suppose that i want to create a second static library (this one is more specific for some kind of task and i don't want to mix this code with the code of the previous mentioned static library) but this second static library depend on the after mentioned static library. Again what the best way to handle this
Your question is not super clear, Luca, but let me see if I can help you out a bit.
In one of my own projects, I have a number of embedded (or "sub") projects which get built as libraries included in the main project. So if one file in the sub project changes, both the sub project and the main project pick up the changes.
With Xcode 3, it was a snap to simply drag and import one project into another project and if you have Xcode 3 installed, I highly recommend using Xcode 3 to embed one project into another.
Xcode 4 does handle projects already embedded within another project (like what you might have created using Xcode 3), but the ability to actually do the work on it's own is not fully implemented or baked yet (in other words: it does not work well or at all). Here's another question somebody else asked with more information that might help you.
Also, I noticed this other related question.
Does this information help you out?