I want to create a basic CFTree with some string info in Objective-C.
This is my code
//CFtree attempt
NSString *info;
CFTreeContext ctx;
NSString *treeString = [[NSString alloc] initWithFormat:@"the tree string"];
info = treeString;
ctx.info = info;
CFTreeRef myTree = CFTreeCreate(NULL, &ctx);
I get an “EXC_BAD_ACESS” error on the last line.
Can someone please tell me how to configure this properly.
It seems that ctx should be initialized.