임 다음 코드를 사용하여, 이중에 값을 할당하려고 :초기화 중 호환되지 않는 유형의 식을 '더블' 'ID'
double distanceFormat = [self.runsArray[indexPath.row] valueForKey:@"runDistance"];
을하지만 다음과 같은 오류가 계속 :
Initialising 'double' with an expression of incompatible type 'id'
을
그러나 값이 두 배라는 것을 알고 있습니다! 이것을 할 수있는 방법이 있습니까? 당신은 내가이 일을 할 생각은 두 번 생각하는 경우
double distanceFormat = [[self.runsArray[indexPath.row] valueForKey:@"runDistance"] doubleValue];
:
이 self.runsArray 사전의 배열인가? 그냥 doubleValue를 끝에 추가해야한다고 생각합니다. – rooster117
예, 문자열과 함께 작동합니다. 나는 xcode를 거기에서 두 배가다는 것을 저를 믿기 위하여 얻는다 다만 기울인다! –
그냥 시도 [[self.runsArray [indexPath.row] valueForKey : @ "runDistance"] doubleValue]; – rooster117