Mocking singletons with OCMock

Posted by on Feb 28, 2011 in code | 20 Comments

Although Graham Lee might not approve, I occasionally use the singleton pattern, particularly for managing access to my data models. Singletons in Cocoa are accessed using the following convention: static UserModelManager *sharedManager = nil; +(UserModelManager *)sharedManager {     if (sharedManager == nil) {         sharedManager = [[super allocWithZone:NULL] init];     […]

Declarative logging in Objective-C

Posted by on Jan 12, 2011 in code | One Comment

I’m currently working on a project with a requirement to log various events using Google Analytics. I created a UsageLogger service to encapsulate all the GA logic and make it easy to turn it off or replace it with another analytics solution. But I didn’t want to have logging methods sprinkled throughout the code, and […]

Using Objective-C blocks to log Core Data entities

Posted by on Nov 17, 2010 in code | No Comments

Usually when I want to log the Core Data entities returned by a query in a particular context, I just passed the object to a log statement, like so: 
NSLog(@"Query returned %@", theCoreDataObject); This works OK when you just have one object to log, but if you want to log the whole array of entities, […]

Coworking review roundup

Posted by on Nov 4, 2010 in working | No Comments

Well, I’ve hit all the downtown coworking spots I could find in SF and Berkeley (if you can recommend one I’ve missed, post a comment here or drop me an email at coworking [at] factotum [dot] me. There are at least a few more in the Mission and Potrero Hill, which I’ve ruled out as […]

Coworking review: Sandbox Suites

Posted by on Nov 4, 2010 in working | No Comments

My latest stop on the SF coworking tour was Sandbox Suites. They have 3 locations: SOMA, Union Square, and Berkeley. I checked out all 3 locations. Sandbox Suites is on the expensive side, but it’s also the best fit I’ve found so far. Having access to sites on both sides of the bridge is a […]

Coworking review: Nextspace

Posted by on Oct 30, 2010 in working | One Comment

Updated 11/3: there are now some fixed desks available, and I corrected the con about the conference room–you do get 4-8 hours a month free with a paid membership. After spending a few hours at The Hub, I headed over to check out Nextspace at 2nd and Market. Nextspace has the feel of a well-funded […]

Coworking review: The Hub SOMA

Posted by on Oct 30, 2010 in working | No Comments

After spending a few days at Citizen Space and Berkeley Coworking, I headed to The Hub SOMA. The Hub is an interesting setup–it’s a loosely affiliated network of coworking spaces around the world, and focuses on people working for social and environmental change. I’m not sure what the real benefit of the network is, as […]

Coworking review: Berkeley Coworking

Posted by on Oct 30, 2010 in working | One Comment

My second coworking experience was Berkeley Coworking, on Shattuck near Ashby BART in Berkeley. I was hoping to find an East Bay option where I could drop in once a week or so, as I expect to spend most of my time in San Francisco. Berkeley Coworking had a garage startup feel–pretty plain decor, even […]

Coworking review: Citizen Space

Posted by on Oct 19, 2010 in working | 2 Comments

Updated 10/30: I moved price from con to pro after checking out more spaces I’m making the rounds of the coworking spaces in San Francisco and the East Bay over the next couple of weeks to see if it’s a good option for me, and compare the options. My first stop was Citizen Space in […]

Clearing Quicksilver’s clipboard to free up RAM

Posted by on Oct 18, 2010 in code | No Comments

I’ve been using Quicksilver for so long it’s second-nature, and I hate being on a computer without it. One thing I use regularly is the clipboard history. The downside to this is that occasionally I copy something big into your clipboard, like a chunk of formatted text in Word or a range of cells in […]