사용자 정의 세터와 속성을 설정할 수 없습니다내가 내을 locationManager과 다음 구현하기 위해 노력했습니다
- (void)setCurrentLocation:(CLLocation *)currentLocation {
self.currentLocation = currentLocation;
NSLog(@"%f", currentLocation.coordinate.latitude);
//Notify the app of the location change
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:self.currentLocation forKey:kIFLocationKey];
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:kIFLocationChangeNotification object:nil userInfo:userInfo];
});
}
문제는 : 내가 응용 프로그램을 실행할 때, 내가 디버그 모드와 t에서 "setCurrentLocation"방법에서 "BAD_EXEC (코드 2)"오류 메시지가 그는 앱이 끊겼다. 그러나 나는 그 문제를 이해하지 못한다. 뭔가 빠져 나왔어? "startStandardUpdates"에서 위치 관리자가 사용자의 위치를 찾으면 사용자 정의 setter "self.currentLocation = currentLocation"을 사용하여 "currentLocation"속성이 업데이트되고 있습니다.
미리 도움을 주셔서 감사합니다. 안부 세 바스 챤