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. ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.