301 HTTP Redirects and iOS Caching

I just learned the hard way that iOS permanently caches HTTP 301 (“Moved Permanently”) redirect responses from web servers. This makes sense, given that 301s are reserved for permanent redirections. As a result, I ended up permanently blocking access to my application’s web-based components for anyone who had my app open at the time of the change. The problem was that I was merely testing something, and blocking one entire subdomain was a bug in my configuration.

The good news is that the caching appears to be on a per-app basis, since Safari could access my website but my apps could not. The even better news is that you can easily program your way around this caching. If you’re using the new NSURLSession classes (and you are, right?), you can simply set the requestCachePolicy of your NSURLSessionConfiguration variable to NSURLRequestReloadIgnoringLocalCacheData.

NSURLSessionConfiguration *sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
sessionConfiguration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
NSURLSession *session = [NSURLSession sessionWithConfiguration:sessionConfiguration];

IronKey S200 OS X Mountain Lion Fix

(Updated 25 November 2016 with updated link.) If you have an older IronKey flash drive, you might be surprised to notice it won’t let you launch the decryption app under OS X 10.8 (“Mountain Lion”). If you have “basic” IronKey like me, you can’t upgrade the firmware either, so you’re out of luck if Imation ever fixes it have to wait for a “restore file” (via Imation’s comment, though their website currently disagrees).  Fortunately, you don’t have to give up your flash drive quite yet.  Follow these steps for a workaround.

Continue reading

Disappearing UILabel under iOS 4.3 (fine in iOS 5)

I noticed some UILabels in my iOS projects would disappear when run under iOS 4.3 after I upgraded to the Xcode 4.2 final revision with the GM iOS 5 SDK. I noticed that all the labels that were missing were in italics. Then I saw the reason out of the corner of my eye. Somehow in the Xcode 4.1 to 4.2 project conversion, the font properties on my labels were changed from System. Changing them back to “System” (or specifying the Helvetica family) fixes the invisible label.  Note that in this case, iOS 5.0 did add “Helvetica Light Oblique” as a font choice.

Disappearing UILabel

GPFRemoteAlert

A lot of people have been sending me e-mail about the solution to a problem that was not very well documented to DAS Calc.  Sending the same stock reply to these people helps them out, but that’s only for the people who have spent the time to send a support request.  The rest are probably frustrated that they can’t solve the problem and either don’t purchase or regret their purchase of the full version of the app.  If I could somehow notify the users of the solution as an alert in the app, everyone’s happy and I stop getting e-mails.  This isn’t a unique solution, but I’ve wrapped it up for you to use.  I call it Remote Alert, and you can find the code on GitHub.

Continue reading

Disable Twitterrific 4’s Blue Menubar Icon

Since Twitter doesn’t seem to appreciate third-party developers anymore, I’ve decided to switch from the official Twitter app to The Iconfactory’s Twitterrific.  I really like it, but I absolutely can’t stand how the menubar icon turns from black to blue with every new tweet.  I constantly see it change out of the corner of my eye and subconsciously move the mouse to click the icon.  I’m not a fan of this incessant interruption.  Here’s a hack to disable it.

Continue reading

Removing Elf Toolbar/Conduit for Mac from Safari

Well…it looks like the Mac is finally getting hit with malware!  I’ve had to remove the “Elf Toolbar” or “Translation Toolbar” aka “Conduit” from a number of Macs in the past few weeks.  Judging by the increasing number of recent forum posts on Apple’s Discussion Boards, it’s spreading fast.  Here’s what it is and more importantly how to remove it.

Continue reading