코코아 메모리 관리가 붙어 있습니다.RetainCount 메모리가 free'ed가 아닙니다.
- (IBAction) createPush:(UIButton *)sender {
[create setEnabled:NO];
[release setEnabled:YES];
aLocation = [[Location alloc] init];
// Put some Example Stuff in the Class
aLocation.title = @"Apartment";
aLocation.street = @"Examplestreet 23";
aLocation.zip = @"12345";
aLocation.city = @"Exampletown";
aLocation.http = @"http://google.com";
aLocation.info = @"First Info Text";
aLocation.info2 = @"Second Info Text, not short as the first one";
aLocation.logoPath = @"http://google.de/nopic.jpg";
[aLocation.pictures addObject:@"http://google.de/nopic.jpg"];
[aLocation.pictures addObject:@"http://google.de/nopic.jpg"];
}
- (IBAction) releasePush:(UIButton *)sender {
[release setEnabled:NO];
[create setEnabled:YES];
[aLocation release];
aLocation = nil;
}
이 코드는 내가 설정하거나 변수를 얻을 수 있지만, 나는 '마지막'출시를 호출 할 때 (그래서 카운트를 유지 0) 경우 잘 작동 aLocation의 방법은 호출되는 그것의 dealloc하지만, 악기 할당에 당신은 볼 기억은 되돌려주지 않는다. 여기
위치의 출처 : 헤더 파일에 대한 '.H'대신 '하는 .m'(죄송합니다 그 때문에 대량 보내기 규칙)와
http://homes.dnsalias.com/sof/Location.m 같은 링크.
그리고 전체 프로젝트 : 어떤 도움 http://homes.dnsalias.com/sof/Location.zip
감사합니다, 어디 내 실패는 무엇입니까? 데니스
이것은 'aLocation'과 관련된 모든 코드입니까? 예를 들어, 배열에 넣지 않아도됩니까? –
네,이게 다예요! 당신이 더 자세히보고 싶으면 소스를 다운로드하려면 fre를 느껴보십시오. –