0

我有 BillPreviewController(页面滚动视图),其中包含许多账单,并且BillViewController(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];       

}
}
4

1 回答 1

0

尝试,

 self.billViewControllerArray=nil;

在要删除的地方使用它....

于 2012-08-31T12:57:52.120 回答