I was using this in my iPhone app
if (title == nil) {
// do something
}
but it throws some exception, and the console shows that the ti
If you want to test against all nil/empty objects (like empty strings or empty arrays/sets) you can use the following:
static inline BOOL IsEmpty(id object) {
return object == nil
|| ([object respondsToSelector:@selector(length)]
&& [(NSData *) object length] == 0)
|| ([object respondsToSelector:@selector(count)]
&& [(NSArray *) object count] == 0);
}