Hey guys, i have a small problem with a method and how it affects my core data.
The line in question is this:
Code:
// set status to 1 here: 1 = complete and READY to sync
[self.referringObject setValue:[NSNumber numberWithInt:1] forKey:@"status"];
So this sets a value of 1 to the current object held in "self.referringObject". but i dont have this directly in a button or method. It is set in a void method that is designed to post data to a server.
In order to call this at the time of my (or the users) choosing i have it called from a button:
Code:
- (IBAction) test: (id) sender {
[self createInvoiceItemsString];
}
But after pressing the button, if i use an SQLite browser to look up my database i can see that "status" hasnt been changed from 0 to 1.
Here is the twist though: If i call the exact same method from my viewDidLoad (in the same class) then it will alter it to be a 1 and everything will be set ok.
I dont mind that much if i have to set this in viewDidLoad, but it would potentially cause some problems with data management and as such it would be much better suited if the button was to set this. I have tried moving that line of code to the button so that sets it directly but this also doesnt change anything.
Any idea as to why this would work from viewDidLoad but not from a button?
Thanks in advance Joe