Properties vs Instance Variables

2011-04-26 Thread Guy Steven
I am currently learning objective c and cocoa

I believe I understand the difference between properties and instance
variables, and the effect of using properties as opposed to instance
variables viz a viz KVO and memory management.

What I can't understand is why you would access instance variables directly
within a class. My quess is speed. Is there any other reason?

And related to this, why give instance variables a name different to the
name of the property.

Again, I suspect it may be a matter of style, but would like to know if
there are cases where it is a necessity.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


computing values within NSTableView using bindings

2011-04-21 Thread Guy Steven
I have an NSTableView with 3 columns.


The first contains an NSPop-up which takes as its datasource an array of
objects with two properties, name and cost. The name is displayed.

The user enters a quantity in the 2nd column.

How do I go about displaying the cost in the third column? I can bind that
column to the quantity key, but don't then know the cost, or I can bind the
column to get the cost, but don't then know the quantity?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com