objective c - Overuse of NSView -> Alternatives? -


i having performance troubles app:

it takes more 2 seconds load -> straight away went apple documentation

https://developer.apple.com/library/mac/documentation/cocoa/conceptual/cocoaperformance/articles/customviews.html#//apple_ref/doc/uid/tp40001443-cjbjifgc

in section named "avoid overuse of views" @ bottom got confused:

i indeed adding lot of nsviews (guess overusing them).

" instead, should consider writing own custom classes can managed higher-level nsview subclass. drawing code of nsview subclass can optimized handle custom objects. "

my question is:

how can write own custom classes can managed higher -level nsview subclass -> example ?

only thing thought calayer.

is adding calayer subclasses better adding nsview ? increase poor performance bit ?

or there new learn ?

edit:

currently have nsviews adding 15 nsview subview them , can add 15calayers instead :-/

have profiled app? before ripping view hierarchy apart, use instruments time profiler find out time being spent.

calayers more efficient uiviews, , recommended avoid using drawrect if don't need to, before resorting rewrite, need know app spending time.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -