On 10/03/2009, at 7:39 PM, rajesh wrote:

Is there any other way of approach, or should I be making use of one of the ways I mentioned ?


Of course - just define a custom object that contains or manages each piece of content and draw them in one view. This is the "classic" approach and is probably the most scalable technique of all, since it incurs no overhead other than what you add.

The simplest approach is just to hold all the objects in a list and when the view is updated, traverse the list and determine which objects need to be drawn. The view itself has methods to keep this to a minimum -needsToDrawRect: and -getRectsBeingDrawn:count: For large numbers of objects (>1000, but YMMV) traversing the list testing for "needs to be drawn" itself becomes significant, in which case you'll need to consider alternative architectures such as binary search partitioning or R*-trees.

My own DrawKit project includes classes for dealing with this problem. http://apptree.net/drawkit.htm (though right now the implementation in the current download is a bit buggy - I have a new version going out soon that fixes these issues).

--Graham






_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to