Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios ABPeoplePickerNavigationController在presentviewcontroller时崩溃_Ios - Fatal编程技术网

Ios ABPeoplePickerNavigationController在presentviewcontroller时崩溃

Ios ABPeoplePickerNavigationController在presentviewcontroller时崩溃,ios,Ios,有人帮我解决这个崩溃问题。我无法找到它的根本原因 ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; [self presentViewController:picker animated:YES completion:nil]; 我得到下面的碰撞,不知道为什么 -[ABPeoplePickerNavigationController master

有人帮我解决这个崩溃问题。我无法找到它的根本原因

ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
    [self presentViewController:picker animated:YES completion:nil];
我得到下面的碰撞,不知道为什么

-[ABPeoplePickerNavigationController masterViewController]: unrecognized selector sent to instance 0xdd8cd40

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ABPeoplePickerNavigationController masterViewController]: unrecognized selector sent to instance 0xdd8cd40'
*** First throw call stack:
(
    0   CoreFoundation                      0x03b5e5e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x031f28b6 objc_exception_throw + 44
    2   CoreFoundation                      0x03bfb903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation                      0x03b4e90b ___forwarding___ + 1019
    4   CoreFoundation                      0x03b4e4ee _CF_forwarding_prep_0 + 14
    5   UIKit                               0x0271f544 -[UISearchDisplayController _areSearchContentsSplitViewMaster] + 63
    6   UIKit                               0x0271f6ac -[UISearchDisplayController _configureNewSearchBar] + 307
    7   UIKit                               0x0271ee63 -[UISearchDisplayController initWithSearchBar:contentsController:searchResultsTableViewStyle:] + 121
    8   UIKit                               0x0271ede5 -[UISearchDisplayController initWithSearchBar:contentsController:] + 55
    9   AddressBookUI                       0x03dffe5e -[ABMembersController contentView] + 1223
    10  AddressBookUI                       0x03e05d3e -[ABMembersViewController updateView] + 57
    11  AddressBookUI                       0x03e058b0 -[ABMembersViewController loadView] + 36
    12  UIKit                               0x0249d73e -[UIViewController loadViewIfRequired] + 78
    13  UIKit                               0x024c31a5 -[UINavigationController _layoutViewController:] + 39
    14  UIKit                               0x024c36bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
    15  UIKit                               0x024c37b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
    16  UIKit                               0x024c472c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
    17  UIKit                               0x024c5349 -[UINavigationController __viewWillLayoutSubviews] + 57
    18  UIKit                               0x025fe39d -[UILayoutContainerView layoutSubviews] + 213
    19  UIKit                               0x024c1592 __53-[UINavigationController setNeedsDeferredTransition:]_block_invoke + 45
    20  UIKit                               0x023a6d33 ___afterCACommitHandler_block_invoke + 15
    21  UIKit                               0x023a6cde _applyBlockToCFArrayCopiedToStack + 403
    22  UIKit                               0x023a6b0a _afterCACommitHandler + 532
    23  CoreFoundation                      0x03b2653e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    24  CoreFoundation                      0x03b2648f __CFRunLoopDoObservers + 399
    25  CoreFoundation                      0x03b043b4 __CFRunLoopRun + 1076
    26  CoreFoundation                      0x03b03b33 CFRunLoopRunSpecific + 467
    27  CoreFoundation                      0x03b0394b CFRunLoopRunInMode + 123
    28  GraphicsServices                    0x04df39d7 GSEventRunModal + 192
    29  GraphicsServices                    0x04df37fe GSEventRun + 104
    30  UIKit                               0x0238a94b UIApplicationMain + 1225
    31  ShowRoomPrive                       0x0026dfd5 main + 181
    32  ShowRoomPrive                       0x00002ba5 start + 53
)
libc++abi.dylib: terminating with uncaught exception of type NSException

使用下面的代码,我认为您没有添加委托,这可能会对您有所帮助

ABPeoplePickerNavigationController *picker =

[[ABPeoplePickerNavigationController alloc] init];

picker.peoplePickerDelegate = self;

[self presentViewController:picker animated:YES completion:nil];
或者浏览一下这个url,它会给你一步一步的指导如何使用它 或者在苹果的文档中显示帮助信息