Another issue in this area is the naive empty string check 

 if (key == nil || [key length] == 0)

The canonical "is empty" check I use everywhere is


BOOL isEmptyString(NSString *string) {
	return (string == nil) || 
					([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:@""]);
}

Perhaps we should give this a BNRP prefix and apply it wherever needed - although I haven't checked to see if there are any other places that could use it.