BJ Homer

I work on Day One, a great journaling app. I mostly write about code, politics, and religion. I'm @bjhomer on Twitter.

  • Hiding the inputAccessoryView of a UIWebView

    UIWebView is a workhorse of a view. You can use it to display web pages, of course, but you can also use it to display locally-generated rich content. I was recently using UIWebView and the contentEditable attribute to implement a text field that allows inline images, etc. The fact that I’m using a web view,…

    bjhomer

    March 16, 2012
    Uncategorized
  • Detecting backspace in a UITextField

    I recently had need for a token field for iOS while implementing a “To:” field like the one in Mail.app. I ran into a problem, though. The token field consists of a label, some number of tokens, and a borderless UITextField at the end where the user can enter text for the next token. It looks…

    bjhomer

    November 17, 2011
    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…

    bjhomer

    October 14, 2011
    Uncategorized
  • @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…

    bjhomer

    September 29, 2011
    Uncategorized
  • 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.…

    bjhomer

    May 28, 2011
    Uncategorized
    Tri-Pic
  • 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…

    bjhomer

    April 15, 2011
    Uncategorized
  • 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…

    bjhomer

    August 28, 2009
    Uncategorized
  • 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,…

    bjhomer

    July 10, 2009
    Uncategorized
  • 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…

    bjhomer

    June 17, 2009
    Uncategorized
  • 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…

    bjhomer

    March 31, 2009
    Uncategorized
    TheBoard
Previous Page
1 2 3 4
Next Page

Blog at WordPress.com.

  • Subscribe Subscribed
    • BJ Homer
    • Already have a WordPress.com account? Log in now.
    • BJ Homer
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar