1

I have UINavigationController based application, that loads data from local database containing images from resourses.

App was running smoothly in up to ios 6, But after upgrading my device to ios 7.0.3, I found that after running the app for some time (say for 2-3 mins) it stops showing effect of navigation and the page navigates without any animation.

I also checked memory issues, but in vain.

CODE:

ABCController *viewController = [[ABCController alloc]initWithNibName:@"SelectRewardController" bundle:nil];
[self.navigationController pushViewController:viewController animated:YES];

As I have mentioned, it runs smoothly in up to iOS 6, but the navigation effect has stop and the next view controller comes without any animation effect in iOS7.

Kara
  • 6,115
  • 16
  • 50
  • 57
Yama
  • 2,649
  • 3
  • 31
  • 63

1 Answers1

5

I had the same problem and I found out it is caused by doing UI related work in background thread. Make sure you have all your UI related code called from the main thread. Simply doing [self performSelectorOnMainThread:] won't work. You have to use:

dispatch_async(dispatch_get_main_queue(), ^{})

Peng90
  • 300
  • 2
  • 9
  • Thank you for the reply, but it is not yet working with my project. – Yama Oct 28 '13 at 06:42
  • I know this is kinda tricky but do make sure you checked all UI related code. For example, the reason my code didn't work was because I allocated and assign a UIImage in a background thread for my table view cell... So instead of doing 'cell.imageView.image = [UIImage imageNamed:@"imgName"]', you should do 'UIImage* theImg = [UIImage imageNamed:@"imgName"]' and then in the main thread do 'cell.imageView.image = theImg'. – Peng90 Oct 28 '13 at 14:38
  • But don't you think that if I load images in background, it will slow down the speed of the image loading? Also note that I am using custom cell with UIButton with image and a Label in a grid view and about 200 such cells are loaded at a time. – Yama Oct 29 '13 at 05:04
  • Actually I think for that number of cells in table, you should separate the UI processing and data processing into different threads. My table has more than 5000 cells and the performance is just fine. But I do think if you do everything in the main thread the animation should be there. – Peng90 Oct 29 '13 at 18:17
  • I don't know whether the answer or the comment did the trick, but problem is resolved..!! Thanks. – Yama Oct 31 '13 at 04:44
  • 1
    I'm glad to hear that! You're welcome and thank you for mark my answer! That's my first stack overflow answer:) – Peng90 Oct 31 '13 at 13:42