I have a code like below.
Ticket *ticket1 = [[Ticket alloc] initWithName:@"INC1234" group:@"PIMS-EU-COG" type:@"Incident" status:@"Active" createdOn:@"20-Oct-2013" createdBy:@"Dinesh" completionDate:@"23-Oct-2013" notes:@"1. All works coreectly 2. New variables are created.."];
Ticket *ticket2 = [[Ticket alloc] initWithName:@"PRJ2342" group:@"PIMS-EU-COG" type:@"Project" status:@"Closed" createdOn:@"20-Oct-2013" createdBy:@"Dinesh" completionDate:@"23-Oct-2013" notes:@"1. All works coreectly 2. New variables are created.."];
Ticket *ticket3 = [[Ticket alloc] initWithName:@"ENC1234" group:@"PIMS-EU-COG" type:@"Enhancement" status:@"Awaiting vendor" createdOn:@"20-Oct-2013" createdBy:@"Dinesh" completionDate:@"23-Oct-2013" notes:@"1. All works coreectly 2. New variables are created.."];
Ticket *ticket4 = [[Ticket alloc] initWithName:@"INC2345" group:@"CRM-EU-COG" type:@"Incident" status:@"Active" createdOn:@"20-Oct-2013" createdBy:@"Alex" completionDate:@"23-Oct-2013" notes:@"1. All works coreectly 2. New variables are created.."];
Ticket *ticket5 = [[Ticket alloc] initWithName:@"PRJ2345" group:@"CRM-EU-COG" type:@"Project" status:@"Pending" createdOn:@"20-Oct-2013" createdBy:@"Alex" completionDate:@"23-Oct-2013" notes:@"1. All works coreectly 2. New variables are created.."];
Ticket *ticket6 = [[Ticket alloc] initWithName:@"ENC2345"group:@"CRM-EU-COG" type:@"Enhancement" status:@"Active" createdOn:@"20-Oct-2013" createdBy:@"Alex" completionDate:@"23-Oct-2013" notes:@"1. All works coreectly 2. New variables are created.."];
self.TicketsFinal= [NSMutableArray arrayWithObjects:ticket1,ticket2,ticket3, nil];
/*
if (groupFinal == @"PIMS-EU-COG") {
self.TicketsFinal= [NSMutableArray arrayWithObjects:ticket1,ticket2,ticket3, nil];
}else if (groupFinal == @"CRM-EU-COG")
{
self.TicketsFinal= [NSMutableArray arrayWithObjects:ticket4,ticket5,ticket6,ticket7,ticket8,ticket9, nil];
}*/
I have 3 parameters:
- GroupFinal
- TypeFinal
- StatusFinal.
groupsFinal will hold the group (ex:PIMS-EU-COG) details. typeFinal will hold what type of ticket (ex: Incident) and statusFinal will hold status of the ticket (ex: Active). These 3 parameters are obtained from previous view.
I have a array called as self.ticketsFinal which should hold tickets based on selected criteria alone. I tried hardcoding the group (last commented part) and navigating, which is not the correct way.
Ex: When groupFinal, TypeFinal, statusFinal have values as PIMS-EU-COG, Incident, Active, then in this case the self.TiketsFinal should hold only Ticket1 (which meets the criteria).
When an All is selected in typeFinal and statusFinal all the tickets in the group should be updated in array.
Can anyone please help. You help is much appreciated.