@nlutsenko
I keep getting this error when incrementing a PFObject number field
Why?
2016-07-18 00:18:21.648 Ballout[880:190687] -[__NSCFNumber incrementKey:]: unrecognized selector sent to instance 0xb000000000000003
2016-07-18 00:18:21.650 Ballout[880:190687] [Bolts] Warning: `BFTask` caught an exception in the continuation block. This behavior is discouraged and will be removed in a future release. Caught Exception: -[__NSCFNumber incrementKey:]: unrecognized selector sent to instance 0xb000000000000003
Looks like you are trying to increment a value for a key, not the object directly.
What I mean is better explained with a code snippet:
PFObject *object = ...;
[object[@"foo"] incrementKey:@"bar"];
vs
PFObject *object = ...;
[object incrementKey:@"bar"];
I would double check your logic for when you are running the incremetKey and validate that the receiver of increment method call is an instance of PFObject or it's subclass.
@nlutsenko
//I have this PFObject
var liveEvent: PFObject!
//I increment
self.liveEvent["chargedCount"].incrementKey("chargedCount", byAmount: NSNumber(integer: 1))
//Then save
self.liveEvent.saveInBackground()
I think I see where i went wrong.
self.liveEvent.incrementKey("chargedCount", byAmount: NSNumber(integer: 1)) 馃挴
This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide