iphone - What is correct place for threading either in viewWillAppear or viewDidAppear in UIViewController? -


what correct place threading either in viewwillappear or viewdidappear in uiviewcontroller .

in general, if want load images need seen (appear) other views of view controller, need load in sync way (you need wait until image loaded before viewcontroller shown) in viewwillappear:

this way can animate view controller (including image), but, of course, may keep in mind loading images servers need time (and internet errors may occur), so, may happens user tap go viewcontrollers , app stops while (maybe much, depending on file size of image, internet speed connection...)

so, better approach be:

load images in viewdidappear in async way:

user see animation viewcontroller (without image) , see image when available (with new animation, if will).

anyway, depends on aspect app should do, both ways good...


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -