We Recommend

Programming in Objective-C Programming in Objective-C
Programming in Objective-C is a concise, carefully written tutorial on the basics of Objective-C and object-oriented programming. The book makes no assumption about prior experience with object-oriented programming languages or with the C language (upon which Objective-C is based). And because of this, both novice and experienced programmers alike can use this book to quickly and effectively learn the fundamentals of Objective-C.


Posted By

tgunr on 03/21/07


Tagged

cocoa objc macdev


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

tcol


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.