监听slider以改变view中涂鸦线的宽度

lxd_ScorPio 2014-12-24 09:23:49

在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];
}
}

小弟是根据李明杰老师的教学视频学习的,这个是他课上留的作业,求大神帮忙看看,该问题应该如何解决。查了一些资料,都没有相关的解答。在此先拜谢。
...全文
80 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

29,028

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧