More – Chapter 14

Dynamic Libraries and Frameworks introduces Framework, and important method in Mac OS X to provide a dynamic library and all its supporting resources in a single package. It covers the often-vexed question of how you can include a finished framework in an application.

PagePriorityDescription
205 Medium Missing instance variable in PointStat
213 Low Converting MyDocument to use the framework

Chapter 14, page 205

Missing instance variable in PointStat

The class declaration for PointStat begins on page 205. The listing misses an instance variable, sumXY. The listing should include:

    double          sumXSquared;
    double          sumYSquared;
    double          sumXY;

The sample code is correct.

Chapter 14, page 213

Converting MyDocument to use the framework

The conversion from a static regression library to a framework omitted a step in converting MyDocument, in MyDocument.m. The following changes should be made to the method definesLineOfSlope:intercept::

    if ([model canCompute]) {
#if 0
		[model computeFromLibrary];
#else
		[self compute: nil];
#endif

The sample code is correct.