Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized Selector count sent to an NSNumber #6

Open
EddyBorja opened this issue Aug 11, 2015 · 2 comments
Open

Unrecognized Selector count sent to an NSNumber #6

EddyBorja opened this issue Aug 11, 2015 · 2 comments

Comments

@EddyBorja
Copy link

While trying to query an average value during an NSManagedObject's awakeFromFetch and awakeFromInsert, I'm getting this error:

2015-08-10 22:07:10.077 PropertyHunter[29805:971191] -[NSDecimalNumber count]: unrecognized selector sent to instance 0x608000431260

The line of code:

[[[sharedContext ofType:@"Store"] where:@"location.zipcode = %@", self.zipcode] average:@"visits"];

I'm using this in a Mac OS X app. Any idea why this happens?

@martydill
Copy link
Owner

Hey, thanks for the bug report!

I was able to reproduce this with an OS X app. It looks like OS X apps use NSXMLStoreType for Core Data, and apparently, that causes some different behaviors when using NSExpressions. Seems like the bug occurs when using raw Core Data, even without involving ios-queryable.

Switching to NSSQLiteStoreType fixed the problem in my test app, but I'll try to find a proper solution that doesn't require doing that.

@EddyBorja
Copy link
Author

Thanks for looking into it!


Sent from Mailbox

On Mon, Aug 17, 2015 at 9:21 AM, Marty Dill [email protected]
wrote:

Hey, thanks for the bug report!
I was able to reproduce this with an OS X app. It looks like OS X apps use NSXMLStoreType for Core Data, and apparently, that causes some different behaviors when using NSExpressions. Seems like the bug occurs when using raw Core Data, even without involving ios-queryable.

Switching to NSSQLiteStoreType fixed the problem in my test app, but I'll try to find a proper solution that doesn't require doing that.

Reply to this email directly or view it on GitHub:
#6 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants