• 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
Core Data Relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data Relationships


  • Subject: Core Data Relationships
  • From: Matt D <email@hidden>
  • Date: Thu, 5 Apr 2007 02:33:42 -0700

Hello everyone,

I have discovered the awesome power of the Core Data system. I have one question though. I have set up relationships (which work just fine) and crated an application. The application has a list on the left with projects and a tab view on the right. In the tab view, you can switch to different views to add versions and bugs. I have just been adding data to the versions and bugs though a table view, but want to have a window pop up and enter the values. I have no problem with popping up the window, etc, but I am stuck on saving the data.. This is my current code:

NSManagedObjectContext * context = [[NSApp delegate] managedObjectContext];
NSManagedObject * version = nil;

version = [NSEntityDescription insertNewObjectForEntityForName:@"BCVersions" inManagedObjectContext:context];


[version setValue:[newVersion stringValue] forKeyPath:@"product_version"];

My only problem is that it is not saving to the relationship it has with BCProducts. I thought this would happen automatically, but I guess it doesn't? The data does add, but without the relationship of corse. I have read several documents from apple about Core Data and can't find my answer. I bet it is staring at me somewhere close, but I don't see it...

Anyway, I appreciate any help going in the right direction!

Thanks,

Matt D



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Core Data Relationships
      • From: Julio Cesar Silva dos Santos <email@hidden>
    • Re: Core Data Relationships
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Re: How to add messages to Cocoa's Run Loop
  • Next by Date: Re: Core Data Relationships
  • Previous by thread: Re: Odd Layout Manager Crash
  • Next by thread: Re: Core Data Relationships
  • Index(es):
    • Date
    • Thread