• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???


  • Subject: Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 3 Jan 2005 10:29:51 -0800


On Jan 3, 2005, at 7:58 AM, Mark Munz wrote:

I agree 100%. Users expect magic (things just work the way the expected it to), but programmers need to be able to step through each piece to insure the results are expected (and that the unexpected is dealt with). I get the whole KVC, KVO concept. That's not what bugs me with bindings. It's the magic, in particular with NSArrayController that I've struggled with.


There is no magic.

In my opinion, the fact that basic operations like Drag-n-Drop still require "glue code" defeats the purpose of a general purpose array controller.

In some respects drag and drop may be considered "simple", however there are a number of combinations of operation that one might want to perform, or not depending on the circumstances. Do you allow reordering? What pasteboard types do you allow? What actually happens on a drop (how do you retrieve what from the pasteboard, if indeed you do)? The existing table view delegate methods give a reasonable abstraction that allows customisation of all of these behaviours; I suspect that there would be complaints if bindings forced you to adopt a single model...


If I have NSObjects that support the copy-protocol, Drag-n-Drop should be free. I think it adds to the confusion -- well, the data is automatically handled for you via magic in the NSArrayController unless you're doing a drag-n-drop, then you have to perform the magic (great, but what happens when you don't understand what the magic is because it not well documented).

Please let me know what you consider to be not well documented -- better still, file bugs.


There is no way to tell what is happening with the NSArrayController objects.

It's not clear what you don't understand.


I can get stuff to work, but I don't understand why the stuff I got to work does what it does. It's very click-and-pray. I've would love to see an example of NSArrayController with just one basic type -- NSStrings.

As has been stated on several occasions on this list, because bindings rely largely on key value coding, strings do not work well as a model. Typically you need at least a dictionary.


Essentially, an example of a basic List. Start off without drag-n-drop support. Then add it.

That's basically what my Bookmarks example does. If you want to remove drag and drop support, simply revert the DNDArrayController to an NSArrayController.


There is also a general flaw with using Interface Builder to develop applications -- there are no diagnostic tools that easily show connections (Outlets and Actions and Bindings) for each object. You essentially have to click on each object and view the connections, bindings individually.

Please file enhancement requests...

Finally FWIW, if the intent is to reduce code, I think there should be a way to support basic properties without having to write the glue code to access each one property.

It already does:
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Protocols/NSKeyValueCoding.html>


mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
      • From: Mark Munz <email@hidden>
    • Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
      • From: James Dessart <email@hidden>
References: 
 >Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Izidor Jerebic <email@hidden>)
 >Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ??? (From: Mark Munz <email@hidden>)

  • Prev by Date: Re: Not getting socket connected notification from NSFileHandle
  • Next by Date: Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
  • Previous by thread: Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
  • Next by thread: Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
  • Index(es):
    • Date
    • Thread