main.m
EtchAppDelegate
View
We saw a
CGMutablePathRef
when we filled and stroked the triangle in
Japan.
The
View
object contains contains a
CGMutablePathRef
named
path
,
containing straight lines connecting points.
The
touchesBegan:withEvent:
touchesMoved:withEvents:
View
.
Declare it in
View.h
(after the
}
)
because it will be called from outside of class
View
.
- (void) clearPath;Define it in
View.m
:
- (void) clearPath { CGPathRelease(path); path = CGPathCreateMutable(); [self setNeedsDisplay]; }Call it in the
applicationDidEnterBackground:
method of the application delegate.
[view clearPath];