• 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: ArrayController, CoreData & Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ArrayController, CoreData & Bindings


  • Subject: Re: ArrayController, CoreData & Bindings
  • From: "Bobby B" <email@hidden>
  • Date: Tue, 9 May 2006 11:25:20 -0400

mmalc,

Just out of curiosity, why is it "wrong" to do it that way?  It seems
programatically that it should work.  I can't figure out why it
doesn't.

Thank you
Bobby B


On 5/8/06 6:29 PM, "Bobby B" <email@hidden> wrote:

> Hey guys;
>
> This is what I'm trying to do:  Upon the first run of my app, it
> checks to see if there are any entries in some of the tables, which
> are bound from the array controller to their CoreData models.  The
> point is to make some "defaults" for the user, which they can later
> change.
>
> This is what I'm doing:
>
> int weatherCount = [[weatherArray
> valueForKeyPath:@"arrangedObjects.@count"] intValue];
> NSLog (@":%d", weatherCount);
> if (weatherCount == 0) {
> [weatherArray add:self];
> [weatherArray setSelectionIndex:0];
> [weatherArray setValue:@"Hot & Sunny" forKeyPath:@"selection.weather"];
>
> [weatherArray add:self];
> [weatherArray setSelectionIndex:1];
> [weatherArray setValue:@"Warm & Pleasant" forKeyPath:@"selection.weather"];
>
> [weatherArray add:self];
> [weatherArray setSelectionIndex:2];
> [weatherArray setValue:@"Overcast" forKeyPath:@"selection.weather"];
>
> [weatherArray add:self];
> [weatherArray setSelectionIndex:3];
> [weatherArray setValue:@"Rainy" forKeyPath:@"selection.weather"];
> }
>
> weatherArray is an NSArrayController.  This code is run during a
> performSelector after a little bit of a delay after the program is
> run.  The code enters the loop properly, and it adds the four
> defaults, but it doesn't apply the "setValue".  It just adds four
> blank entries, which I can later edit.
>
> I can't seem to figure out why my setValue:'s wouldn't "stick."
>
> Any hints?
>
> Thank you guys
> Bobby B
>  _______________________________________________
> 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



_______________________________________________
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: ArrayController, CoreData & Bindings
      • From: mmalcolm crawford <email@hidden>
References: 
 >ArrayController, CoreData & Bindings (From: "Bobby B" <email@hidden>)
 >Re: ArrayController, CoreData & Bindings (From: Greg Herlihy <email@hidden>)

  • Prev by Date: Re: Problem with prebinding and Frameworks
  • Next by Date: Job opening - NovaMind Software: Brisbane, Australia
  • Previous by thread: Re: ArrayController, CoreData & Bindings
  • Next by thread: Re: ArrayController, CoreData & Bindings
  • Index(es):
    • Date
    • Thread