How to create framework from Xcode 4 project? - xcode

I want to use CHDataStructures as framework: https://github.com/davedelong/CHDataStructures. However there is no binary of the project.
So I assume I have to build the .a file myself using xcode. How do I do that in xcode 4? I read the documentation but it is very confusing...
Any ideas?

First we'll grab the CHDataStructures project:
git clone https://github.com/davedelong/CHDataStructures.git
Next, open the relevant CHDataStructures xcode project
open CHDataStructures-iOS.xcodeproj
I'll assume you're building for iOS from here on out (and mention what will be different for a mac app). Once xcode is up and running, ensure that iOS Static Library is selected in the scheme drop-down, and then hit run. Once done, xcode has built the binary for you, and you'll be able to find it in Products in the navigator. Open the required binary (for iOS it's the compiled .a binary, for Mac it's the .framework collection).
Finally (expanding on the documentation):
Open the Xcode project for your iOS app.
Add libCHDataStructures.a and the library header files (all the .h header files in the framework subdirectory from the xcode project above) to your project by dragging them to the "Groups & Files" pane of your xcode project.
In the project navigator, select your project
Select your target
Select the 'Build Phases' tab
Open 'Link Binaries With Libraries' expander
Click the '+' button
drag libCHDataStructures.a into the "Link Binary With Libraries" build phase.
Add #import "CHDataStructures.h" where necessary in your code.

Related

How to open existing flutter project from Xcode?

I have an existing flutter project, which coded with VS Code. Now I want to open it from Xcode to do some configurations in Runner.xcworkspace. But it was unable to open the project from Xcode and it shows the above warning. So, how can I open my existing project from Xcode now?
If you want to make changes in the Runner.xcworkspace and you are using VSCode, I would suggest you open the project in VSCode and Right-Click on the ios folder.
Here you will see an option: Open in Xcode.
Select that option and the iOS project of the Flutter project will open in Xcode and you can carry on with the changes as you want
One thing to note is that like Android Studio, Xcode is not supported for Flutter Development as of now so if you try to open the whole project it will not let you.
Note! Unlike Android studio, flutter isn't supported to XCode yet, you have to open iOS folder of Flutter project only and solely.
1- Open XCode
2- Select 'Open existing Projects'
3- Search your project through search bar in window or search manually through directory.
4- From your Flutter Project, open the iOS folder.
And here we go! You have opened it.
I successfully open the AppFrameworkInfo.plist file with Xcode as follows.
Open the project with Android Studio
Select the iOS > Runner folder
Navigate to Tools > Flutter > Open iOS Module in Xcode

Adding files to an Xcode project (SVN)

I "checked out" an SVN repo. The repo contains a few Xcode projects and a workspace. I can open the workspace, build everything, run the app etc. If I make changes to any existing file they will be taken into account when building the app.
Now I want to add two new files to the workspace/project. I want to modify these files and when ready "commit" and "push" (I normally use git) the files to the repo. I added MyClass.h and MyClass.m to the Xcode project via right clicking on the appropriate group in Xcode and selecting "Add file to MyProject...".
The project won't build because MyClass.h can't be found. I also see a warning from the workspace that "MyClass.h is missing from the working copy".
How can I add files to an Xcode project under SVN version control?
I tried the suggestions here Xcode adding new files to existing project in svn but nothing works yet. For example when the files I just added to Xcode are selected the menu option "Add Selected Files" in the Source Control menu is greyed out.
I'm using Xcode 5.
As a work around, you can use smartsvn which has options for adding and removing files in Modify top menu

View titanium code in xcode format

Is there a way to view the code typed in titanium in the xCode format? If so, which file should I check out under ProjectName/ProjectName.xcodeproj
This is the beauty of titanium that it uses the native code and you could run its project in xcode too.Double click on the ProjectName.xcodeproj and it would open your project in xcode and then you can run code from there
Thanks
In the build/iphone directory, you'll find an xcodeproj file.
Double-click it to open the project in Xcode. However, you might not
want to do your final build in Xcode. You'll lose internationalization
and perhaps other Titanium features that way. You can do you final
packaging in Studio. If they're not already installed into Xcode,
Studio will prompt you for your distribution certificate and
provisioning file. It will build your final IPA using the Build &
Archive equivalent of Xcode. You can use the Xcode Organizer then to
validate and upload the IPA. Or, use the
Developer/Applications/Application Loader tool to upload your IPA to
iTunes Connect
Reference : http://developer.appcelerator.com/question/122926/open-appcelerator-project-in-xcode

In XCode 4.3 how can I search other paths for frameworks and libraries to link to my project?

I am using XCode 4.3.3 and want to include custom frameworks (in my case OCMock) into my Mac OS X project. I have put OCMock.framework (version 2.0) into /Library/Frameworks for now and when I open the build phases tab for my unit testing target that I want to link against OCMock I have the option to add the framework here:
When I click the + button I get presented with a search dialog that I can use to search for frameworks. /Library/Frameworks is not being searched for here.
It just searches the frameworks directory inside XCode.app and the Mac OS X 10.7 SDK which I am building the project with.
So how can I extend the search dialog with more locations, for example, /Library/Frameworks so that I can easily search for and include OCMock.framework?
Don't place the framework in system directories. Instead, drag it into the Project Navigator in Xcode, and tell Xcode to copy the files into the project folder. Once a framework has been added to the project's files, you can drag it from the navigator into the Link Binary With Libraries build phase.

Xcode 4 - Workspaces

I'm using Xcode 4 workspace and have a framework project and base project, what is the best method to access classes form the framework project inside the base project without copying the files to the base project or rebuilding the app each with each Run.
I'm not sure if it is the best, but what has worked for me is to add the framework (built by the framework project) to the list of frameworks linked to the application in the base project. To do this, you can select the base project in the project navigator and select the Build Phases tab. Under there expand the "Link Binary with Libraries" section. Click on the plus button to add a library, and it should show you linkable libraries or frameworks available within the current workspace. Select the framework built by your framework project, and it will be linked into your base project's binary.

Resources