UISwitch *switchView = [[UISwitch alloc] initWithFrame:CGRectZero];
cell.accessoryView = switchView;
[switchView adTarget:selfaction:@selector(switchChanged:)forControlEvents:UIControlEventValueChanged];
[switchView release];
tableView : cellForRowAtIndexPath :에 스위치보기가 할당되었습니다. dealloc에서 cell.accessoryView를 릴리스해야합니까?accessoryView를 출시해야하나요?
위보다 좋지 않습니까?
cell.accessoryView = [[[UISwitch alloc] initWithFrame:CGRectZero]autorelease];
그래서 [cell.accessoryView 릴리스]와 같이 dealloc을 릴리스해야합니까? – user698200
아니요. 셀을 놓으면 자동으로 해제됩니다. – Akshay