• 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
Duplicate rows appearing in outlineview after creating new Entity in moc, why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Duplicate rows appearing in outlineview after creating new Entity in moc, why?


  • Subject: Duplicate rows appearing in outlineview after creating new Entity in moc, why?
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 15 Jul 2008 17:59:55 -0400
  • Organization: Rogue Research

Hi all,

I have an outlineview populated by binding to a treecontroller.  It
displays CoreData entities of type "Person".  "Person" has 'parent' and
'children' relationships.  Displaying everything works fine.

Now the outlineview must support drops.  In my windowcontroller, I
implement outlineView:acceptDrop:item:childIndex: and look for my custom
pasteboard type.  If it's there, I need to create a new "Person"
entity.  How should I do this?

I have tried:
 a) [myTreeController add:nil];

 b) Person* person = [myTreeController newObject];
    [person setParent:...];

 c) Person* person = [NSEntityDescription
      insertNewObjectForEntityForName:@"Person"
      inManagedObjectContext:moc];
    [person setParent:...];

In all cases, the outlineview shows 2 of the new person.  The problem is
not on the model side, since if I close and reopen the window, only 1
new person is there.

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Duplicate rows appearing in outlineview after creating new Entity in moc, why?
      • From: Jonathan Dann <email@hidden>
  • Prev by Date: Inter-thread communications (live/deadlock?)
  • Next by Date: Re: how to add modal dialog once application begin to run
  • Previous by thread: Re: Inter-thread communications (live/deadlock?)
  • Next by thread: Re: Duplicate rows appearing in outlineview after creating new Entity in moc, why?
  • Index(es):
    • Date
    • Thread