Categories
General

SBJSON: Testing for nil / NULL value

I am playing with a variety of JSON frameworks in Objective-C. All are severely under-documented but then, they are simple to use, right? No. Nonetheless, I am deeply in awe and in debt to the great individuals who invested endless hours of their time to build these libraries and give them to us to use free of charge. Thanks you.

Anyway, SBJSON from Stig Brautaset, which I am examining right now, exposed a relatively weird issue. How do you test for null values in the contents of the parsed NSDictionary at hand? 

Plain old ([dictionary valueForKey:@"key"] == null) will not work. The breakthrough came when looking at the dictionary printout to gdb (Right-click the object in memory and select 'Print Description to Console'). The null value was 'stored' in a CFNull reference. To test whether a pointer is pointing at CFNull, you do this:

myVariable == kCFNull where kCFNull is a special memory address dedicated to hold this special null (nil!) value. 

Share
Categories
General

Snowmass

Share
Categories
General Shopping

Why you should avoid Grohe bathroom fixture products

6 months ago, my wife and I were fortunate enough to be able to renovate our two bathrooms. The kids got a beautiful and simple bath arrangement while our master bathroom's shower was outfitted with several fixtures made by German bath fixture manufacturer Grohe. Grohe's brand name and positioning places it where you would find BMW in the car world totem pole. Expensive, great design and supposed bullet-proof reliability. Just to be sure, we purchased the fixtures from an authorized Grohe dealer in Waltham, MA, Peabody Plumbing Supply.

So it was truly disappointing that 10 days ago I stepped into our beautiful shower only to find out that the diverter valve, the part that switches between the overhead shower and the handheld unit, failed. Water was flowing from both showers, neither at a satisfactory flow. My wife called Grohe that morning to request a replacement part. The Grohe representative felt the problem sounded like a failed pin that is the main component in the diverter. He assured her the part will be sent immediately and we will have it within two days time. Just what I would expect from a reputable company.

10 days later and the part never arrived.

We reached out to Grohe 5 days ago to get an update on the part. No one was able to give us the information as the person my wife spoke with, Rick, was not around. My wife left him a message and also followed up with an email. No response and no part arrived to this day. This is now becoming very disappointing: my shower is disabled and the brand I put my faith in, appears to not care.

Where consumers finally enjoy some relief is in access to social media and I intend and already started spreading the word about my situation and how others should react. This is also why I am writing this post – you, strangers and friends, will hopefully now know that Grohe provides really crummy service experience (maybe they should read Putting the Service-Profit Chain to Work to understand why this is a big deal). Grohe appears to be on Twitter, but instead of listening for real, it appears to be a social media PR campaign (it's viral, according to their website) to share the joys of showering. Well, I cannot shower, can I?

My wife will now call them a fourth time tomorrow. We'll see how that goes.In the meantime I reached out to the campaign's Twitter account for help and to vent.

Share
Share