ios - Threads RootViewController exclude memory leaks -
i have background thread, after work need update root viewcontroller results.
+ (void)mybackgroundfunction { __weak myapprootviewcontroller * view = ...;//here app root view controller view.needsupdatefetch = yes; dispatch_async(dispatch_get_main_queue(), ^{ [view reloaddata]; }); }
should use __weak exclude memory leaks? right change ivar variable(needsupdatefetch) before block? or give me pls links read about.
whether should use __weak
or not depends on code written. don't need in specific case, won't hurt use it.
Comments
Post a Comment