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 8436115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:06:05+00:00 2026-06-10T07:06:05+00:00

My code works, but I don’t understand who or where is calling the setter

  • 0

My code works, but I don’t understand who or where is calling the setter for my view’s datasource delegate. I understand why calling that code makes everything work, I’d just like to know who makes the call / where it happens. The header for the view looks like this, with the last line of code being the important one:

@class GraphView;

@protocol GraphViewDataSource 

-(float)YValueforXValue:(float)xValue;

@end

@interface GraphView : UIView

@property (nonatomic) CGFloat scale;
@property (nonatomic) CGPoint graphOrigin;
@property (nonatomic, weak) IBOutlet id <GraphViewDataSource> dataSource;

@end

And the view controller that conforms to the protocol:

@interface GraphViewController () <GraphViewDataSource>

@property (nonatomic, weak) IBOutlet GraphView *graphview;

@end

@implementation GraphViewController

@synthesize graphview = _graphview;
@synthesize program = _program;

-(void)setGraphview:(GraphView *)graphview {
    _graphview = graphview;
    self.graphview.dataSource = self;
}

I have excluded the required protocol method and more, as its not relevant. What I want to know is who calls the above setGraphView method. Unfortunately, I couldn’t get help from a breakpoint (aside from knowing it was being called).

Also, that delegate first gets referenced by this code in the view:

for (CGFloat thisPointViewXValue=self.bounds.origin.x; thisPointViewXValue<=self.bounds.size.width; thisPointViewXValue +=1/self.contentScaleFactor)
    {
        if (FirstPoint) {
            CGFloat firstpointGraphXValue = [self convertViewXValueToGraphXValue:thisPointViewXValue];
            CGFloat firstpointGraphYValue = [self.dataSource YValueforXValue:firstpointGraphXValue];
            CGFloat firstpointViewYValue = [self convertGraphYValueToViewY:firstpointGraphYValue];
            CGContextMoveToPoint(context, thisPointViewXValue, firstpointViewYValue);
            FirstPoint = NO;

        }
        CGFloat thisPointGraphXValue = [self convertViewXValueToGraphXValue:thisPointViewXValue];
        CGFloat thisPointGraphYValue = [self.dataSource YValueforXValue:thisPointGraphXValue];
        CGFloat thisPointViewYValue = [self convertGraphYValueToViewY:thisPointGraphYValue];
        CGContextAddLineToPoint(context, thisPointViewXValue, thisPointViewYValue);


}

Is that where it happens???

  • 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-06-10T07:06:07+00:00Added an answer on June 10, 2026 at 7:06 am

    The graphView and dataSource iVars are marked as IBOutlets, i.e. Interface Builder Outlet.

    This would normally indicate that GraphViewController is loaded via a nib/xib file, and inside that nib file there are connections to these iVar from other objects inside the nib file.

    So it is the nib loading mechanism that is calling the setters on those iVars.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to say that my code works correctly but i don't know why
Hello everyone don't know why this code works on windows but not on linux
The following bit of code works great in everything but IE. In IE, the
The following code works in Google Chrome and Firefox, but don't work in IE8.
I have a working code from a tutorial but don't understand it completely. Situation:
This code works fine in IE8, Firefox, Chrome etc... but ie7 don't recognize this
I have this code which works well but I don't know if it is
I have some code that works fine but it's become too slow: HTML: I
This question is a bit different than most. My code works but I don't
Code below works but what doesn't work properly is delaying process because I don't

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.