I've seen many cases here where someone asks how to call one extremely simply-named method from another method, and gets a simple answer.
However, I have a CGRect method
- (void)drawRect:(CGRect)rect { /* code that draws circles */}
which successfully draws nmax circles for me. I also have a button method that successfully updates an "nmax" displayed on the screen.
- (IBAction)changeIntValue:(id)sender {nmax=nmax+100;}
Only problem is that I want it to redraw the screen for me as well. I cannot for the life of me figure out, even after Ring some FM's, the syntax to "re-call" this rect down again in my changeIntValue method.
Any help greatly appreciated. While I'm typing, if anyone has a reference with exhaustive info on syntax, that would be helpful. References at developer.apple.com and most tutorials veer off into giving specific examples likeThisExample. I hand-wrote some notes off a youtube lecture which gave syntax, but lost the reference.
You can cause an item to redraw using
[view setNeedsDisplay];
where view
is obviously your view.
This causes the view to be redrawn in the UI thread, and your view drawing code should then call your drawRect methods as appropriate.