2012-06-04 25 views
8

मैं एक टैब बार नियंत्रक से प्रस्तुत नियंत्रक को कुछ नियंत्रक विन्यास करने के लिए देख रहा हूँ। क्या कोई अच्छा इंटरसेप्शन पॉइंट है जहां मैं कुछ मानों में गंतव्य नियंत्रक को पास कर सकता हूं, उतना ही तैयारफोरसेग विधि की तरह?क्या कोई अवरोध बिंदु है जैसे TabBarController के लिए readyForSegue?

बहुत सराहना की।

उत्तर

8

टैबव्यू कंट्रोलर की सरणी के माध्यम से एक टैबव्यू से आपके सभी नियंत्रक एक्सेसिबल हैं। आप उन्हें सीधे संशोधित कर सकते हैं। यदि आप उस विशिष्ट व्यक्ति को देखने से पहले कुछ बदलना चाहते हैं, तो प्रतिनिधि सेट करें और प्रतिनिधि विधि को कार्यान्वित करें।

http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITabBarControllerDelegate_Protocol/Reference/Reference.html

tabBarController:shouldSelectViewController: 

Asks the delegate whether the specified view controller should be made active. 
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController Parameters 

tabBarController 

    The tab bar controller containing viewController. viewController 

    The view controller belonging to the tab that was tapped by the user. 

Return Value 

YES if the view controller’s tab should be selected or NO if the current tab should remain active. Discussion 

The tab bar controller calls this method in response to the user tapping a tab bar item. You can use this method to dynamically decide whether a given tab should be made the active tab. Availability 

    Available in iOS 3.0 and later. 

Declared In UITabBarController.h 
+0

शानदार जवाब (आप बस इस विधि के अंदर कुलपति बदल सकते हैं और हाँ लौट सकते हैं)। धन्यवाद – Slappy

+0

यह तब नहीं कहा जाता है जब टैब प्रोग्रामिक रूप से बदल जाता है। – malhal