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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:12:34+00:00 2026-06-15T00:12:34+00:00

I am a new-be in Objective C. Here I want to ask a simple

  • 0

I am a new-be in Objective C. Here I want to ask a simple question.
I have created a view controller in storyboard, and customized its view with a subclass of UIView.
However, I don’t know how to call methods of the view in my view controller. Can anyone help? All I want to do is to call drawLine:pointStore in ChartViewController.m from chartView.m

Here are some of my codes.
ChartViewController.h

#import <UIKit/UIKit.h>
@class chartView;

@interface ChartViewController : UIViewController{  
    chartView *chart_view;  
}  

ChartViewController.m

- (void)viewDidLoad  
{  
    [super viewDidLoad];  

    NSMutableDictionary *pointStore = [[NSMutableDictionary alloc]init];  

    NSNumber *initX;  
    NSNumber *initY;  
    NSMutableDictionary *variableSet = [[NSMutableDictionary alloc]init];
    for(initX = [NSNumber numberWithDouble:-10.0f];initX.floatValue<=10.0f;initX = [NSNumber numberWithDouble:(initX.floatValue+0.5f)] )
    {
        [variableSet setValue:initX forKey:@"x"];
        initY = [NSNumber numberWithDouble:[self.brain performOperation:equationOfChart withVariable:variableSet]];
        [pointStore setObject:initX forKey:initY];
    }
    [chart_view drawLine:pointStore];
}

chartView.h

@interface chartView : UIView

@property (nonatomic, strong) NSString *equation;
-(void) getEquation:(NSString *)Equation;
-(void) drawLine:(NSMutableDictionary *)pointsStore;

@end

chartView.m

-(void)drawLine:(NSMutableDictionary *)pointsStore{
    CGContextRef c = UIGraphicsGetCurrentContext();
    CGFloat red[4] = {1.0f, 0.0f, 0.0f, 1.0f};
    CGContextSetStrokeColor(c, red);
    CGContextBeginPath(c);
    CGContextStrokePath(c);
    for(NSNumber *ax = [NSNumber numberWithDouble:-10.0f];ax.floatValue<10.0f;){
        float ay = [[pointsStore objectForKey:ax]doubleValue];
        ax = [NSNumber numberWithDouble:(ax.floatValue+0.5f)];
        int by = [[pointsStore objectForKey:ax]doubleValue];
        [self.class line:ax.floatValue y:ay  x2:(ax.floatValue+0.5) y2:by];
    }
}
  • 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-15T00:12:36+00:00Added an answer on June 15, 2026 at 12:12 am

    ChartViewController.h

    #import <UIKit/UIKit.h>
    @class chartView;
    
    @interface ChartViewController : UIViewController
    
    @property (string, nonatomic) chartView *chart_view;
    
    @end
    

    chartView.m

    - (void)viewDidLoad  
    {  
        [super viewDidLoad];  
        ...
        // Don't forget to alloc and init
        self.chart_view = [[chartView alloc] init];
        [self.chart_view drawLine:pointStore];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new to Objective-C. Here is what I want. I have a
I'm new in objective-C and i wonder if its correct: I have a class
I am new to objective C and I have a c++ background. I want
New to Objective-C and iOS development, would love a hand here! I have written
I'm new in objective-C and here is my problem: I want to write a
I am lil bit new to objective C. Here is my requirement. I have
I am new to objective-c. I have the following: @interface HPSEnumerations : NSObject typedef
I'm new in objective-c, and I'm now trying to write a simple user-sign-in program
I'm not pretty sure if this question is for here, but I want to
i am new to objective c programming I want to call a function within

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.