1
작은 문제가 있습니다. 나는 초보자 인 iPhone 프로그래밍이므로 대답이 확실하다면 나를 용서해주십시오.배터리 잔량이 업데이트되지 않습니다.
현재 요금이 청구되었으며 앱을 실행하는 동안 계속 업데이트하고 싶습니다. 나는 이것을 시도했다 :
- (void) viewWillAppear:(BOOL)animated
{
NSLog(@"viewWillAppear");
double level = [self batteryLevel];
currentCharge.text = [NSString stringWithFormat:@"%.2f %%", level];
timer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:selfselector:@selector(updateBatteryLevel:) userInfo:nil repeats:NO];
[super viewWillAppear:animated];
}
처음에는 올바르게 읽었지만 업데이트되지는 않았다. 어떤 도움을 많이 주시면 감사하겠습니다!
많은 감사,
스튜어트는
루이 덕분에 정말 감사드립니다. 내가 말했듯이, 나는 지금 막 배우고 있고, 지금 이것을 올바르게 올바르게 할 수 있습니다. 다시 한 번 감사드립니다! – Stumf