Saturday, October 19, 2013

Autoformatting in Xcode

Xcode is not as helpful as Visual Studio when it comes to formatting code. Moreover, if your developers don't follow code standards as much as you'd like, you'll end up with ugly code. Probably the best option is to use Xcode formatter (https://github.com/octo-online/Xcode-formatter), which uses uncrustify to achieve the formatting. You can even edit the rules to follow your own code standards. I found it very helpful, since you can run it after each build.




Monday, October 7, 2013

Auto Layout on iOS Versions prior to 6.0 error

It happened to me after updating to Xcode 5. There are possible solutions to this error. In my case first I tried disabling the auto layout checkbox in the xib's that were causing this error. But this didn't seem like a clean solution. I googled a little more and found that the deployment target was set to 4.3, when it should be set to 6.0 since I'm using auto layouts.

It seems like Xcode 4 should also throw this error, but it didn't. So this error isn't related to Xcode 5, it's just that Xcode 5 does tell you about it.