How to subclass NSImageView and add NSBezierPaths to it?

Discussion in 'Mac Programming' started by ranguvar, Sep 18, 2009.

  1. ranguvar macrumors 6502

    Sep 18, 2009
    Hi everybody,

    I'm currently developing an app that allows the user to track where they have moved on a map. I'd like to create a CustomView, which is a subclass of NSImageView. The view should draw both the image of the map and NSBezierPaths that represent the track.
    Now my questions are:
    1. How do I create a subclass of NSImageView? Specifically, how can I customize the '- (void)drawRect:(NSRect)dirtyRect' while still drawing the image set in InterfaceBuilder?
    2. How can I add instances of NSBezierPath to the view, on top of the image of the map?

    Thanks for any input!
  2. GorillaPaws macrumors 6502a


    Oct 26, 2003
    Richmond, VA
    You might want to consider using Core Animation's layers for this.

Share This Page