Xcode 4 - Workspaces - xcode

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.

Related

Xamarin Form Project: Does Not Have A Dependency Folder

I've just created a new xamarin form project, but couldn't find the folder dependencies folder under my shared project, this folder usually below the Getting Started file.
This lead to I can't add the nuget package for my shared project.
I'm using visual studio 2017 and xCode 10.3
So how can I find this folder on the xamarin-form project?
my project image
There are two types of xamarin forms code sharing strategy: .NET Standard and Shared Project. I guess that your project is of type Shared Project, which makes sense if there were no dependencies folder.
please read the following article:
https://medium.com/#daRochaPires/xamarin-pcl-vs-shared-project-a838806d5cc6

Automatically build library

I have a Visual Studio project which uses a library (both written in C). Often I make a change to the library as well as the project. Each time I make a change to the library I click on the build button then go back to the project and build that.
What I would like to do is specify something such that when I build my project it checks the library, finds that it needs to be built, build the library then continue to build my project.
Is there a way?
In Solution Explorer, right click on the solution. Select Properties then Project Dependencies. Use the dropdown under Projects and select the project you are building. That will bring up a list of all projects in the solution. Put a check mark on each project that depends on the project you are building. This assumes, of course, that your libraries are also projects in your solution.

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.

iOS: Xcode projects relativity

I often encounter several Xcode projects from the web that have another Xcode project within them.
What I mean is that there are another Xcode project included from another.
What does it do and how do it work? Just curiosity...
Projects or Xcode workspaces can include additional projects. Sometimes it is better to split parts of develompmet into different projects and not always is the result of the project an application. I can be a custom library you may use in the other project.
So if you make changes to the library only you don't have to compile the complete application. Just rebuild the library and link it to your application in the other project.

How to create framework from Xcode 4 project?

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.

Resources