我有BillPreviewController(页面滚动视图),其中包含许多帐单,BillViewController(tableView)
包含许多项目。这是我用于在页面scrollview中创建tableview的代码。
我不知道如何删除它!
-(void)configureBillViewControllers{
self.billViewControllerArray = [[NSMutableArray alloc] init];
for (Bill *aBill in self.billArray) {
BillViewController *abvc = [[BillViewController alloc] initWithBill:aBill];
abvc.onDidSelectRowCallBack = ^(UINavigationController *nav){
BillViewController *bvc = [self.billViewControllerArray objectAtIndex:pageControl.currentPage];
Bill *newBill = [bvc bill];
Item *anItem = [[newBill listOfOrderedItem] objectAtIndex:bvc.selectedItemIndex];
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:[anItem name] delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"Remove" otherButtonTitles:@"Edit", nil];
[actionSheet showFromToolbar:self.toolbar];
self.totalBillDollarLabel.text = [NSString stringWithFormat:@"%g", [newBill getTotalPrice]];
self.totalBillRielLabel.text = [NSString stringWithFormat:@"%.2f", [newBill getTotalPrice]*self.anExchange.rielBuyPerDollar];
};
abvc.delegate = self;
[self.billViewControllerArray addObject:abvc];
}
}
答案 0 :(得分:0)
试,
self.billViewControllerArray=nil;
在你要删除的地方使用它....