English 中文(简体)
核心估算和计算方法中的遗留/交易
原标题:Residual/trace in Core Animation & CALayers

我正在做一个 Coco子,利用核心调子来建立习俗分析。 然而,每当我 around开几层左右时,他们常常把一些“残余/外壳”留给其他层。

迄今为止,我的猜测与我使用有关。 我的理解是,随着我走下一层,我无需把这种方法称作这一层(因为在这个层内没有任何更新)。 但遗留下来的残余物位于其他层面(也许需要称作这种方法吗?) 但是,我怎么知道哪一层rag积的 mo变已经过去?

例如,大多数绘画都是简单的:

// Block view is a subclass of CALayer
@implementation BlockView

-(void)drawInContext:(CGContextRef)context
{   
    CGRect bounds = CGContextGetClipBoundingBox(context);   
    CGContextSetFillColorWithColor(context, color);
    CGContextFillRect(context, bounds);
}
@end

然而,有时甚至是 我有多个层次(3个最高层),但我不认为这是一个问题。

我想知道,这有什么原因? 这一问题难以展示具体的守则实例,但欢迎某些方面或可能的问题。

问题回答

一个共同的问题正在超越界限。 如果你在你的绘画过程中使用[自定框架],而[自订]。

代表我的上司:

  • You could try calling setNeedsDisplay: from the top layer in your hierarchy
  • You could try drawing using Application Kit classes and using a different graphics context to do your drawing.




相关问题
2 mysql instances in MAC

i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is ...

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

Switching J2SE versions on Mac OS (SnowLeopard)

My current JDK on Mac OS (10.6) is set to 1.6 and I d like to switch to 1.5. A listing of /System/Library/Frameworks/JavaVM.framework/Versions/ shows: lrwxr-xr-x 1 root wheel 10 Nov 3 18:34 ...

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

export to MP3 from quicktime API

A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...