Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7533531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:45:11+00:00 2026-05-30T05:45:11+00:00

How do I get drawRect to wait for for the ViewController to give the

  • 0

How do I get drawRect to wait for for the ViewController to give the order to draw When the ViewController actually wants.

I’m drawing a chart that depends od the viewControllers array to draw itself.

The UIView is drawing but it’s not waiting for all variables to take place.
i did on ViewController:

[self.chartView setNeedsDisplay];

and the ChartView (UIView) i got the following:

NSArray *numbersForLine = [self.delegate WhatsTheArray:self];
NSLog(@"numbersForLine in Chartview: %@", numbersForLine);

After I get my array of points to draw with, I call the method above.
The problem is that it just ignores the array and draws whatever it has to draw. It doesn’t wait for the ViewController to send the array.

Is there any way I can get it to wait for the ViewController to pass that array and then drawRect ?
Or is there any other method of implementation other then the delegate to do what I want ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:45:12+00:00Added an answer on May 30, 2026 at 5:45 am

    Why don’t you have a property of the array object in the ChartView class to be accessed from the ViewController. Then,

    self.chartView.inputArray = array;
    [self.chartView setNeedsDisplay];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a subclass of UIView that overrides drawRect: and uses AddArcToPoint() to draw
When using drawRect for a custom UIButton subclass, it never seems to get called
get an array of bluetooth ID's Broadcast the bluetooth signal manually
It's really a pain, but always when I draw an UIImage in -drawRect:, it's
My end goal is to draw a report that looks like MS Word using
I need to draw on my uiview without using the drawrect method but i
I tried invoking UIGraphicsGetCurrentContext() in other places other than in drawRect. It give me
I have a UIView subclass that I am doing some custom drawing in. When
I have a custom view onto which I draw some graphics from the drawrect
CGContextRef context = ??; // get from UIImage *oldImage CGContextSaveGState(context); CGRect drawRect = CGRectMake(0,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.