Text Not Clear


#1

At the bottom of page 180, you say to "Name the columns Make/Model, Price and Special. But, looking at the attributes inspector, there’s only a place to increment the column count. Typing in the names there doesn’t seem to be correct. I guess you just mean on the .xib file itself by double clicking into the columns? However, you’re referencing the attributes inspector so this is confusing.

The confusion continues in the next paragraph at the top of p.181. After following the instructions to this point and expanding the dock view, I don’t see a “Table Cell View” to delete per the instructions. OK, it does say it’s a child of Table Column, but the text “Table Cell View” is confusing.

I have this:

View
Table View
Table Column
Text Field Cell - Make/Model
Table Column
Text Field Cell - Price
Table Column
Text Field Cell - Special
Scroller
Scroller
Table Header View
Cars
Shared User Defaults Controller


It’s also not clear “how” you actually delete an item (I don’t see where this is described) from the hierarchy from the .xib file. I tried selecting an item and hitting “DEL” (no effect). There’s no “DELETE” shown under the Edit menu. The closest I could find was to drag the item out of the grid onto the canvas and delete it there. But, this was error prone and I kept messing things up since, from the text, I wasn’t sure what exactly to do.

Yikes, this chapter is … Frustrating. The images are not very good and there’s not enough detail shown. Too much to go wrong when trying to navigate the hierarchy and also trying to follow the book. Whether that it’s the graphical things going on or that this chapter wasn’t reviewed as carefully, it’s really a tough slog. I’ll probably have to skip the chapter.

I bet in your class, this chapter is simple. But in the book…not so much. :frowning:

====

Also, I agree with a reviewer on Amazon (I don’t post reviews on Amazon) who wrote that a lot of the text reads like “hey do this, wow!”. Perhaps the background/understanding comes later, but there doesn’t seem to be enough background of what’s actually happening when typing in the often seemingly mysterious code. Perhaps this book is meant to be a sampling of code for getting you started with projects? However, in this case, it doesn’t take a problem:solution approach, which would be my preference (unlike other programming environments, I cannot find any problem:solution “Cookbook” books like this for Cocoa). I’m not (yet) sure how this book will help me in an actual project.

Cocoa seems much, much more complicated than, say, .NET or even Java Swing.

I’m still hanging in there (for now)…

Thanks in advance.

  • m

#2

morkus,

This chapter is one of the more challenging in the book, even in classes. There are a lot of steps in interface builder, and if you make a mistake in the bindings you can end up with a confusing exception when you run your app. So hang in there! As far as the approach of the book, the book is indeed generally structured so that you do something first, then we explain more of the details behind what you’ve done later in the book. By doing it first, sometimes a bit blindly, we believe you then have a better context with which to make sense of the technical details later.

You’re correct, setting the column name is not done in the table view’s Attributes Inspector, it’s done by double-clicking on the column headers themselves, or by selecting a column individually and using its Attributes Inspector.

Regarding not seeing the “Table Cell View” to delete: you may have skipped setting the table view’s Content Mode to View Based. When you find it, yes, select it in the hierarchy and press the delete key.

Cocoa is very, very different from almost every other GUI toolkit. It’s opinionated, but it’s also extremely powerful. You can do a lot of things with a ridiculously small amount of code. Because it’s different, it takes time to get your head around how Cocoa apps should be structured, but in the long run, I’ve found, it’s very, very rewarding.

Adam


#3

Thanks Adam.

I’ll take another try at this chapter and see how things go.

A simple example of the problem:solution approach I wish there were a book that covered – Say, I wanted to learn how to open a text file and parse it, would my best bet be to try that in ‘c’ from within Cocoa? I don’t see any examples in any of the Objective c books I have that covers such a basic need every developer I know needs to do.

With Java, where I’m coming from, you can (almost) literally trip over books like that.

Thanks.

-m


#4

Hello Adam,

I think I’m much closer now, but am getting this when trying to run the project:

Since I can’t find a screenshot that goes with the binding table at the bottom of page 185, I think the “value of Col2 Check Box” (text from table at bottom of page 185) would be coded like this: Across the top you have Table Cell View and then Check Box. That’s where I did the bind to Table Cell View and Model Key Path: objectValue.onSpecial

However, on the right side of the objectValue.onSpecial, there’s a “!” symbol (for each of the bindings, actually). Not sure if that’s significant.

I did at one point have the project where I could bring up the form, but something got messed up.

I thought it might be the bold assignment, but I unbound those and am still getting this error.

I’m sure you’ve seen this problem often.

Suggestions?

Thanks.

-m


#5

Hi,
I just ran into this same problem.
For the current error:
Try checking your table view’s bindings. Is “Enabled > Bind To > Cars” checked? If so, turn it off. Then, scroll down, find “Table Content” and select “Bind to > Cars” with controller Key “arrangedObjects”. Then set selection indexes “Bind to Cars” with controller key “selectionIndexes” (I found that if you fail to do this step, the remove button doesn’t work right, neither will the bottom content).

For me, this was the first chapter that things didn’t just work. I have run into just about each error that you have.
Overcoming these errors required: slowing down, critically thinking about each step and building often.

I hope this helps.


#6

[quote=“morkus”]
A simple example of the problem:solution approach I wish there were a book that covered – Say, I wanted to learn how to open a text file and parse it, would my best bet be to try that in ‘c’ from within Cocoa? I don’t see any examples in any of the Objective c books I have that covers such a basic need every developer I know needs to do.
-m[/quote]

Have you looked at Hillegass’ Objective C beginner book? It focuses on using objective-c only and the exercises are mostly command-line based. I completed that book before starting in on the cocoa framework in this book. If you go through that book and do every exercise, I bet you would have a much better experience working through these chapters.


#7

It’s not objective-c that I need a tutorial for, and, yes, I did look at the Hillegass Objective-C book. However, it was too basic for me so I returned it.

Te Cocoa book’s level is just about right, but … thinking ahead to an actual project, I don’t see that there is a book that really focuses on developer needs we run into like you have with Java books.

I picked the example of just parsing a file, but … you name it. Once you get an interface working, then it’s all about how to do what you need to do -> The business logic. There seems to be a huge hole here with Objective-C books.

Thanks for your note.

-m


#8

[quote=“bastidiasRN”]Hi,
I just ran into this same problem.
For the current error:
Try checking your table view’s bindings. Is “Enabled > Bind To > Cars” checked? If so, turn it off. Then, scroll down, find “Table Content” and select “Bind to > Cars” with controller Key “arrangedObjects”. Then set selection indexes “Bind to Cars” with controller key “selectionIndexes” (I found that if you fail to do this step, the remove button doesn’t work right, neither will the bottom content).

For me, this was the first chapter that things didn’t just work. I have run into just about each error that you have.
Overcoming these errors required: slowing down, critically thinking about each step and building often.

I hope this helps.[/quote]

Hmmm, I seem to be OK with these steps.

I had the issue where, due at least somewhat to the low-resolution screenshots in the book (where it was hard to actually read some of the text there), it was easy to not do the correct setting, but I’ve gone over it a couple times now and am still getting the same error.

I’m assuming from your posting that you were able to get the example working, correct?

Perhaps I need to start over a 3rd time.

As difficult as the XCODE interface builder is to use, and as error proned as it seems to be, why would anyone use it?

Thanks much for your posting.

-m


#9

morkus:
I also have some issue with the clarity of the screen shots in the book, but in this case (as you pointed out) the table on pg. 185 does not have one any. And probably that is a good thing, for if you just bind in accordance with the table it works out. However, I realize that folks sometimes (myself included) can tell more by a picture here is an image:

Notice that I am using the expanded dock on the left to make sure that I have the correct item selected…I just noticed that the forum software clipped the right side of the image, so I will tell you that I too have the little “!” on the right side of the line, but I think that is because you are specifying something that doesn’t exist until runtime. If you have the four times from that chart configured like this one example, then I don’t think the error you are getting is in reference to this as mine worked.


#10

Thanks for the image. At least I know I have things set up the same way as you – at least as far as the screenshot goes.

I’ll post another message for Adam to see if I can send him my project. I’m sure it’s something minor, but I am not seeing it.

  • m

#11

morkus,

I had a look at your project; the issue was that the Remove button’s cell’s Enabled binding was bound to selection. I found it by control-clicking on the Cars array controller and going through the list of Referenced Bindings, making sure everything looked right. Because we don’t bind to cells, it stood out pretty well. Using the connections panel like this can be very handy for checking over a projects’ bindings, and you can use it from both sides of a connection/binding: to see everything an object is bound/connected to, as well as to see everything that is bound/connected to it.

Adam


#12

Thanks very much. Yes, that fixed one problem.

However, I’m still not able to actually add anything when I clicked “Add”. I get a row, but I can’t click in it.

It looks like I’ve got things bound correctly.

What should I look at?

(Is there a zip of all the worked examples from the book so I could investigate those instead of taking your time?)

Thanks.

  • m

#13

[quote=“morkus”]Thanks very much. Yes, that fixed one problem.

However, I’m still not able to actually add anything when I clicked “Add”. I get a row, but I can’t click in it.

It looks like I’ve got things bound correctly.

What should I look at?[/quote]

Did you set the text fields to be Editable? This is on page 186, right below Figure 11.11.

[quote=“morkus”](Is there a zip of all the worked examples from the book so I could investigate those instead of taking your time?)
[/quote]

We’ll be posting the solutions later this week.

Adam


#14

Thanks for your help and replies, Adam.

I finally got the example in Chapter 11 to work.

Since there wasn’t any code to … Debug, this chapter was, as you noted, more difficult than the others to this point.

Sincerely appreciate all your help. :slight_smile:

-m


#15

[quote=“morkus”]
Perhaps I need to start over a 3rd time.[/quote]
Maybe your fault is, that you are using the book like a cookbook jumping from page to page back and forth.
I read the chapter slowly word by word (i have to, because i am not a native speaker :slight_smile: ) and had no problems - ok, just a little with the date picker.
Some things you have mentioned, like deleting view cells or button bindings, have already been dealt with in previous chapters, so they shouldn’t be a big problem. Nevertheless COCOA/Objective-C is a tough nut to crack for me too and I agree with you, that some things are really hard to figure out. But I am looking forward to the next chapter, imho the authors have done a good job till now and the forum is very helpful too.

Skill comes with practice, i am afraid there is no shortcut :unamused:

Good luck!
Vertex


#16

I’m just happy to hear there are other confused people out there! I actually did not have a lot of trouble with the Chapter, except for the Challenge, which I still have not worked out. Understanding exactly what I’m doing is another matter. That is coming a lot more slowly. I suspect that is because there is a lot more here than just learning code.


#17

Thanks for the image! My selections for bindings for col 2 do not include a Table Cell View option. My list shows Application, Cars, Files Owner, Shared User Defaults Controller. I could set the bindings for col 0’s Image View and Text Field, and col 1’s Text Field to Table Cell View. But col 2 is different. Has anyone had a similar experience?

I could not figure out how to past my screenshot here. Choosing the Img tab and Pasting tiffs, pdfs, and jpegs did not work. I would appreciate advice for including screenshots as well.


#18

rwkopcke,

I’m not sure why you wouldn’t have the option for Table Cell View there. Presumably you set the Content Mode of the NSTableView to View Based, if the other columns worked?

I posted my screenshot using Cloud App, a Mac app that makes it easy to upload images and other stuff. You can then get a direct link to the image and on this forum use the “img” tag to post it.

Adam


#19

Thanks for the reference to Cloud. I’ll have to check my choice of check.

Dick