我正在开发iPhone上的草图应用程序.我得到了它的工作,但不是在这里看到的漂亮

我正在寻找任何平滑绘图的建议基本上,我所做的是当用户将手指放在我调用的屏幕上时
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
Run Code Online (Sandbox Code Playgroud)
然后我收集一个阵列中的单个触摸
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
Run Code Online (Sandbox Code Playgroud)
当用户从屏幕上拿出一根手指时,我打了个电话
- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
Run Code Online (Sandbox Code Playgroud)
然后我用数字绘制数组中的所有点
NSMutableArray *points = [collectedArray points];
CGPoint firstPoint;
[[points objectAtIndex:0] getValue:&firstPoint];
CGContextMoveToPoint(context, firstPoint.x, firstPoint.y);
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetLineJoin(context, kCGLineJoinRound);
for (int i=1; i < [points count]; i++) {
NSValue *value = [points objectAtIndex:i];
CGPoint point;
[value getValue:&point];
CGContextAddLineToPoint(context, point.x, point.y);
}
CGContextStrokePath(context);
UIGraphicsPushContext(context);
Run Code Online (Sandbox Code Playgroud)
而现在我想改进绘图更像是"Sketch Book"App

我认为与信号处理算法有关,要重新排列阵列中的所有点,但我不确定.任何帮助将非常感激.
提前谢谢:)
之前我使用过Xcode3中的javascript文件,一切都很棒,你只需要复制.js就可以从Compile Sources构建阶段删除JavaScript文件,并将其添加到Copy Bundle Resources构建阶段,就像这篇文章中所建议的那样
现在的问题是如何在Xcode4中做同样的事情,我似乎找不到这样做的地方.
请帮助,谢谢所有提前.Pondd


大家好,
上面的图片来自"Nike Boom"应用程序.我想知道如何对数字列表进行放大效果,如图所示.我还想指出它是非常非常流畅的动画,因此屏幕捕获屏幕的某些部分并将其投影回UIView可能无法正常工作(我试过)
提前谢谢,Pondd
更新:嘿,
对于可能遇到这个主题的人来说,我已根据Nielsbot的建议制作了一个简单的样本,并在github上发布了这里
请随意分叉,改进并传递:)
最好,
Pondd
我在使用subArrayWithRange时遇到问题.
基本上,我想要做的是从mainArray中制作50个或更少元素的子数组,例如,如果mainArray有70个元素,我希望sortedArray在第一个索引中包含前50个元素的数组,在最后一个索引中包含20个元素的另一个数组sortedArray
希望我清楚自己想做什么.
无论如何,我的代码是
for (int i=0; i<=ceilLoopCount; i++) {
[sortedArray insertObject:[testArray subarrayWithRange:NSMakeRange(0,50)] atIndex:i];
}
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是我在所有数组中只得到相同的50个元素
请帮忙,Pondd