मैं एक्सकोड 4.3 में एक दृश्य बना रहा हूं और मुझे यह सुनिश्चित नहीं है कि एकाधिक UIAlertView के निर्दिष्ट कैसे करें जिनके अलग-अलग कार्यों के साथ अपने स्वयं के बटन हैं। वर्तमान में, मेरे अलर्ट के अपने बटन हैं, लेकिन एक ही क्रियाएं हैं। नीचे मेरा कोड है।एकाधिक UIAlertView; प्रत्येक अपने बटन और क्रियाओं के साथ
-(IBAction)altdev {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"titleGoesHere"
message:@"messageGoesHere"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Continue", nil];
[alert show];
}
-(IBAction)donate {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"titleGoesHere"
message:@"messageGoesHere"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Continue", nil];
[alert show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.examplesite1.com"]];
}
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"examplesite2.com"]];
}
}
किसी भी मदद के लिए धन्यवाद!
मैं अभी भी वास्तव में समझ में नहीं आता मैं यह कैसे शामिल करते हैं। जब मैं इसे रखने का प्रयास करता हूं, तो मुझे अव्यवस्थित पहचानकर्ता त्रुटियों का उपयोग करना जारी रहता है इससे कोई फर्क नहीं पड़ता कि मैं क्या करता हूं। यदि आप मेरे द्वारा दिखाए गए कोड और आपके संपादन के साथ उत्तर देंगे तो मैं इसकी सराहना करता हूं। धन्यवाद – DiscoveryOV
आपके अनुरोध के लिए अपडेट किया गया। – cxa
बहुत बढ़िया धन्यवाद, महान काम करता है। मुझे यकीन है कि आप बता सकते हैं कि मैं अभी तक इसके साथ आश्चर्यजनक अनुभव नहीं कर रहा हूं, और यह बहुत अच्छा है कि आपके जैसे लोग आपकी मदद करने के लिए हैं। – DiscoveryOV