単純だがイライラする問題があります。
アプリに次の行があります。
[super setText:[[[NSString alloc] initWithFormat:@"%i" arguments:arg] autorelease]];
その行はサードパーティのライブラリからのものだったので、警告を取り除いて適切に機能させようとしました。とにかく、どうすればこの警告を修正できますか?
ありがとう!
完全な方法:
- (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);
}