Be warned that I never do ARC, but casting rows parameter to (__bridge_retained void *) should help if I understand the document correctly.
Here is the code I use for testing.
static int myCallback(void* ptr, int i, char** p1, char** p2) {
NSMutableArray* array = (__bridge_transfer NSMutableArray*)ptr;
return 0;
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSMutableArray *rows = [[NSTestMutableArray alloc] init];
sqlite3_exec(NULL, "select distinct category from billy", &myCallback, (__bridge_retained CFMutableArrayRef)rows, NULL);
}
(__bridge_transfer ) is for transferring the ownership back so ARC will release it correctly. I override dealloc of my NSTestMutableArray to show that it is really deallocated, and it won't be deallocated if I comment the __bridge_transfer line.