1
단추 작업시 두 개체를 서로 바꾸려고하는데 작동하지 않습니다. 처음으로 교환 중이지만 다음 번에 버튼을 클릭하면 EXC_BAD_ACCESS와 충돌합니다.객관적인 c의 개체 바꾸기
여기에 코드
-(IBAction)swapLocation
{
CCLocDTO *tempDto = searchDTO.toDTO;
searchDTO.toDTO = searchDTO.fromDTO;
searchDTO.fromDTO = tempDto;
NSLog(@"From Location is %@",searchDTO.fromDTO.streetAddress); //it becomes empty on next button click
NSLog(@"To Location is %@",searchDTO.toDTO.streetAddress);
NSLog(@"From Special Location is %@",searchDTO.fromSpecialDTO.locationName);
NSLog(@"To Special Location is %@",searchDTO.toSpecialDTO.locationName);
[self.tableView reloadData];
}
내가 검색 DTO (searchDTO)에 fromDTO 및 toDTO을 할당하고있다. 당신은 ARC를 사용하지 않는 경우
은'리턴'[[바] 오토 릴리즈 유지]과 같이 구현 특성을 유지하기위한 기본 게터가 없습니다 :
또는 같은
? – JustSid감사합니다. Tom, 내 하루를 저장했습니다. – Anish
@JustSid 아니, 난 그냥 보유 개수 만지지 않고 그냥 ivar를 반환 확신합니다. –