How can I increment numeric String value?
If it is initially "1", I want to increment it in every applicationDidEnterBackground click
In your case it's weird that you use string for that purpose but you can technically do it like this:
int myInt = [myString intValue];// I assume you need it as an integer.
myString= [NSString stringWithFormat:@"%d",++myInt];
Best option: make it a number instead of a string.
Other option: strValue = [NSString stringWithFormat:@"%d", [strValue integerValue] + 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