2013-10-08

The UUID spec requires that hex strings be generated in lowercase, while tolerating uppercase for input.

6.5.4 Software generating the hexadecimal representation of a UUID shall not use upper case
letters.
NOTE – It is recommended that the hexadecimal representation used in
all human-readable formats be restricted to lower-case letters. Software
processing this representation is, however, required to accept both
upper and lower case letters as specified in 6.5.2.

Unfortunately, the 'uuidgen' command in Mac OS X is out of compliance with the spec, outputting uppercase. Example:

2013-08-23

Before iOS 6, iOS would take the liberty of deleting any view controller’s view not currently on screen upon a low memory situation. As of iOS 6, Apple decided it would remove the memory-intensive backing stores of the graphical display, and thereby free up some memory, without bothering the app developer. So from the app developer’s point of view, the view remains intact. In actuality, iOS recreates the graphical backing stores when the affected view re-appears. Now iOS 6 no longer invokes either method you may have implemented: viewWillUnload & viewDidUnload.

You can recreate the old behavior. As always, your view controller receives a message about low memory by having its didReceiveMemoryWarning method invoked. You may nil out the controller's view. Be sure to check first that the view is not currently on screen. As always, the didReceiveMemoryWarning invocation is an opportunity for you to clear unnecessary collections and to close other memory-intensive resources, all in an effort to free up memory.

When the view returns to the screen, you must of course recreate the view and restore the needed resources. Do so in your implementations of the loadView or viewDidLoad methods.

2013-08-20

I just spent a couple hours trying to explain and fix this error:<Error>: CGAffineTransformInvert: singular matrix.…reported in my app's log while I was testing my use of the WebKit widget (UIWebView class) to display HTML.

The "CG" means CoreGraphics, Apple's intense pixel-bending technology. One fellow on the internets says the issue is related to matrix math:

Blah, blah, blah… All I did was try to load a web page. I'm not doing any graphics work.

I tried all kind of folk remedies related to my use of the UIWebView widget, but nothing worked.

Long story, short…

For this testing, I had randomly picked "http://www.Yahoo.com/" out of thin air as an arbitrary page. This error occurred repeatedly on every run. Eventually I switched to Google.com, no problem. Reuters.com, no problem. SeattleTimes.com, no problem. Go back to Yahoo.com,problem. And problem happens repeatedly while scrolling.

I'm guessing that Yahoo is doing some kind of screwy HTML or JavaScript, probably manipulating images or the page itself graphically, and thereby invoking CoreGraphics and generating the error.

2013-08-15

I am so happy to finally find an extremely simple way to automate the simple chore of creating a compressed zip copy of my development project folder. I do this daily as a backup of my work.

I've yet to master source code control systems. Even if I did, those systems are just as good at destroying source code as they are at saving it. So even with BitBucket & Mercurial, for example, I would still want some simple zip copies of my entire project folder copied over to flash drives or other storage place.

The answer is Automator. This tool is bundled with every Mac. Built on top of AppleScript, Automator has pre-built tasks that you are likely to perform in the real world. One of those tasks is Create Archive. Bingo!

Using Automator is shockingly easy. Just drag-and-drop your desired tasks into a list. The tasks automatically chain together, the previous feeding into the next.

The main downside of Automator is also its virtue: Simplicity. While the various task panels offer a few options, they are indeed few. For example, I might want to use UTC time rather than local time when time-stamping each archive. No go. The workaround would be to write AppleScript code, and call that as a task.

Here is a screen shot of what you want to end up with if, like me, you want to create an archive of a folder, append current date and time to the .zip file, and store it in a "backups" folder.