diff --git a/XBMC Remote/DetailViewController.h b/XBMC Remote/DetailViewController.h
index acd29d76d..31dc2f0df 100644
--- a/XBMC Remote/DetailViewController.h
+++ b/XBMC Remote/DetailViewController.h
@@ -90,7 +90,7 @@
BOOL enableDiskCache;
CGFloat iOSYDelta;
__weak IBOutlet UIToolbar *buttonsViewBgToolbar;
- BOOL isViewDidLoad;
+ BOOL loadAndPresentDataOnViewDidAppear;
BOOL forceMusicAlbumMode;
NSMutableDictionary *epgDict;
NSMutableArray *epgDownloadQueue;
diff --git a/XBMC Remote/DetailViewController.m b/XBMC Remote/DetailViewController.m
index b44bba115..c21867627 100644
--- a/XBMC Remote/DetailViewController.m
+++ b/XBMC Remote/DetailViewController.m
@@ -5551,16 +5551,16 @@ - (void)viewDidAppear:(BOOL)animated {
else {
self.navigationController.navigationBar.tintColor = ICON_TINT_COLOR;
}
- if (isViewDidLoad) {
+
+ // We load data only in viewDidAppear as loading/presenting is tightly coupled and we want
+ // the layout to be ready. We do not want to repeat loading/presenting, if we re-enter the
+ // same controller instance from another view, e.g. when coming back from detail view.
+ if (loadAndPresentDataOnViewDidAppear) {
[self initIpadCornerInfo];
- if (globalSearchView) {
- [self retrieveGlobalData:NO];
- }
- else {
- [self startRetrieveDataWithRefresh:NO];
- }
- isViewDidLoad = NO;
+ [self startRetrieveDataWithRefresh:NO];
+ loadAndPresentDataOnViewDidAppear = NO;
}
+
if (channelListView || channelGuideView) {
[channelListUpdateTimer invalidate];
// Set up a timer that will always trigger at the start of each local minute. This supports
@@ -5949,7 +5949,7 @@ - (void)viewDidLoad {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
hiddenLabel = [userDefaults boolForKey:@"hidden_label_preference"];
noItemsLabel.text = LOCALIZED_STR(@"No items found.");
- isViewDidLoad = YES;
+ loadAndPresentDataOnViewDidAppear = YES;
sectionHeight = LIST_SECTION_HEADER_HEIGHT;
epglockqueue = dispatch_queue_create("com.epg.arrayupdate", DISPATCH_QUEUE_SERIAL);
epgDict = [NSMutableDictionary new];
@@ -6198,7 +6198,19 @@ - (void)checkUpdateRecordingState:(NSMutableArray*)source dataInfo:(NSDictionary
- (void)initIpadCornerInfo {
mainMenu *menuItem = self.detailItem;
if (IS_IPAD && menuItem.enableSection) {
- titleView = [[UIView alloc] initWithFrame:CGRectMake(STACKSCROLL_WIDTH - FIXED_SPACE_WIDTH, 0, FIXED_SPACE_WIDTH - 5, buttonsView.frame.size.height)];
+ // Add a reserved fixed space which is used for iPad corner info
+ for (UILabel *view in buttonsView.subviews) {
+ if ([view isKindOfClass:[UIToolbar class]]) {
+ UIToolbar *toolbar = (UIToolbar*)view;
+ UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+ fixedSpace.width = FIXED_SPACE_WIDTH;
+ toolbar.items = [toolbar.items arrayByAddingObject:fixedSpace];
+ break;
+ }
+ }
+
+ // Add the corner info view
+ titleView = [[UIView alloc] initWithFrame:CGRectMake(buttonsView.frame.size.width - FIXED_SPACE_WIDTH, 0, FIXED_SPACE_WIDTH - 5, buttonsView.frame.size.height)];
titleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
topNavigationLabel.textAlignment = NSTextAlignmentRight;
topNavigationLabel.font = [UIFont boldSystemFontOfSize:14];
@@ -6207,17 +6219,6 @@ - (void)initIpadCornerInfo {
[buttonsView addSubview:titleView];
[self checkFullscreenButton:NO];
}
- else {
- // Remove the reserved fixed space which is only used for iPad corner info
- for (UILabel *view in buttonsView.subviews) {
- if ([view isKindOfClass:[UIToolbar class]]) {
- UIToolbar *bar = (UIToolbar*)view;
- NSMutableArray *items = [NSMutableArray arrayWithArray:bar.items];
- [items removeObjectAtIndex:15];
- [bar setItems:items animated:NO];
- }
- }
- }
}
- (void)checkFullscreenButton:(BOOL)forceHide {
diff --git a/XBMC Remote/DetailViewController.xib b/XBMC Remote/DetailViewController.xib
index 0d4e702b8..ebea58c92 100644
--- a/XBMC Remote/DetailViewController.xib
+++ b/XBMC Remote/DetailViewController.xib
@@ -75,7 +75,7 @@