Repeated code to check for iOS version -


i use snippet repeatedly in app. so, better read once , store in global variable or appdelegate or keep executing snippet whenever needed?

#define system_version_less_than(v)                 ([[[uidevice currentdevice] systemversion] compare:v options:nsnumericsearch] == nsorderedascending) if (system_version_less_than(@"7.0"))     return no; return yes; 

i keep in variable owned appdelegate - it's simple bool, it's not storage intensive.

however, snippet not system intensive @ - it's pretty free performance-wise. since thinking kind of optimization, though, better keep in appdelegate.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -