Why do we override drawrect: method? How to explicitly call it?
Answer / Sandeep Kaumr
Overriding the drawRect: method in a custom UIView subclass allows you to customize the view's drawing behavior. It gets called by the system when the view needs to be redrawn, such as after layout changes or when appearing on screen.nnTo explicitly call drawRect:, you can use the setNeedsDisplay or setNeedsLayout methods of UIView. These will trigger a redraw cycle, resulting in the drawRect: method being called.nnNote that ARC does not automatically manage the lifetime of objects created within the drawRect: method, so be careful to retain any such objects if they need to persist beyond the current draw cycle.
| Is This Answer Correct ? | 0 Yes | 0 No |
What manual memory management ? How it work?
What does use core data mean in xcode?
What are sensors in iphone?
Explain the difference between stack and heap memory?
What is difference between delegate and datasource in ios?
Multitasking support is available from which version?
How do I open a csv file on my phone?
How to deal with sqlite database?
what are fetched properties? How do you create a fetched property?
Why do you generally create a weak reference when using self in a block?
What is notification in iOS?
1 Answers TryTechnicals Pvt Ltd,
Explain interfaces?