사용자가 Canada 단추를 누르면 캐나다 (앨버타, 브리티시 컬럼비아 ...)의 주를 표시하도록 popover tableview 코드를 다시 사용하려고합니다. 사용자가 USA 버튼을 터치하면 USA (Alabama, Alaska, ...)의 상태가 표시됩니다. 문제는 캐나다 버튼 13 개 주/테리토리에서 미국의 처음 12 개 주를 표시하지 않은 후에 미국 버튼을 눌렀을 때입니다.동적 배열 데이터 Popover tableview
여기 코드
http://www.raywenderlich.com/1056/ipad-for-iphone-developers-101-uipopovercontroller-tutorial
다음하지만 난 다른 배열의 fomatting 죄송
- (IBAction)setColorButtonTapped:(id)sender withData:(NSArray *) data {
if (_colorPicker == nil) {
self.colorPicker = [[[ColorPickerController alloc]
initWithStyle:UITableViewStylePlain] autorelease];
_colorPicker.delegate = self;
self.colorPickerPopover = [[[UIPopoverController alloc]
initWithContentViewController:_colorPicker] autorelease];
}
[self.colorPickerPopover presentPopoverFromBarButtonItem:sender
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
_colorPicker.tableList = [data copy];
// I defined a property NSMutableArray *tableList
// I think the problem is with the way I copy the data }
의 코드를 재사용 할 수 있도록 배열을 취하도록 setColorButtonTapped 코드를 수정하고 암호.
미리 도움을 주셔서 감사합니다.
조