There is an issue with an UIAlertView when i add to this a lot of buttons. Then the alertView seems to be destroyed. This happens only to prior version of iOS 7. On iOS 7 and posterior versions it seems ok.Here is a screenshot of my problem.Can i fix it?
- (void) sortTotalMnhmeia{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Ταξινόμηση" message:@"Επιλέξτε είδος ταξινόμησης" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Αξιοθέατα",@"Δραστηριότητες",@"Διαμονή",@"Χωριά",@"Προϊόντα",@"Όλες οι κατηγορίες",nil];
[alert show];
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
{
NSLog(@"Cancel Tapped.");
}
else if (buttonIndex == 1)
{
[self.mapView removeAnnotations:self.annotations];
[self.annotations removeAllObjects];
self.annotations=[[NSMutableArray alloc] init];
NSLog(@"yo %d",self.annotations.count);
for(int i=0; i<self.allGroups.count; i++){
Group *assistantGroup=assistantGroup=[self.allGroups objectAtIndex:i];
if ([assistantGroup.secondLevel intValue]==1) {
if ([assistantGroup.thirdLevel intValue]==1) {
self.chooseMarker=@"Museum";
}
else if ([assistantGroup.thirdLevel intValue]==2) {
self.chooseMarker=@"Art";
}
else if ([assistantGroup.thirdLevel intValue]==3) {
self.chooseMarker=@"Religious";
}
else if ([assistantGroup.thirdLevel intValue]==4) {
self.chooseMarker=@"Monument";
}
else if ([assistantGroup.thirdLevel intValue]==5) {
self.chooseMarker=@"Natural";
}
else if ([assistantGroup.thirdLevel intValue]==6) {
self.chooseMarker=@"Beach";
}
NSLog(@"************ %@ %@ %@",assistantGroup.title,assistantGroup.latitude,assistantGroup.longitude);
Annotation *ann = [[Annotation alloc] initWithLong:[assistantGroup.longitude doubleValue] Lat:[assistantGroup.latitude doubleValue] iconNumber:0];
ann.title = assistantGroup.title;
ann.subtitle=@"";
ann.type=self.chooseMarker;
[self.annotations addObject:ann];
}
//ann.type=assistantGroup.kind;
}
[self.mapView addAnnotations:self.annotations];
}
.....
}