Category: Uncategorized
-
Adding a fixed image background to UIWebView
A short post for iOS people. UIWebView doesn’t (as of iOS 5.0) honor background-attachment: fixed; in CSS, so if you need a fixed background image on a UIWebView, you’re probably searching Google trying to find the answer. Hopefully, this will help. UIWebView *someWebView; someWebView.opaque = NO; someWebView.backgroundColor = [UIColor clearColor]; UIImageView *imageView; imageView.image = [UIImage…
-
@synchronized vs dispatch_once
In the comments on a recent Stack Overflow question, someone asked me if there was a significant performance difference between @synchronized and dispatch_once in implementing a singleton. So I wrote a simple test harness to access a singleton using the @synchronized method shown here: @synchronized(self) { if (!synchronizedVar) { synchronizedVar = [[Test alloc] init]; }}return…
-
Tri-Pic is in the App Store!
Tri-Pic is finally in the App Store! I’ve been working on this as a side project for a few months, and finally got around to finishing it up. It’s a fun little app to mix faces and share them via email, Twitter, Facebook, and other services. And it’s available now in the App Store, free.…
-
Subclassing NSInputStream
Cocoa’s NSInputStream is great, but sometimes it doesn’t have all the functionality you need. For example, you might want to dynamically encrypt the file as you were streaming it off the disk, or you might want to put up a progress bar indicating how far the input stream had progressed through a large file. NSInputStream…
-
Creating a Finder alias programmatically on Snow Leopard
My co-worker Dan posted a blog yesterday entitled “How to Create an Alias Programmatically“. His example is 21 lines long, and is compatible with Leopard and earlier. It only works if the original item is a folder (though creating an alias to a file is not much different). The code messes with resource forks, and…
-
100 Hour Board iPhone app v1.2 released
As of this previous Sunday, 100 Hour Board for iPhone was updated to version 1.2. This update includes support for iPhone OS 3.0, improves the rendering of quotes in Board posts, and teaches the app to remember where you were when you last closed it. There are also a couple minor user interface tweaks; notably,…
-
Singleton Pattern in Cocoa
Peter Hosey recently tweeted: From the “how NOT to implement a Cocoa singleton” dept: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32 followed by: If something over-releases an object, the bug is not in that object, and overriding methods in it to break retain/release is not fixing it. The code sample in question is in the Apple documentation, and prescribes overriding the…
-
100 Hour Board released… a week ago
On March 19, my 100 Hour Board app was officially available in the App Store. There were nearly 100 downloads in the first two days, and that was before I’d even started doing any advertising. Anyway, if you haven’t downloaded it yet, it’s available in the App Store here. (Link opens in iTunes.) I’ve got…
-
100 Hour Board iPhone app coming soon
I’m a big fan of BYU’s 100 Hour Board, an online Q&A forum that provides answers to nearly any question imaginable within 100 hours. I’ve been working with their webmasters over the last few weeks to get a web API to their content, and today I’m uploading an app that provides an iPhone-optimized interface to…
-
Surakarta is now available
Surakarta for the iPhone/iPod Touch is now available for download. (Link opens in iTunes.) I haven’t yet been able to find it directly by searching, but hopefully the App Store index will update shortly. I’m currently working on version 1.1, where I’ll add single-player support. In the meantime, download Surakarta and write a review! UPDATE…