Fritz Anderson's Weblog

Observations and Emendations

Title: Errata: Sample code chapter 12/2 and later
Category: /Step into Xcode
Posted by:

As I mentioned earlier, Xcode's gcc no longer supports embedded functions (functions defined inside other functions). The earlier note corrected the problem in the printed code in chapter 23. 
 
The sample code on the CD that accompanies Step into Xcode contains another instance of this error. The function in question begins at line 31 in PointStat.m beginning with Chapter_12/2 and all later versions. 
 
Replace that function with a C macro: 
 
#define DoesntImplement(aSelector) ((newDelegate != nil) && \ 
![newDelegate respondsToSelector: aSelector]) 
 
 
The sample-code disk image that accompanies this site reflects the change. 

Login Information
Username:
Password: