I have a list of deals in an NSMutableArray. I want to remove one of these deals in my redeem class. How do I do so? I use tableviewcells in a UITableViewController to display my deals using the count method.
How can I use the IBAction of the redeem button to remove a deal from the deal array?
Much help is needed this is very important, thanks.
// AppDealsTVC.m
#import "AppDealsTVC.h"
- (void)viewDidLoad {
[super viewDidLoad];
NSDictionary *dealOne = @{kDeal: @"25% off Club Sandwich",
kDiscount: @"now $5.25",
kDImage: @"Club_San_RA.jpg",
kDDescription: @"Get 25% off our flavorful Club Sandwich!",
};
NSDictionary *dealTwo = @{kDeal: @"Grilled Cheese",
kDiscount: @"FREE (read more)",
kDImage: @"grilled_cheese_RA.jpg",
kDDescription: @"Our flavorful Club Sandwich offers a variety of tastes combined into one gorgeous looking and great tasting sandwich!",
};
NSDictionary *dealThree = @{kDeal: @"Club Sandwich w fries/chips",
kDiscount: @"FREE (read more)",
kDImage: @"Club_San_RA.jpg",
kDDescription: @"Our flavorful Club Sandwich offers a variety of tastes combined into one gorgeous looking and great tasting sandwich!",
};
self.dealListArray = [NSMutableArray arrayWithObjects:
dealOne,
dealTwo,
dealThree,
nil];
}
// RedeemVC.m
#import "RedeemVC.h"
#import "AppDealsTVC.h"
- (IBAction)redeemButton:(id)sender {
// Remove deal from the self.dealListArray
}