Reputation: 732
I have a call back function, that on a certain event goes and updates a textField. I use an instance of the viewcontroller class, varViewController to access the textfield from the C code because I can't access the textfield and other members/outlets using self.
Now the problem is, when I update the textfield, it is not instantaneously updated. After I press any other button or do some action on the view, I see the updated value.
void abc(int a, char *b, char *c){
current = a;
if (varViewController == NULL)
NSLog(@"\varViewController is empty");
else
NSLog(@"\varViewController");
varViewController.tempAddress = @"GotSomething";
[varViewController txtCallId ].text=@"CALLING CALLING";
}
My questions are :
First : Why is the value not getting updated as it is changed?
Second : How do I make the value appear as soon as it is changed??(value changed in c function).
Upvotes: 3
Views: 26998
Reputation: 5380
In order to force view to re-render try the following
[varViewController.view setNeedsDisplay];
Upvotes: 8