is there any way to create an XCode project without using XCode?
I want to create an XCode project from scratch i.e. I want to put together some .m & .h files and create a project that would run in XCode.
What do you mean by "without using Xcode"?
If you mean writing your own program that builds Xcode project documents completely independent of Xcode, you could reverse engineer the Xcode project file format. The Xcode project file format is rather simple. It's a package with a few XML like text based data files. The format is not documented, so you'd have to reverse engineer the file format. It sounds like a nice hobby that will greatly assist you in procrastinating from completing the actual project.
If you mean creating an Xcode project without manually operating the Xcode GUI, you could write an AppleScript script to automate the process. Xcode has an extensive AppleScript dictionary, allowing you to fully script the creation of an Xcode project and populate it with some .m and .h files.
Related
I downloaded the SwiftCSV parser.
I want to work with this software. I don't want install with CocoaPods.
How should I proceed?
I would really suggest using CocoaPods, as it just keeps your file & folder structure cleaner.
If you still want to avoid using CocoaPods with Swift you just need to drag and drop the file into the file navigator in Xcode. By doing so, you automatically add the file to the target and the autocomplete functionality should pick it up when using the methods in other files, classes, functions etc.
In your case, take the CSV.swift file and drag and drop it into Frameworks Folder in Xcode.
I am looking for a simple library ( and/or app - eventually want both ) example ( like a math library or whatever) for iOS which has a makefile for it that I can use as a template to make other makefiles from and learn. Static of course, (and dynamic if iOS supports it so I can have 2+ apps that share common code)
There is lots of incomplete and cryptic info out there but so far I havn't found any nice concise "with these source files" you create a makefile this way to build an iOS "fat" library I can import into other projects.
This would be on a Mac with the ios4 sdk installed.
It is always great to start with something that basically works.
I have created complex makefiles before for unix and windows and for other devices.
thanks.
The first link pictorially represents the process step by step that you've asked then the second link contains a package that allows a programmer to compile a make file based project
click me
click me
If you want to build a static library using a make file and link against it every time you build your Xcode project, you can add a "run script" build phase in your project before all the others, which runs this make file, and then add the built library to your linking phase. If you want a make file that builds the entire iOS project, I don't think it's posible (you can use the command line to compile the project without Xcode opened though).
How do I reference another project which has code I wish to leverage in XCode 4. In particular I'm trying to make use of the NSDate extensions from here.
Some notes:
I was assuming I should probably reference rather than trying build a framework
I tried copying the existing "Hello World" xcode project file across into my project, however this didn't seem to work
Do I need to create a new "Target" based on "coco touch static library" option?
Then would I need to Edit the current Product Scheme so that when I build the new target would build
What do I need to do on my project side exactly - should going Add Files, and choosing the extensions Xcode Project File be enough?
thanks
I was assuming I should probably reference rather than trying build a framework
yes, reference and link with it, unless you need only a bit of it. at this stage, separating the bits you want may be an advanced topic (depends on the lib's layout/depends as well). you should prefer to reference and link because it will normally minimize your maintenance time, especially if you use it in multiple projects.
I tried copying the existing "Hello World" xcode project file across into my project, however this didn't seem to work
you don't create a project, you add the library's xcode project to your app or library, set the lib as a dependency, add the library to your search paths if needed, then link with the library.
Do I need to create a new "Target" based on "coco touch static library" option?
no
Then would I need to Edit the current Product Scheme so that when I build the new target would build
no. you configure it as a dependency. you may need to alter the lib's build settings if there is a major conflict, which the linker or compiler would point out.
What do I need to do on my project side exactly - should going Add Files, and choosing the extensions Xcode Project File be enough?
start with the process outlined above.
There is no reason to bring in an actually project. Either you can bring in the source files themselves and you could even use the same exact files instead of copying them if you want. However, if you have more than just a few files, and you don't think you will be changing the code much, then creating a static library would probably be the best option.
I'm currently stuck trying to get my objective c generated files to compile in my iPhone project. Basically it keeps telling me there is no such directory for the following four imports:
Thrift/TProtocol.h
Thrift/TApplicationException.h
Thrift/TProtocolUtil.h
Thrift/TProcessor.h
I'm following all the instructions on the Thrift wiki and have downloaded and compiled the Thrift framework in XCode but there is no information specific to iPhone development. I'm almost certain it's a problem specific to an iPhone project because if I create a new command line project in XCode, I can import those files just fine.
After retaining the services of some kind of sorcerer I have figured out how to get Thrift to work with the iPhone/iPad (or at least get it to compile okay).
First, you want to grab the objective-c files with this command instead of from the wiki:
svn co http://svn.apache.org/repos/asf/incubator/thrift/trunk/lib/cocoa/src/ thrift-cocoa
Then, make a new Xcode project by going to New Project, selecting Framework & Library and Cocoa Framework. Click create and save it somewhere nice. Right click on Targets and select Add -> New Target. Choose Cocoa Touch and then Static Library. Give it a nice name. Go to the target's Build tab in info and change the Base SDK to iPhone Device (I'm using 3.2 but you can use whatever) and change Architectures to either Standard (armv6 armv7) or Optimized (armv7). Under the General tab add the Foundation and Cocoa frameworks.
Drag all of the files and folders you got from the svn repository into the Classes folder in the project. Check the copy items box and check the boxes next to both targets. Remove TSocketServer.h and .m from the Static Library's Copy Headers and Compile Sources folders respectively. You can now build the Static Library (and Framework optionally).
Open the project you want to use Thrift in and go to your target's General tab in info. Add the Static Library you just created to the Linked Libraries list. It should be named libYOUR_TARGET_NAME.a. Under the build tab go to Header Search Paths and add the path to the Thrift project you just created and check the recursive box.
Finally you just need to change the import statements in the Thrift generated code by simply removing the brackets and replacing them with quotes. You can now build you iPhone project again.
Try adding those .h files to your Xcode project.
I just started programming in Xcode and I'm trying to write an iphone application. I started out with a simple template for Iphone development and took it from there. Now I would like to build a command line tool (for converting data) which reuses some of the classes in my iphone project. I managed to add a new target 'convert', link the appropriate source code to the target, make the target dependent on the main target. Everything builds, so far so good, but it does not generate the right executable, it will build only build/Debug-iphonesimulator/convert which is not runnable from the command line (I'm guessing because it is not linked with the right libraries).
~/Documents/XCode/SQLiteTutorial> ./build/Debug-iphonesimulator/convert
dyld: Symbol not found: _OBJC_CLASS_$_NSCharacterSet
Referenced from: /Users/marc/Documents/XCode/SQLiteTutorial/./build/Debug-iphonesimulator/convert
Expected in: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
in /Users/marc/Documents/XCode/SQLiteTutorial/./build/Debug-iphonesimulator/convert
Trace/BPT trap
Is this possible with xcode at all? I'm not sure what kind of extra information you would need to answer this question, so let me know what to provide, if anything.
Kind regards,
Marc van Kempen.
What if you simply created a different project entirely and then dragged in the relevant classes you wanted to reuse, but instead of copying them, merely used references to them? Just don't select 'copy items into destination's folder' option when you drag the class files into your groups & files pane. That way your CL project always uses the latest version from the main iPhone one.
Having it all in one project would no doubt be cleaner though.
iPhone SDK does not officially support building command-line tools. iPhone does not run command-line tools; at least, not without jailbreaking.