2013-08-17 2 views
2

나는 스택 오버플로의 새로운 해요. 나는 사과에 앱을 보내는 큰 문제가있다. 내 애플 리케이션을 내 iPhone 5 또는 시뮬레이터에 테스트 할 때 모든 것이 정상이지만 사과가 2 회용 앱에 대해 거부하면 내 앱이 충돌하여 스플래시 화면이 다운되고 충돌 로그가 표시된다고했다. 하지만 온라인 튜토리얼을 읽었는데 크래시 로그에서 문제를 읽고 어떻게 읽는지 이해할 수 없습니다. 그 점에 대해 도와 주시겠습니까? 애플 리케이션 크래시 다음 사과 시작

내 응용 프로그램에 대한 사과 충돌 로그입니다 :

Exception Type: EXC_BAD_ACCESS (SIGSEGV) 
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000 
Crashed Thread: 0 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 CoreFoundation     0x316a1574 CFArrayGetValueAtIndex + 96 
1 CWay       0x000a065e 0x9c000 + 18014 
2 CWay       0x0009f3d6 0x9c000 + 13270 
3 UIKit       0x33589590 -[UIViewController loadViewIfRequired] + 360 
4 UIKit       0x335de146 -[UIViewController contentScrollView] + 22 
5 UIKit       0x335de08c -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 24 
6 UIKit       0x335ddf70 -[UINavigationController _layoutViewController:] + 28 
7 UIKit       0x335dde94 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 268 
8 UIKit       0x335dd5d4 -[UINavigationController _startTransition:fromViewController:toViewController:] + 60 
9 UIKit       0x335dd4bc -[UINavigationController _startDeferredTransitionIfNeeded:] + 320 
10 UIKit       0x335ae4e4 -[UILayoutContainerView layoutSubviews] + 176 
11 UIKit       0x3356d7fe -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 254 
12 QuartzCore      0x33317d86 -[CALayer layoutSublayers] + 210 
13 QuartzCore      0x33317924 CA::Layer::layout_if_needed(CA::Transaction*) + 456 
14 QuartzCore      0x333467ca -[CALayer layoutIfNeeded] + 138 
15 UIKit       0x336170e4 -[UIViewController window:setupWithInterfaceOrientation:] + 204 
16 UIKit       0x336162d0 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3616 
17 UIKit       0x336154a2 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 42 
18 UIKit       0x3361542c -[UIWindow _setRotatableViewOrientation:duration:force:] + 64 
19 UIKit       0x3374b304 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 100 
20 UIKit       0x335d368e -[UIWindow _updateToInterfaceOrientation:duration:force:] + 214 
21 UIKit       0x335d33d0 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 688 
22 UIKit       0x335d2d36 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 154 
23 UIKit       0x335c9ea6 -[UIWindow addRootViewControllerViewIfPossible] + 366 
24 UIKit       0x335c5ae8 -[UIWindow _setHidden:forced:] + 360 
25 UIKit       0x336071e4 -[UIWindow makeKeyAndVisible] + 56 
26 UIKit       0x335ca83a -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1662 
27 UIKit       0x335c2846 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694 
28 UIKit       0x3356ac34 -[UIApplication handleEvent:withNewEvent:] + 1000 
29 UIKit       0x3356a6c8 -[UIApplication sendEvent:] + 68 
30 UIKit       0x3356a116 _UIApplicationHandleEvent + 6150 
31 GraphicsServices    0x3525e5a0 _PurpleEventCallback + 588 
32 GraphicsServices    0x3525e1ce PurpleEventCallback + 30 
33 CoreFoundation     0x31737170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32 
34 CoreFoundation     0x31737112 __CFRunLoopDoSource1 + 134 
35 CoreFoundation     0x31735f94 __CFRunLoopRun + 1380 
36 CoreFoundation     0x316a8eb8 CFRunLoopRunSpecific + 352 
37 CoreFoundation     0x316a8d44 CFRunLoopRunInMode + 100 
38 UIKit       0x335c1480 -[UIApplication _run] + 664 
39 UIKit       0x335be2fc UIApplicationMain + 1116 
40 CWay       0x0009dfb2 0x9c000 + 8114 
41 libdyld.dylib     0x39a3db1c start + 0 

Thread 1 name: Dispatch queue: com.apple.backboardservices.processassertion 
Thread 1: 
0 libsystem_kernel.dylib   0x39af4648 kevent64 + 24 
1 libdispatch.dylib    0x39a24586 _dispatch_update_kq + 154 
2 libdispatch.dylib    0x39a244e4 _dispatch_mgr_wakeup$VARIANT$mp + 40 
3 libdispatch.dylib    0x39a21ca0 _dispatch_wakeup$VARIANT$mp + 20 
4 libdispatch.dylib    0x39a21c3c _dispatch_queue_push_list_slow2 + 16 
5 libdispatch.dylib    0x39a21e8e _dispatch_queue_drain$VARIANT$mp + 78 
6 libdispatch.dylib    0x39a21dbc _dispatch_queue_invoke$VARIANT$mp + 36 
7 libdispatch.dylib    0x39a2291a _dispatch_root_queue_drain + 182 
8 libdispatch.dylib    0x39a22abc _dispatch_worker_thread2 + 80 
9 libsystem_c.dylib    0x39a52a0e _pthread_wqthread + 358 
10 libsystem_c.dylib    0x39a528a0 start_wqthread + 4 

Thread 2 name: Dispatch queue: com.apple.libdispatch-manager 
Thread 2: 
0 libsystem_kernel.dylib   0x39af4648 kevent64 + 24 
1 libdispatch.dylib    0x39a24974 _dispatch_mgr_invoke + 792 
2 libdispatch.dylib    0x39a24654 _dispatch_mgr_thread$VARIANT$mp + 32 

Thread 3: 
0 libsystem_kernel.dylib   0x39b04d98 __workq_kernreturn + 8 
1 libsystem_c.dylib    0x39a52cf6 _pthread_workq_return + 14 
2 libsystem_c.dylib    0x39a52a12 _pthread_wqthread + 362 
3 libsystem_c.dylib    0x39a528a0 start_wqthread + 4 

Thread 4 name: WebThread 
Thread 4: 
0 libsystem_kernel.dylib   0x39af3eb4 mach_msg_trap + 20 
1 libsystem_kernel.dylib   0x39af4048 mach_msg + 36 
2 CoreFoundation     0x31737040 __CFRunLoopServiceMachPort + 124 
3 CoreFoundation     0x31735d9e __CFRunLoopRun + 878 
4 CoreFoundation     0x316a8eb8 CFRunLoopRunSpecific + 352 
5 CoreFoundation     0x316a8d44 CFRunLoopRunInMode + 100 
6 WebCore       0x37698500 RunWebThread(void*) + 440 
7 libsystem_c.dylib    0x39a5d30e _pthread_start + 306 
8 libsystem_c.dylib    0x39a5d1d4 thread_start + 4 

Thread 5 name: com.apple.coremedia.player.async 
Thread 5: 
0 libsystem_kernel.dylib   0x39b0408c __psynch_cvwait + 24 
1 libsystem_c.dylib    0x39a55d2a _pthread_cond_wait + 642 
2 libsystem_c.dylib    0x39a5ff14 pthread_cond_wait + 36 
3 CoreMedia      0x31c8e8ac FigSemaphoreWaitRelative + 256 
4 MediaToolbox     0x32780e56 fpa_AsyncMovieControlThread + 22 
5 CoreMedia      0x31cac890 figThreadMain + 192 
6 libsystem_c.dylib    0x39a5d30e _pthread_start + 306 
7 libsystem_c.dylib    0x39a5d1d4 thread_start + 4 

Thread 6: 
0 libsystem_kernel.dylib   0x39b04d98 __workq_kernreturn + 8 
1 libsystem_c.dylib    0x39a52cf6 _pthread_workq_return + 14 
2 libsystem_c.dylib    0x39a52a12 _pthread_wqthread + 362 
3 libsystem_c.dylib    0x39a528a0 start_wqthread + 4 

Thread 0 crashed with ARM Thread State (32-bit): 
    r0: 0x00000000 r1: 0x00000086  r2: 0x00000002  r3: 0x00000013 
    r4: 0x20858240 r5: 0x2fd61e84  r6: 0x00000004  r7: 0x2fd61f2c 
    r8: 0x00000000 r9: 0x00000000  r10: 0x1fd5f1c0  r11: 0x1fd6f3c0 
    ip: 0x316a1515 sp: 0x2fd61dc0  lr: 0x000a0663  pc: 0x316a1574 
    cpsr: 0x60000030 
위임에 내 애플 내가 그것을 만지지 마세요 아무것도하지

, 때이 주소록에서 바로 연락처를 얻을 내 응용 프로그램을 시작합니다 만약 당신이 몇 가지 코드가 필요 말해줘.

더 코드 :이 코드의 이전

if (accessGranted) { 




     CFArrayRef sources = (__bridge CFArrayRef)(CFBridgingRelease(ABAddressBookCopyArrayOfAllSources(_addressBook))); 

     ABRecordRef source = (__bridge ABRecordRef)(CFBridgingRelease(CFArrayGetValueAtIndex(sources, 0))); 

     CFIndex longezza = ABAddressBookGetPersonCount(_addressBook); 
     NSLog(@"%ld", longezza); 



     CFArrayRef people = (__bridge CFArrayRef)(CFBridgingRelease(ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(_addressBook, source, kABPersonSortByFirstName))); 

     // len = count all contacts 
     int len = CFArrayGetCount(people); 

     NSLog(@"%d", len); 

     for (CFIndex i = 0 ; i <= (len - 1) ; i++) { 

      [contactArray removeAllObjects]; 

      //Get contact's record from _addressBook 

      ABRecordRef recordContact = CFArrayGetValueAtIndex(people, i); 

      //Get the first name 

      NSString *firstName = CFBridgingRelease((ABRecordCopyValue(recordContact, kABPersonFirstNameProperty))); 


      //Get the last name 
      NSString *lastName = CFBridgingRelease((ABRecordCopyValue(recordContact, kABPersonLastNameProperty))); 



      //Create the full name 

      NSMutableString *fullName = [[NSMutableString alloc] initWithString:@""]; 

      if (firstName) [fullName appendFormat:@"%@ ",firstName]; 
      if (lastName) [fullName appendFormat:@"%@",lastName]; 


      if (![fullName isEqualToString:@""]) { 
       //Add full name into the ContactsArray 

       [contactArray addObject:fullName]; 


       /////Start The Algoritmo for order the phone's number in the array///// 

       //Get array with all Phone number's contact 

       ABMultiValueRef NumberPhones = ABRecordCopyValue(recordContact, kABPersonPhoneProperty); 


       //If the NumberPhones contain something start the cicle for get the number 

       if (ABMultiValueGetCount(NumberPhones)) 
       { 

        //Start the cicle for get the number and the label 

        for (CFIndex x = 0; x < ABMultiValueGetCount(NumberPhones); x++) 
        { 

         //Create array with labels types and names 

         NSArray *labelsTypes = [[NSArray alloc] initWithObjects:@"_$!<Mobile>!$_", @"_$!<Home>!$_", @"iPhone",@"", @"_$!<Work>!$_", @"_$!<Main>!$_", @"_$!<Other>!$_", nil]; 

         NSArray *labelsNames = [[NSArray alloc] initWithObjects:@"Mobile", @"Home", @"iPhone",@"", @"Work", @"Main", @"Other", nil]; 


         //Get the label from NumberPhones 

         NSString *label = (__bridge NSString *)(ABMultiValueCopyLabelAtIndex(NumberPhones, x)); 


         //start the cicle for find the label type 

         for (int y = 0; y < 7; y++) 
         { 

          //if the label type is the same get the info and punt in array 

          if ([label isEqual:[labelsTypes objectAtIndex:y]]) 
          { 

           //Get the Number 

           NSString *number = (__bridge NSString *)(ABMultiValueCopyValueAtIndex(NumberPhones, x)); 

           //Create Dictionary with label = value, object = value 

           NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[labelsNames objectAtIndex:y], @"label", number, @"object", nil]; 

           //Add dictionary into the ContactArray 

           [contactArray addObject:dic]; 

          } //end if 
         } //end for 
        } //end for 
       } //end if 


       //Release NnumberPhones 

       CFRelease(NumberPhones); 


       /////Finish the algoritmo for get the number///// 

       /////Start the algoritmo for get the Email///// 


       //Get array with all email's contact 

       ABMultiValueRef emails = ABRecordCopyValue(recordContact, kABPersonEmailProperty); 


       //If the NumberPhones contain something start the cicle for get the email 

       if (ABMultiValueGetCount(emails)) 
       { 

        //Start the cicle for get the email 

        for (CFIndex x = 0; x < ABMultiValueGetCount(emails); x++) 
        { 

         NSString *email = (__bridge NSString *)(ABMultiValueCopyValueAtIndex(emails, x)); 

         //Create Dictionary with label = value, object = value 

         NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:@"Email", @"label", email, @"object", nil]; 

         //Add dictionary into the ContactArray 


         [contactArray addObject:dic]; 
         CFRelease((__bridge CFTypeRef)(email)); 

        } //end for 
       } //end if 


       //Release emails 

       CFRelease(emails); 

       /////Finish the algoritmo for get the Email///// 

       /////Start the algoritmo for get the social network////// 


       //Get array with all social's contact 

       ABMultiValueRef socials = ABRecordCopyValue(recordContact, kABPersonSocialProfileProperty); 


       //If the NumberPhones contain something start the cicle for get the social network 

       if (ABMultiValueGetCount(socials)) 
       { 

        //Start the cicle for get the social network 

        for (CFIndex x = 0; x < ABMultiValueGetCount(socials); x++) 
        { 

         //Get the dictionare with each social network info 

         NSDictionary *social = (__bridge NSDictionary *)(ABMultiValueCopyValueAtIndex(socials, x)); 


         //If the social network is facebook get the info and put into the array 

         /*if ([social[@"service"] isEqual:@"facebook"]) 
         { 
          NSString *facebook = social[@"username"]; 

          //Create Dictionary with label = value, object = value 

          NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:@"Facebook", @"label", facebook, @"object", nil]; 


          //Add dictionary into the ContactArray 

          [contactArray addObject:dic]; 

         } //Else if the social network is Twitter get the info and put into the array 
         else */ if ([social[@"service"] isEqual:@"twitter"]) 
         { 
          NSString *twitter = social[@"username"]; 

          //Create Dictionary with label = value, object = value 

          NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:@"Twitter", @"label", twitter, @"object", nil]; 


          //Add dictionary into the ContactArray 

          [contactArray addObject:dic]; 




         }// end if 
         CFRelease((__bridge CFTypeRef)(social)); 
        } //end for 
       } //end if 


       //release Social 

       CFRelease(socials); 


       /////Finish the algoritmo for get the social network////// 


      } //end if controll full name = @"" 


    if (contactArray.count) { 
     [contactsArray addObject:[contactArray copy]]; 
    } 

     } //end for 


    } //end if 

    return [contactsArray copy]; 

나는 책을 해결하기 위해 액세스 할 수 있습니다 단지 있는지 확인하세요. 애플은 나에게 무엇

: 스레드 0 로그의 바닥에서 읽기 최대

2.1 

We found that your app crashed on iPad running iOS 6.1.3 and iPhone 5 running iOS 6.1.4, which is not in compliance with the App Store Review Guidelines. 

Your app crashed when we launched it. 

This occurred when your app was used: 

- On Wi-Fi 
- On cellular network 

We have attached detailed crash logs to help troubleshoot this issue. For information on how to symbolicate and read a crash log, please see Tech Note TN2151 Understanding and Analyzing iPhone OS Application Crash Reports. 

If you have difficulty reproducing this issue, please try testing the workflow as described in Testing Workflow with Xcode's Archive feature. 

For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. Please be sure to prepare any symbolicated crash logs, screenshots, or steps to reproduce the issues for when the DTS engineer follows up. 

감사

미르코

답변

2

. 앱을 통해 메소드 호출의 흐름을 볼 수 있습니다. 밑줄이 _ 인 것은 Apple의 개인 API 호출입니다. 공개 전화는 창 (AppDelegate)을로드 한 다음 UIViewController (일종의 스크롤보기)을 구성하는 것입니다.

코드가 CFArrayGetValueAtIndex에 충돌합니다. 대부분의 경우 뷰 컨트롤러가 생성 될 때 배열의 끝에서부터 인덱싱을하고있을 것입니다.

앱을 시작할 때 생성되는 루트보기 컨트롤러의 코드를 게시 할 수 있습니까?

+0

수정하여 코드를 추가하십시오 –

+0

표시 할 코드는 어디에서 전화가 왔습니까? 'viewDidLoad'? – stevekohls

+0

예,이 코드는 "Brain"클래스의 메서드이며,이 메서드는 내 accountsController (로드 된 첫 번째 컨트롤러)의 viewDidLoad에서 호출합니다. –