下面 self.listOfCustDetail 和 self.listOfCustomer 存在内存泄漏
-(void) calCustList {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *plistPath = [NSString stringWithFormat:@"%@/%@", documentsDirectory,@"customer.plist"];
self.listOfCustDetail = [[[NSMutableArray alloc] init] autorelease];
self.listOfCustomer = [[[NSMutableArray alloc] init] autorelease];
self.customers = [[[NSMutableDictionary alloc] initWithContentsOfFile:plistPath] autorelease];
[self.listOfCustomer removeAllObjects];
[self.listOfCustDetail removeAllObjects];
[self.listOfCustomer addObject:@"新紀錄"];
[self.listOfCustDetail addObject:@""];
for (id key in self.customers) {
NSString *s = [NSString stringWithFormat:@"%@,%@,%@,%@", [[self.customers objectForKey:key] objectAtIndex:0], [[self.customers objectForKey:key] objectAtIndex:1], [[self.customers objectForKey:key] objectAtIndex:2], [[self.customers objectForKey:key] objectAtIndex:3]];
[self.listOfCustomer addObject:key];
[self.listOfCustDetail addObject:s];
}
}