Questions tagged [setneedsdisplayinrect]

13 questions
5
votes
2 answers

setNeedsDisplayInRect called during drawLayer:inContext:

I use a CATiledLayer in my app, and as a result, drawing of that layer is done in a background thread. That is, the drawLayer:inContext: method of my delegate is called from a background thread. The setNeedsDisplayInRect used to invalidate parts of…
fishinear
  • 6,101
  • 3
  • 36
  • 84
3
votes
1 answer

How to call setNeedsDisplayInRect using performSelectorOnMainThread?

How to call setNeedsDisplayInRect using performSelectorOnMainThread? The problem is rect. I do not know how to pass the rect in performSelectorOnMainThread method. This method ask NSObject, but CGRect is not NSObject, it is just structure *.…
mooongcle
  • 3,987
  • 5
  • 33
  • 42
2
votes
1 answer

setNeedsDisplayInRect bug in iOS5?

I'm trying to use setNeedsDisplayInRect: in iOS5 to optimize some drawing code. The setup is simple: I have an array of CGRect 'hotspots' that function as buttons. When a touch is detected I find the CGRect it occurred in and call…
spring
  • 18,009
  • 15
  • 80
  • 160
2
votes
1 answer

IOS 5 SetNeedsDisplayInRect causes a FullScreen-Invalidity

I noticed in IOS5 when calling SetNeedsDisplayInRect for the first time, it causes the device to refresh the full-screen. this is different to previous IOS-Versions. In the App I am working on I have an array of objects that needs to be drawn…
Tom
  • 213
  • 3
  • 10
2
votes
1 answer

NSOutlineView setNeedsDisplayInRect calls fail

I have an NSOutlineView that uses a custom NSCell subclass to draw an NSProgressIndicator. Each NSCell has a refreshing property that is set by the NSOutlineView delegate willDisplayCell:forItem: method, like so: - (void)outlineView:(NSOutlineView…
ndg
  • 2,585
  • 2
  • 33
  • 58
2
votes
0 answers

Figuring out what rects have been invalidated in drawrect after doing multiple setneedsdisplayinrect

I'm drawing images in a grid formation. Some of the images will move, and I need to update the display, but obviously, I don't want to refresh the whole screen unnecessarily. I am using SetNeedsDisplayInRect multiple times but sometimes, it seems…
Nelson Ko
  • 247
  • 4
  • 11
1
vote
2 answers

Cocoa - iOS -Does updating the text property of a UILabel require setNeedsDisplay?

I am a newbie and I have a iOS project where I am setting the text property of a UILabel field. self.nameLabel.text = @"abcd"; Question Do I need to invoke setNeedsDisplayInRect for the label for the new text value to be displayed ? My…
user1046037
  • 16,755
  • 12
  • 92
  • 138
0
votes
2 answers

Create a complex CGRect

I have a view with a border of 10 pixels drawn on the method. I need to update the border color and I use [self setNeedsDisplay] to make it redraw the view. Since I need to update only the border I want to use : [self setNeedsDisplayInRect:rect]…
shannoga
  • 19,649
  • 20
  • 104
  • 169
0
votes
1 answer

Right use of setNeedsDisplayInRect: method for animation

I have some view controller, that uses my own view class and XIB interface, so the view initializes from coder. In that view controller, when I move the slider, it redraws rectangle, in initial state rectangle is on full screen and when I move the…
Nikita
  • 1,811
  • 1
  • 20
  • 41
0
votes
2 answers

SetNeedsDisplay on NSView triggers the redrawing of the whole views hierarchy

I'm working on an app made by a NSWindow which own a lot of custom subviews, that could be opaque or not. Whenever I call SetNeedsDisplay: or SetNeedsDisplayInRect: on a subview, the system calls the drawRect of each single subview starting from the…
0
votes
1 answer

Why is drawAtPoint Creating Duplicate Images in my tablecell's contentview?

I have a view with a custom slider. We are using a subclass of TableViewController that is generating instances of UITableViewCell. Inside each tableViewCell we add our custom slider (a UI View) as a subview. In here we have a view that serves as…
Jim Jeffers
  • 17,572
  • 4
  • 41
  • 49
0
votes
1 answer

How do you update a secondary view?

Perhaps there's a better way to set this up so I'm open to suggestions. But here's what I'm doing. I have a main UIView. On top of that I have a UIImageView and another UIView. When the UIImageView changes, I want to change the second UIView. So I…
Troy Sartain
  • 163
  • 1
  • 4
  • 15
0
votes
2 answers

UIView does not clear (Refresh) when we reDraw String

I am trying to draw a char array on a UIView. The problem is that the view is not refreshing automatically and hence the chars are not displayed. When we touch the screen here and there then it gets displayed (sometime only a portion of the char).…
kumar
  • 51
  • 2