fetched-property

Fetched Property in XCode Data Model Editor for minimum value

删除回忆录丶 提交于 2019-12-12 08:23:47
问题 How do I add a Fetched Property in XCode's Data Model Editor for minimum value of one attribute?? My model: Model http://www.freeimagehosting.net/uploads/b48853070e.png Item (name, note, storedItem) StoredItem (price, item) Item 1 ---> N StoredITem (1->N Relationship) I want that Item has a fetched property named minPrice and its value is the minimum value setted for price in the storedItems. Example: Item1 (banana, storedItem1 ... storedItem4, 10) StoredItem1 (10,item1) StoredItem2 (15,item1

How do I create an NSFetchedPropertyDescription programmatically?

瘦欲@ 提交于 2019-12-11 11:12:14
问题 I have a pre-existing NSManagedObjectModel that I created with the Xcode GUI. I want to create a sorted fetched property, which Xcode 3.2's GUI doesn't support. I do all of this before creating my NSPersistentStoreCoordinator because I know you can't modify a NSManagedObjectModel after an object graph manager has started using it. I created the NSFetchedPropertyDescription thusly: NSManagedObjectModel *managedObjectModel = ... // fetch from my mainBundle NSEntityDescription

does anyone have a working example of a fetched-property in core-data?

♀尐吖头ヾ 提交于 2019-12-02 18:08:57
I have tried to use fetched properties a couple of times, and although it seems to be the right approach, it never works. In my latest attempt I added the fetched-property to my entity, selected the other entity in the model as the 'destination', and set the predicate to a condition that I know is valid. Problem 1: When the NSManagedObject-class for the entity is generated it does not include anything for the fetched-property. After some searching I added the declaration for it in the .h file and the @dynamic statement for it in the .m file (yes, I know it's an NSArray * type). Problem 2: Even

Fetched Properties - Predicate

北慕城南 提交于 2019-12-01 01:35:37
I have a question about using fetched properties inside a NSPredicate (see below 'My question'). It's not about the predicate to get the fetched property. For clarification and for others, which may also face this problem I tried to make a small sample project. SAMPLE PROJECT The need to use Fetched Properties came, because my app was rejected because of violating the iOS Data Storage Guidelines. In QA1719 they write: Apps should avoid mingling app data and user data in the same file. I think this may be necessary for easier ICloud sync and may also help in migration. So, how to do this? I had

Fetched Properties - Predicate

核能气质少年 提交于 2019-11-30 20:18:08
问题 I have a question about using fetched properties inside a NSPredicate (see below 'My question'). It's not about the predicate to get the fetched property. For clarification and for others, which may also face this problem I tried to make a small sample project. SAMPLE PROJECT The need to use Fetched Properties came, because my app was rejected because of violating the iOS Data Storage Guidelines. In QA1719 they write: Apps should avoid mingling app data and user data in the same file. I think

Core Data get sum of values. Fetched properties vs. propagation

时间秒杀一切 提交于 2019-11-30 10:20:25
I'm relatively new to Core Data (coming from an SQLite background). Just finished reading the 'Core Data for iOS' book but I'm left with a number of baffling questions when I started modelling an app which has the following model: 'Accounts' entity which has a to-many 'transactions' relationship and a 'startingBalance' property 'Transaction' entity which has a to-many 'payments' relationship (and an inverse to Accounts) 'Payment' entity which contains details of the actual 'amount' paid For performance reasons I wanted to de-normalize the model and add a 'TotalAmountSpent' property in the

Core Data get sum of values. Fetched properties vs. propagation

倖福魔咒の 提交于 2019-11-29 15:11:57
问题 I'm relatively new to Core Data (coming from an SQLite background). Just finished reading the 'Core Data for iOS' book but I'm left with a number of baffling questions when I started modelling an app which has the following model: 'Accounts' entity which has a to-many 'transactions' relationship and a 'startingBalance' property 'Transaction' entity which has a to-many 'payments' relationship (and an inverse to Accounts) 'Payment' entity which contains details of the actual 'amount' paid For

How to sort Core Data fetched properties

老子叫甜甜 提交于 2019-11-28 15:49:28
The Core Data Documentation states that: The fetch request associated with the [fetched] property can have a sort ordering, and thus the fetched property may be ordered. How do I specify the sort descriptors for the fetched property in Xcode's data model editor? I can't find a relevant field anywhere. I'm developing for the iPhone platform, if this makes any difference. If this is not possible via the graphical model editor, how do I go about modifying the fetch request for the fetched property in code so that it has a sort descriptor? The modeling tool doesn't appear to have a way to set the

How to sort Core Data fetched properties

和自甴很熟 提交于 2019-11-27 09:35:37
问题 The Core Data Documentation states that: The fetch request associated with the [fetched] property can have a sort ordering, and thus the fetched property may be ordered. How do I specify the sort descriptors for the fetched property in Xcode's data model editor? I can't find a relevant field anywhere. I'm developing for the iPhone platform, if this makes any difference. If this is not possible via the graphical model editor, how do I go about modifying the fetch request for the fetched