{ cdbfapi *dbf = [cdbfapi new]; if ([dbf openDBFFile:@"./example.dbf"]) { // your code [dbf closeDBFFile]; } dbf = nil; }