Archive for Jan 30, 2013

Wednesday, Jan 30, 2013 [Tweets] [Favorites]

Down With Magic Strings

Patrick Hughes shares a script for scanning the files in his app’s images folder and generating macros that load and verify the images. I agree with his goals, although I’ve solved this particular problem a bit differently. I redirect all image loading through a helper class (with a method per image), which also handles caching and can be unit-tested. I’ve found this level of indirection helpful, as some images need to be processed a bit or loaded in different ways on different OS versions.

Detecting Overflows, Undefined Behaviour and Other Nasties

Graham Lee:

Coming up in a future release of clang is a collection of sanitisers that insert runtime checks for the things described above. If you’re the kind of person who writes assertions like the above in your code, you can swap all that for sanitisers enabled in your debug builds. If you’re not the kind of person who writes those assertions, you probably should enable these sanitisers, then go and find out where else you should be adding assertions.

For example, -fsanitize=integer will print a runtime error if you add two integers and the result would overflow int.

Money Apps Removing Core Data iCloud Sync

Giedrius Jaloveckas:

After a rather frantic month of dealing with the unfortunate iCloud sync, we made an always-difficult decision: to do a U-turn. New versions of all three Money apps are currently waiting for Apple’s review, and they all contain the old sync via Wi-Fi. Some of you will be glad to go back to the old sync, and some will be inevitably disappointed, but we must admit that iCloud sync is just not reliable on Money. Let us explain you how we ended up with this undesirable result.