开发者

How To Setup Core Data Model For Simple App?

开发者 https://www.devze.com 2023-04-04 01:19 出处:网络
I\'m familiar with core data but want to make a simple app that calculates salary. User enters their expenses, etc and it will determine how much their income needs to be to make it work.

I'm familiar with core data but want to make a simple app that calculates salary. User enters their expenses, etc and it will determine how much their income needs to be to make it work.

I'm thinking I make an entity for each Event and then have an attribute expens开发者_开发问答e for each expense.

Is there then an easy way to add all these values of expense properties and do some calculations with them? I will set their type to float or nsnumber or int, etc.

Update: I will make the relationship of Event to Expense to many and the inverse relation ship would be one to one. But about actually doing calculations with these values?


If you are going to add many values to Entity, you must use a relationship between them, it's the only way to have and Event with its Expenses...

Event <---->> Expense

An Event has too many Expenses and every Expense belongs to an Event...

0

精彩评论

暂无评论...
验证码 换一张
取 消