मैं UIAlertView को कैसे खारिज कर सकता हूं? यह कोड काम नहीं करता है।मैं UIAlertView को कैसे खारिज कर सकता हूं?
@property (nonatomic, retain) UIAlertView *activityAlertView;
- (void)viewDidLoad
{
self.activityAlertView = [[UIAlertView alloc] initWithTitle:@"Receiving data" message:@"\n\n"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil, nil];
[activityAlertView show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
}
-(void) myfunc
{
[self alertView:activityAlertView clickedButtonAtIndex:1];
}
Thnx Buddy ... :-) – Ayaz
यह रद्द करें बटन इंडेक्स का उपयोग करने के लिए शायद क्लीनर है: '[myAlertView dismissWithClickedButtonIndex: myAlertView.cancelButtonIndex एनिमेटेड: हाँ]; '। –
@ विन्सेंट टोर्रेन ओह, पुराना जवाब आप वहां खोद गए। यदि रद्द करें बटन इंडेक्स सही है तो आप जिस व्यवहार को चाहते हैं उस पर निर्भर करता है। अगर आप सिर्फ अलर्ट को खारिज करना चाहते हैं, तो '-1' जाने का रास्ता है। यदि आप रद्द केस के माध्यम से भागना पसंद करते हैं, तो रद्द करें बटन इंडेक्स सही है। – JustSid