当我添加很多按钮时,UIAlertView 存在问题。然后 alertView 似乎被破坏了。这只发生在 iOS 7 的早期版本上。在 iOS 7 和更高版本上似乎没问题。这是我的问题的屏幕截图。我可以修复它吗?
- (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];
}
.....
}