iOS通讯录选择器

时间:2016-09-27 18:41:48

标签: ios objective-c mobile contacts-framework

所以我正在做Sinch的教程!关于如何获取和呼叫联系人, 好吧它加载联系人就好了。 问题是每当我选择要调用的联系人时,应用程序崩溃,Xcode在控制台上显示此错误。 任何人都可以帮我吗?

    inchAppToPhoneTutorial[1143:42160] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Parameter 'applicationKey' is invalid (was '')'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010a70634b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010a08821e objc_exception_throw + 48
    2   SinchAppToPhoneTutorial             0x0000000108cca77b SINCallOrderByStartTimeComparator + 66724
    3   SinchAppToPhoneTutorial             0x0000000108cb1c6b _ZN6rebrtc13OfflineInvite6encodeERKS0_PhmPm + 4418449
    4   SinchAppToPhoneTutorial             0x0000000108cc4d45 SINCallOrderByStartTimeComparator + 43630
    5   SinchAppToPhoneTutorial             0x0000000108cc496c SINCallOrderByStartTimeComparator + 42645
    6   SinchAppToPhoneTutorial             0x00000001088268e9 -[DetailViewController initSinchClient] + 89
    7   SinchAppToPhoneTutorial             0x0000000108825e8a -[DetailViewController viewDidLoad] + 234
    8   UIKit                               0x000000010accb06d -[UIViewController loadViewIfRequired] + 1258
    9   UIKit                               0x000000010acd14d6 -[UIViewController __viewWillAppear:] + 118
    10  UIKit                               0x000000010acfc393 -[UINavigationController _startCustomTransition:] + 1290
    11  UIKit                               0x000000010ad0d008 -[UINavigationController _startDeferredTransitionIfNeeded:] + 697
    12  UIKit                               0x000000010ad0e19b -[UINavigationController __viewWillLayoutSubviews] + 58
    13  UIKit                               0x000000010af051b7 -[UILayoutContainerView layoutSubviews] + 223
    14  UIKit                               0x000000010abee344 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
    15  QuartzCore                          0x000000010e03bcdc -[CALayer layoutSublayers] + 146
    16  QuartzCore                          0x000000010e02f7a0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
    17  QuartzCore                          0x000000010e02f61e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
    18  QuartzCore                          0x000000010dfbd62c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
    19  QuartzCore                          0x000000010dfea713 _ZN2CA11Transaction6commitEv + 475
    20  UIKit                               0x000000010ab54878 _afterCACommitHandler + 346
    21  CoreFoundation                      0x000000010a6aae17 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    22  CoreFoundation                      0x000000010a6aad87 __CFRunLoopDoObservers + 391
    23  CoreFoundation                      0x000000010a68fb9e __CFRunLoopRun + 1198
    24  CoreFoundation                      0x000000010a68f494 CFRunLoopRunSpecific + 420
    25  GraphicsServices                    0x000000010e959a6f GSEventRunModal + 161
    26  UIKit                               0x000000010ab29f34 UIApplicationMain + 159
    27  SinchAppToPhoneTutorial             0x00000001088257bf main + 111
    28  libdyld.dylib                       0x000000010c4fe68d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

1 个答案:

答案 0 :(得分:0)

它说明最顶端发生了什么

inchAppToPhoneTutorial[1143:42160] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Parameter 'applicationKey' is invalid (was '')'

因此,弄清楚你在哪里调用利用applicationKey的内容并找出原因为空白:)