简体   繁体   中英

Navigation working very slow

On working with a navigation based application performing 3-4 push. When I pop the 4 controller view and so on it takes much time about 2 sec delay. I am performing some background operations for storing images in file manager Even when I press back button then previous view nav bar gets clicked because of this slow navigation. I am unable to understand the problem for delay.

Thanks in advance.

Try to write code to push on main thread,

ie

dispatch_async(dispatch_get_main_queue(), ^(){

    [self.navigationController pushViewController:yourViewController];
});

假设您正在从Viewcontroller A转到Viewcontroller B,然后从B返回A,如果您有一些webservise调用或在A中花费时间的东西,那么将存在延迟,请尝试避免这种情况并在主线程中使用它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM