Questions tagged [nsexpression]

NSExpression is used to represent expressions in a predicate. Comparison operations in an NSPredicate are based on two expressions, as represented by instances of the NSExpression class. Expressions are created for constant values, key paths, and so on.

117 questions
0
votes
3 answers

stringFromDate not converting an NSDate to string

I have some simple code which should convert an NSDate which I retrieve from CoreData. For some reason it is not working in this class when the same code works in other views. What am I doing wrong? Below is the offending code and a screen shot of…
Sean
  • 440
  • 1
  • 6
  • 20
0
votes
2 answers

NSRegularExpression in url IOS

I have method that get title from url. It works but on the one website I don't have result from match. Have you any idea where is problem? On the webpage is title in Test - sds NSURL *url_s = [NSURL URLWithString:url]; NSData* data…
Unmerciful
  • 1,325
  • 4
  • 21
  • 38
0
votes
2 answers

nsexpression with custom function core data

i'm trying to group and count on date on a core data entity. since date cant be group due to different time. so i'm trying to pass custom function to nsexpression. but i get some errors i dont know what's the correct way to do it. code for grouping…
Hashmat Khalil
  • 1,826
  • 1
  • 25
  • 49
0
votes
1 answer

Problems with NSDecimalNumber Arithmetic when NSDecimalNumbers are stored in NSDictionary from NSExpression Core Data Fetch

I have been experimenting trying to learn how to use NSExpressions to fetch aggregate info from Core Data. I have the fetch working properly but I'm having trouble trying to parse the resulting data for processing. I'm sure I must be missing…
0
votes
2 answers

NSExpression is always returning zero

I have an entity called Rounds that has basic data about golf rounds. I am trying to calculate the number of rounds as well as the average score. However, every time I try and calculate these values it returns 0 (zero). There are no errors, and no…
tnb121
  • 61
  • 11
0
votes
1 answer

How do I retrieve additional properties for entity matching "max:" expression

I have a fetchRequest that returns the max value correctly for a particular key path. The set up looks something like this: NSExpression *keyExpression = [NSExpression expressionForKeyPath:@"distance"]; NSExpression *functionExpression =…
Mark Armstrong
  • 819
  • 6
  • 9
0
votes
1 answer

CoreData in XCode create a NSFetchRequest returning all entities from today

Is there any solution to create a NSFetchRequest in the XCode view which is returning all entities from "today"? In the view you can only specify a date but not dynamically define today. I know that I can also create a NSFetchRequest directly in…
Prine
  • 12,192
  • 8
  • 40
  • 59
0
votes
1 answer

Perform operation on two Core Data Attributes with NSExpressions

Things like max, min, and avg can be calculated just fine, NSExpression *maxDate = [NSExpression expressionForKeyPath:@"startDate"]; NSExpression *maxDateExpression = [NSExpression expressionForFunction:@"max:" …
Skyler
  • 2,834
  • 5
  • 22
  • 34
0
votes
1 answer

Calculate the average of all NSManagedObjects' attributes

I have an entity with the name FoodItem, and it has one attribute, price (a double). Ideally, the output of this code would be: Average Price is: 6.00 Though I'm not sure how to access the value 6.00. Can anyone assist me? Thank you Here is my…
Skyler
  • 2,834
  • 5
  • 22
  • 34
0
votes
1 answer

NSFetchRequest for groupby and count combination

I'm new in Core Data, so i want to write simple fetch request to group result by some field and also a count of another field in that group. so for example i have products table i want to retrieve all grouped products by date and the count of…
taffarel
  • 4,015
  • 4
  • 33
  • 61
0
votes
2 answers

NSFetchRequest With NSPredicate in Core Data

I have an attribute of type NSData and I want to search a string in this attribute how can I perform this search using NSPredicate? I try to use NSPredicate with block but predicate with block not supported for Core Data SQlite based store.
Tefa
  • 15
  • 5
0
votes
1 answer

Using NSExpression to combine entities and return an NSArray or NSArray elements

I would like the NSFetchRequest for my UITableViewController to group similar records (entities) based upon a particular attribute. I currently do a two-step process, but I believe there might be someway to use an + (NSExpression…
1 2 3 4 5 6 7
8