• 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
Key-Value coding for mutable one-many value (Java)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Key-Value coding for mutable one-many value (Java)


  • Subject: Key-Value coding for mutable one-many value (Java)
  • From: Bill Gardner <email@hidden>
  • Date: Sat, 20 Mar 2004 21:39:20 +0900

In order to set the content array for an NSArrayController from Java for a property with key "topic",
I create methods in the class (a subclass of NSWindowController) which I bind to
the contentArray of the array controller -

public int countOfTopics()
and
public Object objectInTopicsAtIndex(int index)

This works fine as long as the one-many property is immutable. However, in order to
call addObject on the arrayController, the one-many property needs to be mutable.
So I add the following methods to my class -

public void removeObjectFromTopicsAtIndex(int index)
and
public void insertObjectinTopicsAtIndex(Object topic, int index)

This fails with

"setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key topics"

Can anyone shed any light on why this isn't working?

(The alternative of having get/set methods for an NSMutableArray - getTopics and setTopics seems
to work fine, but I don't want to maintain the data in a mutable array.)

Thanks.

Bill Gardner.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: [Solved partially] NSTask with complexe command
  • Next by Date: Re: Progress indicator in dock icon
  • Previous by thread: Cocoa Bindings and Radio Buttons don't save state correctly?
  • Next by thread: Programmatically Create Login Item
  • Index(es):
    • Date
    • Thread