By Developers, For Developers

Historical errata for Beginning Mac Programming

PDF PgPaper PgTypeDescriptionFixed onComments
24ERROR

Launching IB on my system, Tools->Library, does not show the as shown in Fig 2.6 “Interface Builder Library Palette” You don’t tell us how to get the IB to show the icon view. In my case for IB, all I see is a folder hierarchy

2009-09-18The default preferences in Interface Builder seem to have changed from Xcode 3.0/3.1 to 3.2; the image in Fig 2.6 has been replaced for the next Beta.
45TYPO

Creating an Instance of our Notifying Class, 2nd para:
“Give our knowledge so far” should be “Given our knowledge so far”

2009-09-18
41ERROR

Figure 3.3 shows the project window under Mac OS X “Leopard” and Xcode 3.1; if you create this project under Snow Leopard and Xcode 3.2, you will also see TextAppAppDelegate.h and .m files in the Classes group. This has been fixed for the next Beta.

2009-09-18
22OK

Figure 2.4 has seven icons. When I follow your instructions, I get six. The one that is missing is “Text App App…” (Using Xcode 3.1.3).

2009-11-11This is one of the differences between Xcode 3.1 and 3.2. The Xcode 3.2 Cocoa Application project template will include TextAppAppDelegate files, with an instance added in the MainMenu.xib file (hence the extra icon). \n \nThe template under Xcode 3.1 doesn't include it, which is why you're not seeing it in your xib. It's not a problem--the book doesn't make use of the TextAppAppDelegate, at least for the chapters in the Beta so far, precisely for this reason.
35TYPO

Final sentence on the page reads “We can now redefine our House class as simply being a subclass of the Building class; put another way, it inherits from the House class:”. Should be “We can now redefine our House class as simply being a subclass of the Building class; put another way, it inherits from the Building class:”.

2009-09-20
130TYPO

“Initializing Strings”
First sentence states “…we find are various routes”

Should this be “…we find there are various routes”

2009-09-23
anySUGGEST

Maybe this is somewhere in the book which I have yet to read, but a chart showing the various %i, %f, etc for NSString initWithFormat would be very helpful. You are doing a great job of explaining them as we go along, but a full chart showing them all with a short (3-4 word) description on each would be great.

2009-11-11Absolutely, thanks for the suggestion. This is something I had wondered about putting in an '(Objective-)C Language Summary' appendix, rather than in the main text of a chapter, so it probably won't appear in a Beta for a while.
148TYPO

Last paragraph of the page " I still have the odd con- fusion when I use an elevator over in the U.s. In the U.K., "

U.S. should be capitalized.

2009-09-21
69TYPO

showSomeText: should be displaySomeText: near the top of the page. First new paragraph of the page on the third line.

2009-09-23
176,177OK

error:(NSError )outError

too many *

2009-09-21This isn't a typo. It represents a "pointer to a pointer", and is used to "pass a value by reference." By passing a "pointer to a pointer to an array object" to a method, the method is able to change that object, meaning you can effectively "return" more than one piece of information at the end of the method. \n \nSee Section 6.4 "Passing Values by Reference"---just that when you pass values by reference for pointers to objects, you work with pointers to pointers, hence the **
179OK

Second paragraph (beginning with “NSDocument responds”) does not word wrap properly on the code sample

2009-09-21Issues like this will be fixed when the book copy is finalized and goes into print production; there might be a few of these, along with little black blocks at the ends of lines that are too long to fit on a page. See the Beta disclaimer page at the beginning of the book for other issues that often appear before the book is finished.
215TYPO

Hopefully you’ve recovered from looking at so many logical expressions and operators, such as ==, && and ||

Bold on the pipes.

2009-11-11This is a technical issue in the book build process and is being looked into.
235TYPO

last sentence “display information on screen, and controllers that liase between model objects and views.”

Did you mean liaise?

2009-09-23
19ERROR

in line 6, the reference to “Build & Go” should read “Builid & Run”, as this is the name of the tool in XCode for Snow Leopard.

2009-09-23
22ERROR

In Snow Leopard, the “Build & Go” button is actually called “Build & Run”.

2009-09-23
25TYPO

The “Build & Go” button is called “Build & Run” in Snow Leopard.

2009-09-23
90OK

Missing the end of a sentence:

“Guidelines for maximum and minimum values that you can use in a particular variable type can be found in .”

I’m guessing a header file is what is meant?

2009-11-11This information will likely be included in an appendix of useful information which hasn't been written yet; this sentence will be updated when the appendix makes it into the Beta.
56TYPO

11th line reads: “Make your NotifyingObject.h file look like this:” but I believe it should be “Make your NotifyingClass.h file look like this:” (NotifyingClass.h not NotifyingObject.h).

2009-09-26
171TYPO

“Go back to the MainMenu.xib file in Interface Builder and use the object list view”

This should be MyDocument.xib

2009-10-01
269TYPO

End of third line from bottom:
Don’t despair—we’ll see how to implement these methods in thechapter

end must be “…the chapter..”

2009-10-08
266TYPO

Last paragraph “..as we’ll see inthe chapter on Mac OS X…”

Space between in and the

2009-10-08
69ERROR

You appear to have mixed up the slash characters when describing the notation for a newline, ‘\
’. A forward slash is ‘/’ and a backslash is ‘\\’.

2009-10-02
92OK

Should the format specifier for an integer value not be %i in the following code…

[textView insertText:[NSString stringWithFormat:@“value of pointerToAnInt is: %p\
”,
pointerToAnInt]];

2009-10-08No... %p is used to output a pointer value, %i is used to output an integer value. \n \npointerToAnInt is a variable that holds a pointer, rather than a variable that holds an integer. The *value* of the pointerToAnInt variable is a pointer.
59TYPO

Communication Between Xcode and Interface Builder
Remember how we created an object instance in Interface Builder (that
blue cube thing) in the last chapter, and set its class to “NotifyingObject” or “NotifyingClass” ?

2009-10-08
64SUGGEST

Change “window, you’ll see a message appear each time in the ‘debugger’ console
window.” to "window, you’ll see a message appear each time in the ‘XCode - Run - Console’
window.
I spent some time trying XCode’s Debugger, MiniDebugger and Debugger Display.

2009-10-08
66SUGGEST

Change “Interface Builder to edit the MainMenu.xib file.” to “Interface Builder to alter the MainMenu.xib window”

I currently unable to connect the “outlets” group to “Text View”, but will get back to you why, when I find out!

2009-10-08
66SUGGEST

Am able to connect “outlets” group to “Text View”, I think my problem was text I had saved in the “Text View” similar to “Lorum Ipsum” ? I don’t really know, I just deleted the project and started again.

2009-10-08
126SUGGEST

On trying to Build and Run at this stage, a warning is issued against the newly introduced ‘dealloc’ method of the WonderfulNumber class, viz “Method possibly missing a [super dealloc] call”. This may be intentional at this point but should be explained.

2009-10-08It looks like you might not have included the [super dealloc] call specified in the code in the book?
259TYPO

“We’ll look at the exact syntax for this ina future chapter; for now, it’s a variant of something like this:
NSString *myKeyName = @”myKeyName“;”

There’s ‘ina’ there, which of course is meant to be ‘in a’. This is near the bottom of the page.

2009-10-08
150ERROR

The line…

[textView insertText:stringToOutput];

prior to the declaration…

int indexOfObject = [shoppingListArray indexOfObject:secondObject];

is missing and hence the outcome will not be as shown.

2009-10-08
269ERROR

“For an NSArray to be able to archive its contents, it requires that every object within the array conform to something called the NSCoding protocol.” The text in B3.0 is misleading, implying that the writeToFile:… method requires stored objects to implement the NSCoding protocol. In fact, the writeToFile:… method requires that every object in the array be an NSString, NSData, NSArray, or NSDictionary—it has nothing to do with NSCoding. In order to write the array of shopping list items to disc, we will have to use a different technique (which does have everything to do with NSCoding).

2009-11-11
173SUGGEST

Immediately prior to the “Adding New Items” heading, the application will not work as described at this stage because there has been no mention that the Add push button has to be linked to the File’s Owner and the addNewItemToShoppingList method.

2009-11-11
174TYPO

Please amend my submitted erratum for page 173 to be for page 174 and substitute the context to be immediately before “Editing the Items”. The rest of the entry is correct.

2009-11-11You connected this up earlier in the book, on page 167.
179SUGGEST

Formatting of the paragraph (below) needs adjustment because the tableView part flows off the page instead of either wrapping or starting on a new line.

NSDocument responds to the updateChangeCount: message—you would need to insert a call to this method, passing it a constant value of “NSChangeDone,” in both the addNewItemToShoppingList: and tableView:setObjectValue:forTableColum to solve this problem.

2009-11-11Formatting issues like this will continue to appear in the Beta pdfs; these issues can only be sorted out when the content is fixed and the book goes into final layout stages.
69TYPO

Hi, I don’t think this line is correct:

Notice also that we’ve added the characters “\
” (that’s a forward-slash, not the more frequently used back-slash) on the end of the string.

2009-11-11
209210ERROR

- (IBAction)removeItemFromShoppingList(id)sender

should be

- (IBAction)removeItemFromShoppingList:(id)sender

2009-11-11
238TYPO

we must to decide how best to

too much tos

2009-11-11
212ERROR

- (IBAction)removeItemFromShoppingList(id)sender

seems to be a copy and paste error. have a look on all occurences of removeItemFromShoppingList

2009-11-11
278SUGGEST

While working with “Programming cocoa with ruby” it was all about the event-system of an os-x application. Will this be a part of the not yet written chapters?
I would also like to see some Infromation along the way how one can use XCode features like refactoring and stuff like that.
And at least a little example of how to write a test is a must for any pragmatic reader!

2009-11-11Yes, events and the responder chain will be addressed in the remaining chapters. Information on Xcode features and tests may make an appearance provided the book isn't already too long.
260TYPO

There is the same ‘ina’ on the next page with duplicate text from above.

2009-11-11
274TYPO

inthe should be in the

2009-11-11
261SUGGEST

if( self = [super init] )

this idiom should be explained.

as well as the really important retain in itemName = [newName retain];

you might show what happens if retain is missing, so one sees the memory in the table cell

2009-11-11if( self = [super init] ) is explained on page 207 of Beta 3.0, but good idea on showing what happens if retain is missing.
140OK

When running the wonderfulNumberWithFloat method, the console outputs the following error: “+[WonderfulNumber wonderfulNumberWithFloat:]: unrecognized selector sent to class 0x40c0”

The code looks like it should be correct, but apparently not.

2009-11-11Have you definitely implemented the wonderfulNumberWithFloat: method as a class method with the "+" on the front rather than a "-"?
140SUGGEST

Perhaps my previous erratum wasn’t correct. I still had [myWonderfulNumber release]; from a prior example immediately after the previously mentioned code. Removing it seemed to fix my problem. Maybe there should be an explanation as to why that shouldn’t be there. (Is it because we aren’t specifically calling [WonderfulNumber alloc] from within displaySomeText, as on page 136?)

2009-11-11There shouldn't be any correlation between removing the call to release and the previous error; but yes, since you don't call alloc in the displaySomeText: method, you shouldn't call release.
72SUGGEST

5.1 How Memory Works
Your computer contains various different physical storage places for
information.

It seems to me that “various different” repeats repetitiously :)

2009-11-11
133OK

When I implemented initWithFormat and use the @“%f”, there is no line break? Maybe I missed it, but it looks to just print the number (pi) multiple times on the same line in the text window? Not a big deal, but I was looking at the output of multiple clicks to see the alloc/dealloc, etc.

2009-11-11Yes, you need to use "\\n" to insert a newline; the @"%f" is just a string containing a float, and nothing else. Outputting multiple @"%f" strings will show them all on the same line without line breaks.
233TYPO

newItemTextField s/b newItemNameTextField 3x

2009-11-11
233TYPO

so let’s use the same technique here and
change the method to this:
- (IBAction)addNewItem:(id)sender

* s/b
so let’s use the same technique here and
change the method to this:
- (IBAction)addNewItemToShoppingList:(id)sender

2009-11-11
11SUGGEST

After reading the first chapters of “Cocoa Programming for Mac OS X”, I think that this book covers legacy technology. All the information about memory, allocating and pointers is nothing that a newbee is interested in. Especially if there is such a thing like a garbege collector…

2009-11-11Memory management is best explained when a reader is still a beginner, and manual management remains essential knowledge for Mac development until the majority of the sample code and demonstrations out there use Garbage Collection. GC will obviously be addressed in the remaining chapters, but for readers wanting to move to iPhone development, there is no Garbage Collector on the iPhone so manual memory management is the only way to go. Pointers will continue to remain essential as far as objects go unless the language changes significantly.
48ERROR

NotifyingClass does not exist in the newest version of Interface Builder (Version 3.2.1 (740)) and it will not let you change the ObjectID to 541 shown on the following page.

In addition the library pane in 3.5 does not look at all like the current version

2009-11-12You don't need to change the ObjectID, just the class to NotifyingClass. Please can you confirm what you mean by "NotifyingClass does not exist..."? Your library pane may look slightly different; if you trash the preferences for Interface Builder, though, it should look like 3.5, but this isn't necessary as long as you can find NSObject etc.
19TYPO

“that each of those lines starts with two backslash charac- ters, like this:
// TextApp”

should be:
“that each of those lines starts with two slash charac- ters, like this:
// TextApp”

Backslashes go like this: \\\\

Hope this helps. Lovin the book so far,
…/j

2009-11-21Thanks, changed to "forward slash characters" for the next Beta.
298TYPO

Working with Colors… 2nd paragraph reads:
“… working with an earger” Should be “eager”

2009-11-24
295TYPO

“If you try changing the content view outlet” -> mainView outlet.

2009-11-24
91ERROR

“Guidelines for maximum and minimum values that you can use in a particular variable type can be found in .”

Found in…?

2009-12-09
60TYPO

‘After the colon comes something in brackets with an asterisk “(HouseObject *)”’

Brackets or parentheses?

2009-12-09
62OK

Figure 4.2 displays the button before it is created (in the paragraph immediately following)

2009-12-09
66OK

I think it might be better to save the actual explanation of pointers for a later point in the book.

2009-12-09
68OK

Suggest tight pairing of the figures on pages 68-69. Specifically, if the connection drag isn’t done to the TOPMOST area of the Text View it won’t have an effect; this would be more obvious to me if the graphic were right there.

2009-12-09Figure positions will be fixed once the text is finalized, just before going to print.
70ERROR

‘Notice that there are no normal brackets “(” or “)” in use here’

Another brackets versus parentheses situation.

2009-12-09
22,23OK

In section 1.3 you indicate you are running version 3.2 of XCode and then in pages 22 and 23 you indicate that in earlier versions of XCode there are problems with pList and other naming. I am running version 3.2.1 and I see the same issues, so either the footnotes are wrong and it’s not just earlier or you are running a new version then 3.2

2009-12-09Please see forum comments for information about removing old template files etc.
83TYPO

In footnote no.2: “…it’s the incredibly long value
11111111111111111111111111001110. Next, try converting the number 50 into binary; it’s the
more manageable 110010. That really long number has those six bits on the end…” This long number end is not the same as 110010, it is 001110, or i am missing the point?

2009-12-09
19TYPO

co-ordinates

shouldn’t this just be coordinates?

2009-12-09
25SUGGEST

From the Tools menu, open up the Library panel. This panel, …

Then, 1st line next paragraph —> the Library panel is referred to as the library palette

2009-12-09
25SUGGEST

Drag out a text view object from the Library palette (as in my last post, Library palette vs Library panel)

2009-12-09
25OK

“Drag out a text view object from the Library palette” … This is the first time an “object” has been referenced as something that a new programmer has to manipulate. It might not be clear what a text view object is (the first time). Maybe … click on the object “Text View” in the Library panel and drag it on to the TextApp Window and let go. This adds a Text View object into our TextApp application’s window. We can use this Text View … or something

2009-12-09
29OK

Once the basic layout of the application is agreed,

Once the basic layout of the application is agreed upon, … or
Once the basic layout of the application is acceptable,

2009-12-09
54OK

From Chapter 2: “Even when you’re eventually allowed to do something at your computer, it’s writing code for little command-line tools that output text to a “no user interface” console screen. This book is different."

Yet this is exactly what has been done by the end of Chapter 3.

2009-12-09
135SUGGEST

NSString *numberString …

We don’t explicitly set up this string with alloc and init like we did with *stringToReturn (above). Is the memory used by *numberString automatically alloced and inited? Is the memory also automatically dealloced?

2009-12-11The storedNumberAsString method returns an autoreleased object, which will automatically be deallocated as described in the preceding paragraphs. There's no alloc] init] for numberString in the displaySomeText: method, so there should be no corresponding release.
23ERROR

The sentence that reads, “Click once again on the Build and Go toolbar item to launch your application.”: Shouldn’t this be “Build and Run” instead?

2009-12-12
144OK

There are many different types of collections … arrays being one of them.

There are also dictionaries, sets … these are collections too.

2009-12-12
215OK

Switch over to Interface Builder and set the action for the New Item text field to be the addNewItemToShoppingList: method. You’ll need to right-click on the text field and set the selector to the File’s Owner object’s addNewItem- ToShoppingList: action method.

I do not understand these directions.

2009-12-13Text changed slightly for next Beta, but instructions use the same principle as has applied all the way through the book to this point.
224TYPO

This expression will be true only if firstValue is less thansecondValue.
s/b
This expression will be true only if firstValue is less than secondValue.

2009-12-13
228SUGGEST

for( currentIndex = 0; currentIndex < [monthsArray count]; currentIndex )

Is [monthsArray count] executed for each item in the array?

2009-12-13Yes, but it doesn't matter. If you really want to avoid the extra method call, just use a separate instance variable to cache the number before the for loop.
241SUGGEST

Using our multi-story building analogy … You bring this up but then don’t follow through with the analogy, using array constructs instead.

Using our shopping list model, shoppingListArray stores one string (the item’s name) for each position of the array. We have already written code to access, change and display these individual strings.

We need to store more than just the item’s name. Our immediate need is to add a quantity for each item in our list. In the future, we may need to add even more information like size, flavour, the last price we paid for the item, the store to buy it from, etc. It seems like we need an array to store all of this information about each shopping list item.

We can continue to use ShoppingListArray to store items in each position of the array, but instead of storing just the item’s name in a string at each position … we will store an array containing all of the data for each shopping list item. At first this “inner” array will contain a string for the item name in the first position and a number for the quantity in the second position. We can easily store more information for each item by adding them to the array.

We can move through our individual items in shoppingListArray like we have in the past but when we get to the item we need, we will now have to move through the second “inner” array to access the item’s name and quantity.

This means …

Awfully wordy but I hope the message is clear

2009-12-16Original text modified slightly for next Beta.
228SUGGEST

Thanks for the quick follow up. I think the repeating method call is significant, especially if you are dealing with a restricted platform or a very large array. I am just learning Objective-C and have no C background. This book is for newbies like me … I need to learn how to write good code, now is the time to start thinking about these things.

2009-12-16I would classify this type of optimization as "premature optimization". In a book such as this, the fewer lines of code, the better. Unless you specifically notice a performance hit, don't optimize unnecessarily.
199TYPO

“If you declare a pointer to an NSButton object” should be “If you declare a pointer to an object”, and “myButton” should be “someObject”

2009-12-15
344TYPO

Incorrect method name passed into the selector argument:

[center addObserver:self selector:@selector(needToShowMeasurements:)
name:WVMeasurerShowMeasurementsNotification object:nil];

“needToShowMeasurements:” should be “handleShowMeasurements:”

2009-12-16Thank you, this has been corrected for the next beta.
311TYPO

instead using custom code to draw the the list,

2009-12-21
326TYPO

You’ll need to synthesize the new property at the top of the interface declaration

should be implementation declaration

2009-12-21
334SUGGEST

For our simple Windows and Views application, this doesn’t matter.

To avoid the awkward visual of the shift in window size (from the IB window definition vs the constrained window), constrain the window like:

frameSize.width = (frameSize.height * w / h);

where w is the Content Frame Width and h is the Content Frame Height
of the “Window and Views” window that is shown in IB’s Window Size inspector panel.

This allows you to smoothly expand and shrink the window from its original size.

2009-12-21
342TYPO

NSNotificationCenter *center = [NSNotificationCenter defaultCenter];

The font should be in the style consistent with “text to be entered” not in the “blue” style used for text that already exists.

2009-12-21
352SUGGEST

but that’s OK, because it’s only for internal use.7

I’m not so sure if this is ok technique or not … but I sure would recommend documenting the fact that this method is constrained in this manner.

Is this an Objective-C “feature” or a hangover from it’s C ancestry?

2009-12-21This is both common and desirable; text changed slightly to explain why. See http://www.friday.com/bbum/2009/09/11/class-extensions-explained/ for advanced info.
354SUGGEST

Just declare the method in the header file and you don’t have to muck around with positioning the methods or worrying about what happens when you compile new code that uses this method six months from now.

Am I missing something?

2009-12-21
380TYPO

Other Cocoa Mechanisms, on the next pagebefore starting out.

page before

2010-01-24
382OK

There are various reasons why this is useful, not least because it enables us to use Key-Value Observing (KVO), where one object can register to observe the the value held at a specific key in another object.

One of the reasons why this is useful is that it enables Key Value Observing (KVO). KVO is where one object …

2010-01-24
382OK

You’ll remember that we had to write code in our Shopping List appli- cation to reload the relevant row in the table whenever a shopping list item was modified. There’s another Cocoa technology, Bindings, …

This functionality can be extended by incorporating Bindings, another Cocoa technology. Bindings makes it possible to automatically sync user interface values with application data in both directions.

Bindings, in conjunction with KVC & KVO, makes … all using IB.

If you review our Shopping List application, all the code relating to updating the views and instance variables (maybe show the code) could have been handled automatically, without code, using KVC, KVO and Bindings!!

2010-01-24
383TYPO

Under Mac OS X 10.6 Snow Leopard, we have access to Grand Central Despatch (GCD) …

Grand Central Dispatch

2010-01-24
388SUGGEST

Even though this book is titled Beginning Mac Programming, there’s so much overlap between what we’ve already learnt

I just learnt that learnt is the British equivalent of our learned.

2010-01-24
221TYPO

Month 2 is Feburary should read Month 2 is February

2010-01-24
234OK

[shoppingListTableView reloadData]; is missing at the end of the addNewItem- ToShoppingList: method

2010-01-24It's there, just not as the last line!
236ERROR

alert isn’t released in addNewItemToShoppingList: method

2010-01-24Great catch!
214SUGGEST

deleteItem: method doesn’t exist. It should be named removeItemFromShoppingList:

2010-01-24
284OK

I believe the sentence “Open the new project’s MainMenu.xib in Interface Builder.” should read “Open the new project’s MyDocument.xib in Interface Builder.”

2010-01-24No, the preceding paragraphs ask you to create a plain application project, not a Document-Based application, so you'll only have the MainMenu.xib file.
333ERROR

For some weird reason my Xcode (3.2 on OS X 10.6) won’t recognize NSWindowDelegate and build fails. This despite WVMeasurer.h including Cocoa/Cocoa.h, which in turns trickles down to AppKit/NSWindow.h, which does declare the delegate.

What gives?

2010-01-27
375ERROR

Possible tech issue with the opening of a saved shopping list using NSKeyedUnarchiver. Although saving does produce a proper binary prop file, reloading it yields an EXC_BAD_ACCESS every time (opening right after launch, opening with no existing window, opening right after save, whatever). I can vouch for my code being what’s in the book, too.

Xcode 3.2 on OSX 10.6.

Ping me if you need any further info! (the Prags have my e-mail).

2010-01-27
218ERROR

componentsJoinedByString should be componentsJoinedByString:

2010-01-25
61SUGGEST

This paragraph re Id (sender) is important but fuzzy; a reader could miss the importance:

Returning to Target-Action, we stated a little earlier that a method needs to accept a single argument to work for Target-Action. This argu- ment happens to be used to identify the object that sent the message in the first place. When we connect up a button in TextApp to target our NotifyingClass instance, the button would send the message, and specify that it was the sender. The signature therefore needs to look something like this:
- (void)displaySomeText:(id)sender;

I missed it completely and was baffled until I re-read the page a couple of times.

2010-01-27
228OK

Counters and Array Indices, 3rd paragraph.

And, because
the array index is zero-based, but the count method will return the…

Looks like but is a typo.

2010-02-02
31ERROR

“8. Draw three different-colored circles for Close, Minimize, and Max- imize.”

The green widget represents ‘Zoom’, not Maximize (as it is in Windows)

2010-02-02
84SUGGEST

It would be useful to get highlighted in red, in the code excerpt, the “%u” since it is changed form previous pages.
I just overlooked it since I didn’t read the paragraph after the example.

2010-02-02These are supposed to appear in bold but there's a typesetting issue preventing it at the moment. This will be fixed before the book goes to press.
24TYPO

MINOR: It’s “Build and Run,” not “Build and Go”

2010-02-02
70TYPO

“a number represented by the next 4 bits” should say “a number represented by the next 5 bits”.

This is in the paragraph at the bottom of the page.

2010-08-17
77ERROR

“Since in binary we can use only two possible digits (0 and 1), we are going to be working with column headers that are multiples (or powers) of 2.”
This is confusing, multiples and powers are not the same thing. e.g. 6 and 14 are both multiples of 2, but not powers of 2.

2010-08-17
1OK

Both versions of tibmac-code are empty. If no code samples are available, please indicate so on the download page. Thanks.

2010-03-15These should be ok now?
190TYPO

The highlighted code to replace reads
&& [textField intValue] 42 but the code which should be highlighted should be textField && [textField intValue] 42

Otherwise the code will read
generateTextButton && [textField intValue] == 42

2010-08-17
191TYPO

The line which reads
writing “2 + 4 * 5” would be interpreted as “2 + 20” rather than “8 * 5”
should read
writing “2 + 4 * 5” would be interpreted as “2 + 20” rather than “6 * 5”

2010-08-17
320ERROR

We’ll use Interface Builder again to set the delegate, so open the MyDoc- ument.xib file, and set the delegate for the table view to be the MyDocument object, just like you did the data source.


should be linked to File’s Owner, which is the case on p168 of the book for the data source.

2010-08-17
56SUGGEST

An error, really. If, by chance, you have closed the TextApp window after the last run before this section, there is nothing to explain how to reopen it at this point when you need it again. Either that or somewhere back in the last section in which there is a build and run to produce the window it should be made clear that you shouldn’t close it. Now must go back and undo changes.

2010-08-17
174ERROR

The following text: “You’ll also find that if you make changes to a saved document and select File > Revert to Saved, you’ll be asked whether you really want to lose your changes. If you click the Revert button, the application will load the preexisting data from the saved file.” is not true at the point where it is presented. That question is not asked unless you already coded the window to know whether it is dirty, as described in the following section.

2010-08-17
61SUGGEST

At first I couldn’t get the HUD to connect. It wasn’t until I managed to get it to the top of the NSTextView that it connected. SOme additional clarity on this point would have been helpful, because it appears that the whole NSScrollView is the object called TextView, but only the top of the ScrollView is actually active.

2010-08-17
210OK

Not an error per se, since both versions work, but a confusing inconsistency. On page 210 the version of addNewItemToShoppingList, now changed to clear the text field on enter only, there is no reference to an NSString object as there is in the initial addNewItemToShoppingList method on page 170. As I said both work but I’m not sure why there was a change although I can see how both work.

Hope I’m not just being too fussy.

2010-08-17This is just condensing two lines to one; but there is a typo in the second one - sorry.
210TYPO

Me again, sorry - this is an error. I hadn’t entered the code the way the book showed before. I had entered
[shoppingListArray addObject:[newItemNameTextField…] which did work. The code in the book is
[shoppingListArray addObject:[newItemTextField…] which brings up an undeclared error.

2010-08-17
177TYPO

in the pseudo code section on Page 183 it reads “…otherwise if they the Cancel button…”

Should read “…otherwise if they click the Cancel button…”

2010-08-17
197TYPO

In the paragraph that begins “Generally, you’ll see the relevant…” the last sentence “…, you can even place it all one the same line,…”

should read “…, you can even place it all on the same line,…”

2010-08-17
269ERROR

I am not certain if this is done intentionally, however here (as well as page 256 of the PDF version and other places) in the init method, the code

“self = [super init]
if (self) {…”

is used when previously, the convention/recommendation of the book (see the last paragraph of page 209 in the PDF version) has been

“if (self = [super init]) { …”

I’m curious as to why the switch. Was this just an oversight?

2010-08-17
316TYPO

Not a typo, just a function of the English language.

In the next to last paragraph on this page, “…to define a list of messages such a delegate object might implement.”

I read that paragraph at least a few times before I realized that the “such a delegate object” part was referencing the previous paragraph’s “It just so happens that we can provide NSTableView with a delegate object.”

2010-08-17Added "that" before "such"
136ERROR

There should be an explicit instruction to remove the [WonderfulNumber release]; at the end of the method.

2010-08-17
75TYPO

In explaining decimal notation the book claims that: “…if you multiply the header of a column by the header of the column on its right (for example, multiplying 100 by 10), you end up with the column on its left (1,000).”
This is only correct for the example you gave. 10 x 1 is not 100 and 1000 x 100 is not 10 000.

2010-08-17
61SUGGEST

In addition to #42802: I couldn’t get the HUD to connect either, and in my case, the view window was apparently placed to far upwards, so could not connect it. I had to reposition the window, and then I could link it.

2010-08-17
61SUGGEST

I couldn’t figure out how to get the HUD to connect to NSTextView until I found this page and read #42802 by Michael Wallis.

2010-08-17
402ERROR

In “The removal Instructions” para: add explanation that should be replaced by the location of the developer tools installation; usually /Developer

2010-08-17
98ERROR

We need a way to set the value of our circumference variable to the value held inside the text field.

should be:

We need a way to set the value of our radius variable to the value held inside the text field.

2010-08-17
95ERROR

Error was ‘circumference undeclared’ message when I did build and run.
To fix this, I went to the header file and put (float) line above (IBAction) line. Then it worked fine.

2010-08-27Sorry, don't understand... did you receive an error message relating to the [textView insertText:...] line, or something else? The order of method signatures in the header shouldn't have any effect.
98OK

Before “Switch back to XCode” you should mention to save what you did in IB.

2010-08-25At this point, I begin to phase out the reminders to save Interface Builder files. With any luck, the next version of the developer tools will bring back the old communication between IB and Xcode that knew to ask you to save unsaved xib files before Building a project, which would render these reminders unnecessary.
68ERROR

Last paragraph,
Last sentence,
Example is only valid if the base column header is 100.
JFB

2010-11-09This is fixed for Printing 2.0 onwards
333TYPO

Same problem, won’t compile.
Obviously a different version of Xcode is required to follow this book.
I wish the author would type the actual syntax instead of pointing me at the Xcode documentation. It’s hard to see the trees for the forest.

Please open a forum post if you are having problems getting something to compile; to the best of my knowledge, there shouldn't be any mistakes in the code from the latest PDF of the book. There also shouldn't be any places where you have to take code from the Xcode docs when it isn't included in the book. The pointers to the Xcode docs are to help the reader know where to look for solutions to future problems.
50TYPO

In the second paragraph from the bottom, the sentence begins ‘The <> in brackets before…’. Should it read the ‘The <> in parentheses before…’?

Yes; sorry, UK to US English translation failure!
171SUGGEST

Not an error, but I got hung up for several days on the tableView method (on page 171) that enables you to edit the array items directly on the table.

I assumed that the code snippet on page 171 was meant to replace the existing tableView method! After downloading the code from this site I saw that you can have an (id)tableView and a (void)tableView in the same implementation - maybe just add a line of text that clears that up?

Otherwise the book is extremely valuable, and the best intro I’ve found so far - really enjoying working through it.

1SUGGEST

This is the first Mac programming book which I have used and would benefit from a glossary, perhaps with examples.

367SUGGEST

Insert the words “Add this method below the existing initWithName:quantity: method” before “implement it like this” in the instructions prior to adding the initWithCoder: method.

160TYPO

End of second paragraph:

…and call the new project “Shopping List.”

—this should probably be “Shopping List”. (with the period outside the quotes, as the period isn’t actually part of the new project’s name)

397ERROR

The applicationDidFinishLaunching: method should be application:didFinishLaunchingWithOptions: (this changed from iPhone/iOS SDK at time of original writing)

138TYPO

The fisrt code block under “Rewrinting the init Method” had the following line:

`NSLog(@“Object was initialized!”);`

But regarding what it was done before, it should be:

`NSLog(@“A WonderfulNumber object was initialized!”);`

194TYPO

In the code block under :
> “With this in mind, let’s change the displaySomeText: method in TextApp to the following:”

In the first block of the if statement,
there is a problem of typo at the blue line
> `stringToOutput = @“Access Granted!”;`

Regarding what it was done before, either `Access Granted!` should be in the same red who underline the modifications, either it should be replaced by `You clicked the button!`.

197TYPO

In the first code block of the page, the code to be changed is not in red. So, unlike the others code block of the book, the part to be changed is not obviously pointed out.

78-79SUGGEST

In the section on floating-point numbers, the exercise has us set the value of the variable to “3.14159265”, but when the program is run, the value is presented in the text box as “3.141593”, rounding off the last few digits, and there is no explanation in the text for why this happens. So I don’t know if I’ve done something wrong, or if the text has just omitted that detail.

94TYPO

after the code sample, the paragraph ends with “the value output to the text view is now the value returned by the generateValue method (5.0).”

the actual value output by my program is (5.000000). minor issue, but it would be nice if the text matched up with the actual output so i can be sure i’ve not done something wrong.

170ERROR

After adding the code for addNewItemToShoppingList it asks you to Build & Run the code and you will be able to add new items to the shopping list. However there was no instruction to “remind” you to link the Button to the addNewItemToShoppingList event using the HUD. Only held me up for a couple of minutes but worth mentioning.
Version 2010-2-16

197TYPO

“In modern mathematics, writ- ing “2 + 4 * 5” would be interpreted as “2 + 20” rather than “8 * 5” because multiplication should be carried out before addition."
It should be “6 * 5” instead of “8 * 5”.

Categories: