How to add CocoaHTTPServer to an iOS project on XCode 4
I'm trying to add CocoaHTTPServer to my project. I encountered many problems on the way - my problem (adding CocoaHTTPServer to a project (and have it working)) is still there - but I've also included the errors and solutions I encountered on the way for others' reference.
First I looked at tutorials on adding a framework, but it didn't look like a framework.
Next I right clicked on my project (on the left sidebar), and manually added it with "add files". I followed the SimpleHTTPServer example but got a "cocoa/cocoa.h" not found error. I searched around and found that Cocoa is for mac and not iOS. But the CocoaHTTPServer description talks about iOS apps too, so I just deleted the samples folder (the error was coming from the DynamicHTTPServer example if I recall.
Then I got a "Lexical or preprocessor issue libxml/parser.h not found" error. I tried adding it as a framework, but that didn't work. I found this tutorial on adding libxml to the header search path (at the end), but I ended up with 46 "Apple Mach-O Linker Error _CFHTTPMessage..." errors, and I decided to ask my question here. I tried this answer but got many Apple Mach-O Linker Errors
I added CFNetwork and Security frameworks (project => build phases => link binary with libraries), and was left with 2 errors:
ld: warning: path '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/usr/lib/libxml2.dylib' following -F not a directory
Undefined symbols for architecture i386:
"_NSlog", referenced from:
-[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I see i386 which is intel, and not the ARM architecture on iDevices. However, the real problem was I mispelled
NSLog (look carefully - it wasn't capitalized in the error message). When I googled this - other possible causes may be missing frameworks.
Now it compiles. When I run the sample application, I get the "server started on X port" and when I go to
localhost:X I get the welcome/success screen. When I do the same on my project, I still get the "server started on X port" messages, but when I go to
localhost:X the browser gives a "cannot connect" messages. No errors in the XCode console.
There are no errors from
[httpServer start:&error] and
httpServer.isRunning is true.
So what's the best way to add CocoaHTTPServer to my project? In terms of a clean setup - for example, when I inspect the sample iPhone project, I don't see any of the messy steps to add libxml - I don't even see libxml anywhere at all. And in terms of configuring everything so that it actually works and serves files. Right now, I'm suspecting there may be some project settings that need to be enabled for it to actually be a server.
I'm trying to write Cocoapods specification for my library which must modify Xcode project and add Run Script Build Phase to project's target. I thought I can use post_install hook. But pod spec li
Today I switched from XCode 3 to XCode 4 and now I have a lot of problems with my projects, which were under version control in XCode 3. If you install XCode 4, it will remember all your repositories.
I'm trying to use the CocoaHTTPServer found at https://github.com/robbiehanson/CocoaHTTPServer. I have added it to my project, and now, if i type on my browser something like this: 192.168.3.114:450
I have a serious long else if statement wich contains some links and some text. This is for Xcode 4, iOS 5 EDIT: stationList = [[NSMutableArray alloc] init]; [stationList addObject:@Q-dance Radio];
Qt for iOS creates an XCode project when you execute a build. How does one dictate the XCode project settings from Qt to set a target (minimum iOS version) and device (Universal/iPhone/iPad), as
How do I add a new project to source control (SVN) using Xcode 5? In Source Controller only checkout is clickable and all other are unclickable. i have existing copy of my project. And i want to upl
How do I make a compass show up in my app? There is no compass in the object library that I can just add to my view. So I figured that a compass must be added via code. I have been looking at multiple
like in finder I dragged some image files to the project now in Xcode how to add these image files in Xcode4 ?
I did 4 iphone application for different different categories of industry. Now I want to make more application for same category. So I want to know about how to make an iPhone project using any other
I'm having major issues linking gdata to a project after upgrading from xcode 3.2.5 to xcode 4. I would like to know if anyone is having similar issues, and what did they do to resolve them. i am usin
This question already has an answer here: Fonts not displaying in Interface Builder 3 answers I have a custom font in an (iOS) Xcode 4 project. This works fine, but whilst coding, I would like
Today I just opened the project I was working on XCODE 4, and only one XML file is being shown... the main editor window with the file explorer seems to be hidden. Is there any way to show it up? This
How can I reset Xcode 4 keyboard shortcuts to the default values? Thanks.
If I create a iPhone tab-style application in XCode (I use 4.2), what should I do after the project is created to configure it to design for iPhone 4 (high res) screen vs the 3GS and lower (low-res) s
In xcode 4.2 what's the way to create a new simple project? There isn't the choice to start a new based view controller application? Can someone explain me the new ways?
I am trying to figure out how to have the Bundle version number increment automatically in my Xcode 4 project (for ad-hoc and release builds). I found some scripts online that purport to do this but I
How do you organize your Xcode4 projects? With reference to groups/directories in Xcode vs. on Disk With reference to SCM (I'm using Subversion for my projects) I'm looking for something similar t
I've renamed a project in xCode 4 by slowly double clicking the project name and then following the directions. I then Build and Run with no errors, but when I select a popover in the app simulator ge
If I install Xcode 4.2 and iOS SDK 5 beta (Snow Leopard), will I still be able to build and run for iOS SDK 4?
I made a unity project and convert this into iOS project, this create many files which are readable for xcode, now i want to embedd this into another ios project. I am facing difficulty that how can i
Hi i get problem with xCode 4. I develope project with XCode4 on home and on work. And i store it on my USB flash drive. Today i get some problem. I open xib file for add outlet to code and get next e
This is driving me nuts, and I assume that it's something simple. I'm trying to create a new iOS 5.1 / iPhone 4 app with Xcode 4.5 and using my iPhone 5 for testing. I've made a new project with a sto
I wish to add an ASP.NET Web API to an ASP.NET MVC 4 Web Application project, developed in Visual Studio 2012. Which steps must I perform to add a functioning Web API to the project? I'm aware that I
I'm trying to add TICoreDataSync to my project, my plan is o sync core data between 2 apps (mac and ios). i try to follow the tutorials (for ios,for mac) but it seem to be old, the described folder ar
Argggh, I have built a couple Apps in Xcode 4 but I cannot remember/find how to add my live device to my schemes drop down. I have the simulator options, but in the newest project I created I do not h
The other day, I was going through my xcode archive looking for a specific build, and I saw that they all looked the same! The question is pretty simple, but I haven't been able to find any way to do
I'm new to IOS development. I'm wanting to add to a new storyboard project that is a universal masterdetail a simple login control that is required before the user can go any further. that is, I alway
how can i add .a file in my xcode
I started off the project without Core Data and now I would like to add that functionality to my apps. How do I do this? What additional things does XCode sets up when you actually tick the Use Core
I am trying to add MWPhotoBrowser library to my ios project which uses storyboard and arc. I am getting all sorts of nasty errors. The method proposed in gethub is somewhat not clear. So if anyone can
I want to create an app icon, splash screen, edit the app name, and set some cordova / app settings. meteor run ios opens up the simulator but doesn't open or the project. Where is that project and do
With the revamp of XCode I am having a lot of trouble working out how to add make one xcodeproj dependent on another. It was hard enough to work out before but now I am just stuck. If I drag lib.xcode
I am trying to add a dependent project in XCode 4. The link to the project is this: https://github.com/jverkoey/ObjQREncoder The author described a way to add this but it's for XCode 3. I am trying to
I have a working Xcode project that includes Cocos2d in one of the views. I now need to add Box2d. I tried dragging the Box2D folder into the libs directory of my cocos2d-2.x-ARC-iOS folder and adding
If I create a new iOS 5 project using one of XCode's templates and use ARC and set the deployment target to 4.3 and then try to run it on an iPhone (which is provisioned) which has iOS 4.3.1 installed
The Git integration in XCode 4 is very welcome however it seems to be a bit flaky when it comes to dealing with remote repositories. For clarity I'm using OS X version 10.6.7 and XCode 4.0.2 (4A2002a)
I have a txt file with values(All english words) and am parsing the values from txt file in my code. But, it takes a long time to parse. I want to add the the values with keys in plist. I don't know h
i have XCODE project that implement speech recognition (OpenEars sdk). i am wrapping this class for UNITY3D. OpenEars gives me this folder that i must add to the project : i have added the folder ma
I want to use Matthijs Hollemans' MHRotaryKnob control in my iOS 5 app. I am using a storyboard in Xcode 4.2. MHRotaryKnob is implemented as a subclass of UIControl. I'm unable to replicate the exampl
I'm trying to use a separate C header and implementation file in Xcode iOS/Objective-C project. I want to use the method I implemented in main.m but I get these errors: Full size here I've included u
I need to add a .mm file which contains both ObjectC and C++, I am wondering how to do it using XCode 4?
How to make universal Static Library ( .a file) in iOS using xCode? iOS portfolios
I have a huge Mac project in XCode. I want to convert it, or add a build target for the iphone as well. Now my problem is that my project has approximately 200 files, and there are 192 compile sourc
I am wondering if it is possible to add a run script build phase to another Xcode project from within my Mac utility app. I can see what takes place in an Xcode project when a run script is added (doi
Basically I want to make an independent copy of my XCode project and all of my files. How can I do this? I'm researching graphing frameworks and I want to use the same UI for each.
I've found plenty of people using Xcode 3 to do this, but it no longer seems to work in Xcode 4. Or, it works partially… I've added a preprocessor macro TEST_TARGET for Debug and Release under my Te
In Xcode 3, it was relatively easy to sort the source tree by name (see answer here for more details). However, I can't figure out how to sort the files and groups in Xcode 4 without manually dragging
I am currently learning Objective C programming using Xcode. I am wondering how to have multiple main programs, i.e. source members with main method in it, in a single project? It is a bit inconvienie
As mentioned in title I need some help on working workspace with static libraries! This is my situation: App project; Library A Library B The depends: App projects depends by Library A and Library
When we hit run button in XCode4 & if project is already running, it prompts as follows. My question is what does it will do if I tap on Add button ? Does it means, add local changes quickly to