मैं अपने खुद के UINavigationBar प्रबंध कर रहा हूँ लगता है। व्यापक स्किनिंग के कारण मुझे ऐसा करने की ज़रूरत है। UINavigationController के लिए प्रलेखन चेतावनी देता है कि UINavigationController के साथ उपयोग किए जाने पर UINavigationBar को स्किन करने की सीमाएं हैं।UINavigationBar topItem/मदों की दोबारा पॉप पर वापस
मैंने व्यापक लॉगिंग की है और जो कुछ भी मैं बता सकता हूं, उससे UINavigationController में "बैक" बटन दबाकर एक के बदले स्टैक के दो आइटम पॉप हो जाते हैं। मुझे एक प्रतिनिधि प्रतिनिधि कॉलबैक मिलता है जो मुझे बता रहा है कि यह तार्किक वस्तु को हटा रहा है, लेकिन यह वास्तव में उस एक और एक को हटा देता है।
जागने में UINavigationController में जोड़ा गया आइटम कभी हटाया जाना चाहिए। इसे किसी कारण से हटाया जा रहा है।
दो समान प्रश्न हैं, लेकिन न ही संतोषजनक उत्तर हैं। दो प्रश्न हैं:
UINavigationBar .items accessor doesn't return the current UINavigationItem
UINavigationBar seems to pop 2 items off stack on "back"
- (void)awakeFromNib {
[headerView setDelegate: self];
[headerView pushNavigationItem: tableDisplay animated: NO];
}
- (void) selectedStory: (NSNotification *)not {
[headerView pushNavigationItem: base animated: NO];
NSLog(@"Selected story: %@", base);
}
- (void) baseNav {
NSLog(@"Current items: %@", [headerView items]);
BaseInnerItem *current = (BaseInnerItem *)[headerView topItem];
[self addSubview: [current view]];
}
- (BOOL)navigationBar: (UINavigationBar *)navigationBar shouldPushItem: (UINavigationItem *)item {
return YES;
}
- (BOOL)navigationBar: (UINavigationBar *)navigationBar shouldPopItem: (UINavigationItem *)item {
return YES;
}
- (void)navigationBar:(UINavigationBar *)navigationBar didPushItem:(UINavigationItem *)item {
NSLog(@"didPushItem: %@", item);
[self baseNav];
}
- (void)navigationBar:(UINavigationBar *)navigationBar didPopItem:(UINavigationItem *)item {
NSLog(@"didPopItem: %@", item);
[self baseNav];
}
संपादित एक भी रन से प्रासंगिक डिबगिंग जोड़ने के लिए:
2010-10-13 02:12:45.911 Remix2[17037:207] didPushItem: <TableDisplay: 0x5d41cc0>
2010-10-13 02:12:45.912 Remix2[17037:207] Current items: (
"<TableDisplay: 0x5d41cc0>"
)
2010-10-13 02:12:49.020 Remix2[17037:207] didPushItem: <WebDisplay: 0x591a590>
2010-10-13 02:12:49.021 Remix2[17037:207] Current items: (
"<TableDisplay: 0x5d41cc0>",
"<WebDisplay: 0x591a590>"
)
2010-10-13 02:12:49.023 Remix2[17037:207] Selected story: <WebDisplay: 0x591a590>
2010-10-13 02:12:59.498 Remix2[17037:207] didPopItem: <WebDisplay: 0x591a590>
2010-10-13 02:12:59.499 Remix2[17037:207] Current items: (
)
मेरे पास एक ही समस्या है लेकिन मैंने नेविगेशन नियंत्रक को अपने कस्टम स्किन किए गए नेविगेशन बार को संभालने दिया है। क्या आपको इसका उत्तर मिला? – mmmattias