4
NSArrayのようなツリークラスをCFTreeにしたいと思っています。 (実際にはNSTreeは存在しないので、 'NSTree like tree'を作成しようとしています。)iphone - cftreeでツリークラスを作る
しかし、CFTreeは特定のタイプのクラスを要求しているようです。 NSArrayのようなさまざまなクラスで扱える汎用クラスを作りたいです。
ここはiPhone開発サイトの例です。
static CFTreeRef CreateMyTree(CFAllocatorRef allocator) {
MyTreeInfo *info;
CFTreeContext ctx;
info = CFAllocatorAllocate(allocator, sizeof(MyTreeInfo), 0);
info->address = 0;
info->symbol = NULL;
info->countCurrent = 0;
info->countTotal = 0;
ctx.version = 0;
ctx.info = info;
ctx.retain = AllocTreeInfo;
ctx.release = FreeTreeInfo;
ctx.copyDescription = NULL;
return CFTreeCreate(allocator, &ctx);
}
「MyTreeInfo」ではなく、一般的なクラスを使用したいと考えています。 方法はありますか?
ありがとうございました。