One Quickie


printf'ing / NSLogging strings without a terminating zero byte (General->Random)
  printf ("hello %.*s\n", 5, "there is no good going on");
  NSLog (@"hello %.*s\n", 5, "there is no good going on");
results in
hello there
2007-05-04 09:14:15.575 printf[4914] hello there

Similarly, something like printf ("hello %*.*s\n", 10, 5, "florgsnorgle"); will right-justify 'florg' in a field of 10 characters.

(Thanks to TVL for this goodie)



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com