XCode4 Build Rules for iOS

For a while now I have been manually compiling files since my asset conversion pipeline tool is not quite finished yet.

So I took at look into Build Rules in XCode. My main trouble within using them was finding the environment variables, even googling them doesn’t turn up much information.

I think the output files act as an error check, if the output file fails to appear then the tool failed.

One other thing I had an issue with was the source files list. I tried comma and semi colon delimiters, and spaces, but the TGA file kept giving the warning on Tree1.tga. I have yet t0 find the a way to do this without multiple entries. And I’m thinking a separate tool for building files may be easier.


Xcode4: Issue Navigator

Xcode 4.0.1 seems to partially fix the issue with the Issue Navigator not jumping to code in a header that has an error.

However only the header that is wrong shows up as not red and may have duplicate entries in the list, so keep scrolling to find it.

EDIT: Warnings do not seem to work still however when they are in headers.

Xcode4: Adding Local Git Repository to a Xcode3 project

Shooter 2 Secret Area

With the new version of xcode4 it comes with the option to version control source code locally.

However when opening old Xcode3 projects, it does not ask you if you want to add a local repository.

To add one is simple, open up Terminal and navigate to your xcode project folder.

Now enter the following without quotes:

“git init”

“git add .”

Depending on the size of your project folder, it may take a little time before it finishes. Once done, reboot xcode and your project should now be detected by xcode4 as under source control.

I had to recommit all my files before it showed up properly the organiser.

  • File Menu
  • Source Control > Commit…
  • Click Commit

Xcode4: Building without running and the Issue Navigator

In Xcode3 I liked how you could customise your icon toolbar, so I could build a project without running it. Although you can do live builds in Xcode4 sometimes its nice just to clean and rebuild when it doesn’t detect the change that breaks it.

You cannot add icons, so instead keyboard shortcuts are needed to build without running, hold shift while clicking Run, or alternatively press the combination of command + b.

Also in Xcode3, I liked how I could quickly moved back and forth between code and the build errors window

Something which by default doesn’t happen in Xcode4, being replaced with the Issue Navigator.

However it can be opened up in a tab.

  • Open up the Xcode menu, and select Preferences
  • Select Behaviours, and then select Build generates new issues.
  • Simply check the Show Tab option, and fill in a tab name, I called mine ‘Build Errors’.

Now when you build, if you have any build errors a new tab will open up showing the issue navigator.

I seem to be having trouble getting some header files to work in the issue navigator, there are a few posts about it on the developer forums, so I will have to submit a bug report.

There is a new Xcode4 update, 4.0.1 which requires yet another 4gb download.

Athena: Word Wrap

Athena: Word WrapOne thing I hate doing is writing classes that will output text, as well as handle special character sequences that get replaced by images. And while all this is happening, having it word wrap as well.

So I wrote a quick word wrap template class today that will do this. It doesn’t give line spacing yet, which I’m still unsure whether or not it should be this.

The way it works is when you create the word wrap object, you can pass to it’s constructor a value for the maximum width a line can be, this can be a floating point value, or an integer (it defaults to integer).

Then you call Parse() and give it a string, it will go through that string, checking the width of characters until the accumulated character widths are greater than the maximum width, or a new line is found. It will output this line of characters and move onto the next bit.

If it finds a word that is longer than maximum width, it will do one of two things. First if it is at the start of a newline, it will cut the word at the point it goes over. If it is already part way into a line, it will cause a new line and put the word on the next line.

I’ve included with this blog entry the header for the word wrap class, it comes as part of a test project in Xcode (it uses the Lorem Ipsum text), but the source and headers should work in another C++ IDE.

Athena Word Wrap Source (Version 1.0.0) (358 downloads)