我正在iOS
使用在应用程序中创建树CFTree
。我收到错误“使用未声明的标识符' CFTree
'”。我错过了什么?我的代码:
#import "ViewController.h"
#import <CoreFoundation/CoreFoundation.h>
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
CFTree tree = CreateMyTree(kCFAllocatorDefault);
}
static CFTreeRef CreateMyTree(CFAllocatorRef allocator) {
NSString *info = @"Bhushan is great";
CFTreeContext ctx;
ctx.version = 0;
ctx.info = (__bridge void *)(info);
ctx.retain = CFRetain;
ctx.release = CFRelease;
ctx.copyDescription = NULL;
return CFTreeCreate(allocator, &ctx);
}