2010-05-14 2 views
1

내 응용 프로그램에서 다음과 같은 오류를보고 있어요 :malloc_error_break에 중단 점을 설정하라는 메시지가 표시되는 이유는 무엇입니까?

(4446,0xa0bc94e0)의 malloc : *에 대한 오류 객체 0x1d153000 : 포인터 *이 디버그 malloc_error_break에 중단 점을 설정 할당되지 않은 해제되고

이 오류는 무엇을 의미합니까?

나는 테이블보기 2000 주소를 표시하려고하고 cellForRowAtIndexPath으로 다음 코드에서 해당 오류를보고하고이 원인이 될 수 무엇

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

    static NSString *CellIdentifier = @"Cell"; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) 
    { 
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 


    } 

    obdata = [AddressBookData alloc]; 
    obdata = [arrayLocalAddressbook objectAtIndex:indexPath.row]; 
    // Set button Tag 

    cell.textLabel.text = [NSString stringWithString:obdata.lastname]; 

    return cell; 



} 

// Customize the number of sections in the table view. 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 
    //return [indexArray count]; 
    return 1; 

} 



// Customize the number of rows in the table view. 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{ 

    return [arrayLocalAddressbook count]; 

} 

?

+0

http://stackoverflow.com/questions/7796921/malloc-error-break-breakpoint-not-working – paulmelnikow

+0

사파리 검사 삭제 http://stackoverflow.com/a/43885754/6521116 –

답변

1

응용 프로그램이 진행 방법에 대한 힌트를 제공합니다. 중단 점을 malloc_error_break에 설정하십시오. 거기에 도착하면 응용 프로그램의 백 트레이스를 검사하십시오. 여러분은 아마도 여러분이 물건을 과도하게 풀거나 부실한 포인터를 붙잡고있는 것을 발견 할 것입니다.

0

두 홀수 일 :이 개체의 초기화를 호출하지 않는

obdata = [AddressBookData alloc]; 

- OBJ-C에서 당신은 일반적으로 함께 ALLOC이-init를 가지고있다.

obdata = [arrayLocalAddressbook objectAtIndex:indexPath.row]; 

그러면이 변수에 다른 값을 즉시 할당하므로 첫 번째 AddressBookData는 사용되지 않습니다.

관련 문제