जब मैं अपने UIToolBar पर एक किया गया बटन क्लिक किया जाता है तो मैं "TableViewController" के .nib को लाना चाहता हूं। लेकिन नीचे क्लिक को एक नया दृश्य लाने की इजाजत नहीं है। मैं इसे कैसे सुधार सकता हूं? कृपया मुझे दिखाएं कि मैं गलत कहां गया और क्या बदला जाना चाहिए और क्यों।barbuttonitem कार्रवाई कैसे करें?
//Here's the selector in my overlay.
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:
UIBarButtonSystemItemDone target:self action:@selector(doneButtonPressed)];
//Here's how I made my action. Btw, the uitoolbar has no nib, it's an overlay on the
//(camera mode).
-(void)doneButtonPressed {
TableViewController *tableView = [[TableViewController alloc]
initWithNibName:@"TableViewController" bundle:nil];
tableView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:tableView animated:YES];
}
//Yet nothing happens when I click on my done button on my overlay. And I've made sure
// i've imported .h frameworks correctly too.
मान लीजिए आप एक barbuttonitem जो एक UItoolbar ओवरले पर है से एक निब को लाने के लिए थे। आपको इसे कैसे करना होगा?
मुझे बताया गया था कि इसे ठीक से काम करने के लिए मुझे [barButtonItem addTarget: self action: @selector (doneButtonPressed) के लिए जोड़ना होगा: नियंत्रण नियंत्रण: UIControlEventTouchUpInside]; । नहीं मिला (करने के लिए 'वापसी प्रकार चूक -': लक्ष्य: कार्रवाई: forControlEvents initWithBarButtonSystemItem '
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:
UIBarButtonSystemItemDone addTarget:self action:@selector(doneButtonPressed)
forControlEvents:UIControlEventTouchUpInside];
कौन मुझ में परिणाम एक पढ़ने "उदाहरण विधि त्रुटि मिल रही है:
लेकिन अगर मैं इसे जोड़ने मैं इस मिल आईडी ') "
मुझे केवल सही योजक दिखाने के बजाय, कृपया मुझे यहां दिए गए कोड के अतिरिक्त समाधान दिखाएं।
मैंने बारबूटोनिटम प्रोग्रामेटिक रूप से बनाया क्योंकि टूलबार पर इसे प्रोग्रामेटिक रूप से बनाया गया था, इसलिए आईबी का उपयोग व्यवहार्य नहीं है। – Capricorn