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

PFObject.state causes crash #33

Closed
craiggrummitt opened this issue Aug 17, 2015 · 3 comments
Closed

PFObject.state causes crash #33

craiggrummitt opened this issue Aug 17, 2015 · 3 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@craiggrummitt
Copy link

If a PFObject contains a variable called 'state' saving this object causes a crash.
You can find a sample bare bones project based on Parse Starter Project(v1.8) illustrating the bug here:
https://github.com/craiggrummitt/ParseStateBug

Error in console:
NSInvalidArgumentException', reason: '-[Swift._NSContiguousString isDeleted]: unrecognized selector sent to instance ...'

@nlutsenko
Copy link
Contributor

Hey @craiggrummitt thanks for reporting this with a repro.
Will investigate further and let you know what I find.

@nlutsenko nlutsenko self-assigned this Aug 17, 2015
@richardjrossiii richardjrossiii added type:bug Impaired feature or lacking behavior that is likely assumed and removed needs repro labels Aug 17, 2015
@richardjrossiii
Copy link
Contributor

Found the issue. It is related to our automatic inferring of instance variables for subclassed objects. For some backwards compatibility reason, if you have an instance variable on your PFObject subclass with the same name (or the name + underscore) as one of your properties, we make the @dynamic implementation of that property set the iVar, not the PFObject dictionary.

Now, normally this isn't an issue. It works in 99% of all cases. However, in the case of state, we have an iVar on PFObject named _state, which causes our method resolution (found in PFObjectSubclassingController) to write to the _state iVar instead of the object dictionary. PR with a fix incoming shortly.

@richardjrossiii
Copy link
Contributor

Should be fixed in #35.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants