rightcalloutaccessoryview बटन प्रेस पर कोई नया दृश्य जोड़ना

वोट
0

मैं एक rightcalloutaccessoryview बटन प्रेस पर कोई नया दृश्य जोड़ना चाहते हैं। मैं वर्तमान में मानचित्र पर पिन छोड़कर के लिए कार्यक्षमता है। एक कॉल आउट एक शीर्षक, उपशीर्षक के साथ (MKAnnotation), और शेवरॉन भार जब मैं पिन टैप करें। जब मैं शेवरॉन (rightcalloutaccessoryview) नल मैं एक और दृश्य पॉप अप करने के इस बिंदु पर अधिक जानकारी दिखा चाहते हैं। अभी, शेवरॉन नल कुछ नहीं करता है। यह वही है जो मेरे पास है:

-(IBAction)showInfo:(id)sender 
{     
     int calloutButtonPressed = ((UIButton *)sender).tag;
     if(calloutButtonPressed < 99999)
     {
          if(self.DetailView == nil)
          {
               DetailViewController *tmpViewController = [[UIViewController alloc] initWithNibName:@DetailView bundle:nil];
               self.DetailView = tmpViewController;
               [tmpViewController release];
          }

          if (calloutButtonPressed == 1) 
          {
                         // Using the debugger, I found that calloutButtonPressed is equal to 0 when the button is pressed.
                         // So I'm not sure what the point of this method is...
                }
          self.DetailView.title = @Title;
     }
 }

मैं सत्यापित किया है कि इस कार्रवाई विधि शेवरॉन दबाने का आह्वान किया हो जाता है। दुर्भाग्य से, मैं यह कोई नया दृश्य ऊपर खींचने के लिए नहीं मिल सकता है। किसी को भी जानता है कि मैं गलत क्या कर रहा है, तो कृपया मुझे बताएँ। मैं एक चुटकी का एक सा में हूँ ...

धन्यवाद!

थॉमस

11/02/2010 को 06:31
का स्रोत उपयोगकर्ता
अन्य भाषाओं में...                            


1 जवाब

वोट
0

    -(IBAction)showInfo:(id)sender 
{   
     int calloutButtonPressed = ((UIButton *)sender).tag;
     if(calloutButtonPressed < 99999)
     {
          if(self.detailView == nil)
          {
               DetailViewController *tmpViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
               self.detailView = tmpViewController;
               [tmpViewController release];
          }

          [self.navigationController pushViewController:self.detailView animated:YES];

          if (calloutButtonPressed == 0) 
          {
               // TRP - I inserted my view atIndex:99999 to ensure that it gets placed in front of all windows
               // TODO: figure a better way to do this
               [self.view insertSubview:detailView.view atIndex:99999];
          }
          self.detailView.title = @"Title";
     }

}

यह इस एक बयान याद आ रही थी:

[self.view insertSubview:detailView.view atIndex:99999];

मैं तो मैं वहाँ में है कि जादुई संख्या (99999) के लिए की जरूरत नहीं है एक और तरीका खोजने के लिए चाहते हैं (प्लस, यह थोड़े अपरिपक्व लगता है ...)। मैं इसके बारे में बहुत चिंतित नहीं हूँ, क्योंकि यह हालांकि काम करता है।

मैं Apple डेवलपर मंच से मेरी मदद की है, यहाँ

19/02/2010 को 23:24
का स्रोत उपयोगकर्ता

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more