How do I increment a NSNumber?
i.e. myNSNumber++
NSNumber
objects are immutable; the best you can do is to grab the primitive value, increment it then wrap the result in its own NSNumber
object:
NSNumber *bNumber = [NSNumber numberWithInt:[aNumber intValue] + 1];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With