> -(NSDictionary *)fetch { > NSMutableDictionary *output = nil; > if (db != nil && sth != nil) { > int c = sqlite3_column_count(sth); > if (fields == nil) { > fields = [[NSMutableArray alloc] init]; > for (int i = 0; i < c; ++i) { > const char *name = sqlite3_column_name(sth, i); > [fields addObject:[NSString > stringWithUTF8String:name]]; > } > } > if (sqlite3_step(sth) == SQLITE_ROW) { > output = [[[NSMutableDictionary alloc] init] > autorelease]; > for (int i = 0; i < c; ++i) { > const unsigned char *val = > sqlite3_column_text(sth, i); > NSString *value; > if (val == nil) { > value = @"{NULL}"; > } > else { > value = [NSString > stringWithUTF8String:(char *)val]; > } > [output setObject:value forKey:[fields > objectAtIndex:i]]; > } > } > } > return output; > }
However, can anyone answer how I best go about either of the tasks that I have outlined as red, as they are leaking a lot of memory in comparison?_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com