當我向這個按鈕添加很多按鈕時,UIAlertView有一個問題。然後alertView似乎被銷燬。這隻發生在iOS 7的先前版本上。在iOS 7和後續版本中似乎沒問題。這裏是我的問題的屏幕截圖。我可以修復它嗎?帶有很多按鈕的UIAlertView似乎被破壞iOS 6
- (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) {
[email protected]"Museum";
}
else if ([assistantGroup.thirdLevel intValue]==2) {
[email protected]"Art";
}
else if ([assistantGroup.thirdLevel intValue]==3) {
[email protected]"Religious";
}
else if ([assistantGroup.thirdLevel intValue]==4) {
[email protected]"Monument";
}
else if ([assistantGroup.thirdLevel intValue]==5) {
[email protected]"Natural";
}
else if ([assistantGroup.thirdLevel intValue]==6) {
[email protected]"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;
[email protected]"";
ann.type=self.chooseMarker;
[self.annotations addObject:ann];
}
//ann.type=assistantGroup.kind;
}
[self.mapView addAnnotations:self.annotations];
}
.....
}
您是否繼承UIAlertView?現在不允許。 – Ryan
@ trick14不,我不是繼承UIAlertView.It是最初的iOS 6 UIAlertView。 – hoya21
隨時發佈您的alertview代碼。 – Iphonenew