O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

New API Using Blocks

Several new C library calls have been introduced using blocks. They have _b appended to their names to indicate they are block calls, similar to the way some library functions have _r appended to indicate re-entrant calls. Some of the more useful ones are:

qsort_b()

quicksort using a block for a comparator

bsearch_b()

binary search using a block for a comparator

psort_b()

parallel sort using a block for a comparator

glob_b()

generate pathnames matching a pattern, using a block for an error callback

scandir_b()

collect pathnames, using blocks for a path selection and comparison

Cocoa has introduced a large number of block-oriented methods. An easy way to find them all is to search through the framework headers looking for the caret. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required