在storyboard中新建一个view,主要功能是涂鸦,在slider上移动是可以同步改变涂鸦中线的宽度。
在监听slider滑动的过程中,出现了一些问题。
<Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
我的监听方法是这么写的:
- (void)sliderChanged:(UISlider *)slider{
for (UIBezierPath *path in self.paths) {
path.lineWidth = slider.value * 2;
[path stroke];
}
}
小弟是根据李明杰老师的教学视频学习的,这个是他课上留的作业,求大神帮忙看看,该问题应该如何解决。查了一些资料,都没有相关的解答。在此先拜谢。