Posted By

tgunr on 03/21/07


Tagged

cocoa objc macdev


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

tcol
davidsi


DMCommonMacros


 / Published in: Objective C
 

URL: http://www.wilshipley.com/blog/2005/10/pimp-my-code-interlude-free-code.html

  1. DMCommonMacros.h
  2. static inline BOOL IsEmpty(id thing) {
  3. return thing == nil
  4. || ([thing respondsToSelector:@selector(length)]
  5. && [(NSData *)thing length] == 0)
  6. || ([thing respondsToSelector:@selector(count)]
  7. && [(NSArray *)thing count] == 0);
  8. }

Report this snippet  

You need to login to post a comment.