2010-01-14 4 views
0

를 입력하지,이 코드는 빠른 열거 루프를 무시하고 맹목적으로 끝까지 뛰어 것으로 확인되었습니다 :응용 프로그램이 많은 디버깅 후 빠른 열거 루프

콘솔 인쇄 "를 입력 주석 열거 루프"
-(void)loadOutAnnotations 
{ 
    NSLog(@"entering Annotation enumeration Loop"); 

    iProspectFresno_LiteAppDelegate *appDelegate =(iProspectFresno_LiteAppDelegate *)[[UIApplication sharedApplication] delegate]; 

    FlipsideViewController *viewController = (FlipsideViewController *)[[UIApplication sharedApplication] delegate]; 

    CLLocationCoordinate2D workingCoordinate; 
    NSLog(@"initializing"); 
    NSMutableArray* mines = [[NSMutableArray alloc] initWithArray(NSMutableArray *)appDelegate.mines]; 
    for (id mine in mines) 
    { 
     NSLog(@"in the loop"); 
     //rest of loop code 
    } 
} 

뿐만 아니라 "초기화 중"으로 표시되지만 열거 루프를 완전히 무시하는 것처럼 보입니다. "루프 안에"인쇄되지 않기 때문입니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

+0

appDelegates.mines는 어떤 유형입니까? –

+0

그것의 NSMutableArray –

+0

이것은 조금 벗어난 주제이지만 배열을 유지하기 위해 델리게이트를 사용해서는 안됩니다. 또한,'initWithArray' 다음에 콜론을 잊었다. –

답변

1

정말 appDelegate.mines이 비어 있지 않습니까?

+0

네, 그럴 것 같습니다. 내 데이터베이스 초기화 코드가 포함되어 있습니다 : NSLog (@ "첫 번째 if 문") if (sqlite3_prepare_v2 (database, sqlStatement, -1, & compileStatement, NULL) == SQLITE_OK) { NSLog (@ "두 번째 if 문 초기화"); } "초기화 된 두 번째 if 문"이 콘솔에 나타나지 않는 것 같습니다. –

+1

핵심 데이터를 사용하지 않는 이유는 무엇입니까? 3.0 이전의 장치를 지원해야합니까? –

+0

ID 그림이 응용 프로그램을 실행 한 후에 핵심 데이터를 배울 것입니다. 일종의 개념 증명; 예, 3.0 이전 기기를 지원하고 싶습니다. –

관련 문제