1

I have just created a path using NSBezierPath and did [path fill] to draw it onto the view. My question is how do I remove what I have drawn?

One possible solution is to use [path fill] again with the background color but this will not work if there is a background image instead of a simple background color. So anyone has any ideas?

Simon Sarris
  • 62,212
  • 13
  • 141
  • 171
hollow7
  • 1,506
  • 1
  • 12
  • 20

2 Answers2

4

Just remove the path from path array and call the drawRect again. btw mai know in which you are storing the paths, mutable array or dictionary?

Veera Raj
  • 1,562
  • 1
  • 19
  • 40
0

The path you created is displayed when you set a CALayer path

view.layer.path = path.CGPath;

To clear that path

view.layer.path = nil;
Yogev Shelly
  • 1,373
  • 2
  • 13
  • 24