繁体   English   中英

ABPersonViewController在iOS 7.0和更高版本中不支持子类化

[英]ABPersonViewController does not support subclassing in iOS 7.0 and later

is there any best way to listout Property of Contact in detail? like it is working in IOS 6.1 and earlier Version.


//
//  ABPersonViewController.h
//  AddressBookUI
//
//  Copyright (c) 2010 Apple Inc. All rights reserved.
//

#import <UIKit/UIViewController.h>
#import <AddressBook/AddressBook.h>

@interface ABPersonViewController : UIViewController <UIViewControllerRestoration>

// ABPersonViewController does not support subclassing in iOS 7.0 and later. A nil instance will be returned.

我找到了解决方案:请参阅

有一些不推荐使用的功能,但是我们可以通过替换“ ABContactsHelper”类中的以下功能来解决

+ (ABAddressBookRef) addressBook
{
#ifdef __IPHONE_6_0
    return ABAddressBookCreateWithOptions(NULL, NULL);
#else
    return ABAddressBookCreate();
#endif
}

在调用“ ABAddressBookCreate()”的地方使用它。 喜欢

ABAddressBookRef addressBook = [ABContactsHelper addressBook];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM