0

I'm building an app that gets items with an averageReview of 5.

-(PFQuery *)queryForTable {
    NSInteger goodReview = 5;
    PFQuery *query = [PFUser query];
    [query whereKey:@"averageReview" equalTo:goodReview];  
    return query;
}

Xcode gives me this warning:

**Implicit conversion of 'NSInteger' (aka 'long') to 'id' is disallowed with ARC**

In Parse core I have a column named "averageReview" and the type is "number".

How do I fix this?

1 Answer 1

1

You passed it an int value which is not of an object type. Use NSNumber for number values with Parse. The @5 below is shorthand for [NSNumber numberWithInt:5]

- (PFQuery *)queryForTable {
      NSNumber *goodReview = @5;
      PFQuery *query = [PFUser query];
      [query whereKey:@"averageReview" equalTo:goodReview];

      return query;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.