Copyright 2004 by M. Uli Kusterer Fri, 29 Nov -1901 11:06:32 GMT Comments on article blog-uk-helper-macros at Zathras.de http://www.zathras.de/angelweb/blog-uk-helper-macros.htm blog-uk-helper-macros Comments witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) en-us Comment 2 by Uli Kusterer http://www.zathras.de/angelweb/blog-uk-helper-macros.htm#comment2 http://www.zathras.de/angelweb/blog-uk-helper-macros.htm#comment2 Uli Kusterer writes:
@Harvey: Yes, if you can be Leopard-only, then you can use properties. But most people will probably want to be compatible with 10.4, and this is a way to alleviate the pain of knowing one could be using properties.

Regarding destroying a pool: You don't need autorelease pools in a GC world. Why would you call drain? I'd just define out the create autorelease pool call.

Regarding your log method: That's effectively the same as mine. Just that mine includes the format in the va_list, and yours has it separately, and hence has to remove the comma using ## if there are no variadic arguments. Though your version is ANSI standard, I think, while my args... is a GCC extension.
Comment 1 by Harvey Swik http://www.zathras.de/angelweb/blog-uk-helper-macros.htm#comment1 http://www.zathras.de/angelweb/blog-uk-helper-macros.htm#comment1 ASSIGN/DESTROY

I can see using something like this for Tiger, but for Leopard why not use properties?

DESTROY(someAutoreleasePool)

In the case of NSAutoreleasePool, you probably want [somePool drain] instead of [somePool release] for forward compatibility with GC. Works on Tiger too.

UKLog

I use something similar to this:
#define UKLog(format, ...) NSLog( @"%s: %@", __PRETTY_FUNCTION__, [NSString stringWithFormat: format, ## __VA_ARGS__])

It's been a while since I touched that so I'm not sure if there's any practical difference between the macros.