I have a simple yet frustrating problem.
I have this line in my app:
[super setText:[[[NSString alloc] initWithFormat:@"%i" arguments:arg] autorelease]];
That line was from a 3rd party library so I trying to just get rid of the warning and make it work properly. Anyway how would I fix this warning?
Thanks!
Full method:
- (void)timerLoop:(NSTimer *)aTimer {
//update current value
currentTextNumber += currentStep;
//check if the timer needs to be disabled
if ( (currentStep >= 0 && currentTextNumber >= textNumber) || (currentStep < 0 && currentTextNumber <= textNumber) ) {
currentTextNumber = textNumber;
[self.timer invalidate];
}
//update the label using the specified format
int value = (int)currentTextNumber;
int *arg = (int *)malloc(sizeof(int));
memcpy(arg, &value, sizeof(int));
//call the superclass to show the appropriate text
[super setText:[[[NSString alloc] initWithFormat:@"%i" arguments:arg] autorelease]];
free(arg);
}