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

Re: Core Data question


  • Subject: Re: Core Data question
  • From: Sandro Noel <email@hidden>
  • Date: Fri, 08 Aug 2008 16:51:25 -0400

Chris, thank you!
the database itself is designed as a relational database would be,
it's quite large actually, I just posted here two tables to illustrate the problem.


The software I am building is a personal one, to help me track my budget.
the goal is to import my transactions at the end of every month, and compare
it to the budget, and the software will point out the out of budget spending habits so I can either budget them in,
or correct them.


I know other software out there do that, but it's a learning project ... to learn cocoa :)
and I want to make it really simple, import, compare, report. that's all.


>>Instead of different types of transactions, transactions always have debits and credits.
humm, not in the bank statement, they also have CHECK. and I want to track that too.



I retrieve/create/insert (not quite sure yet :)) an object from the context, and set the values like this.

NSManagedObject *transaction = [NSEntityDescription insertNewObjectForEntityForName:@"Transactions"
inManagedObjectContext:[self managedObjectContext]];

This is inserting a new instance of that entity in the managed object context.

That's how he manual says to insert records, kind of works well, if you do not have relationships.
it crashes on me as soon as i have a relationship on the table i want to insert to.




The Transaction(tr) Object Used in the code above is defined like this:

@interface OFXTransaction : NSObject {

Why do you even have this class? It looks like its whole purpose is to replicate what you already have defined in your Transaction entity. You can just use an NSManagedObject subclass to represent one directly.


This class is the class used to import the data from my OFX file, My OFX importer has a class for every section of the OFX specification.


Yes, you will need to insert or fetch an instance of your TransactionType entity. You'll just take that and set it as the value of your Transaction instance's transactionType relationship.


Cool, that's simple.

Hope this helps!

It does thanks Chris.
-- Chris


Sandro.
_______________________________________________

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


References: 
 >Core Data question (From: Sandro Noel <email@hidden>)
 >Re: Core Data question (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Core Data question
  • Next by Date: Re: CGImageSourceCreateFromURL failed with error -11
  • Previous by thread: Re: Core Data question
  • Next by thread: Recommended way of checking OS version
  • Index(es):
    • Date
    • Thread