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

  • Home
  • SEARCH
  • 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 7433765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:43:28+00:00 2026-05-29T09:43:28+00:00

i have getting CGPoint value in my array like this @interface CanvasView : UIView{

  • 0

i have getting CGPoint value in my array like this

@interface CanvasView : UIView{
 NSMutableArray *_array;
}
@property (nonatomic, retain) NSMutableArray *_array;

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    CGPoint currentPoint = [touch locationInView:self];
    [_array addObject:[NSValue valueWithCGPoint: currentPoint]];
}

i have called this array in touchesEnded its working fine i will get values of nspoint

    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {  
        NSLog(@"roomAtX:%@ ",_array);
    PieClass *myPieClass=[[PieClass alloc]initWithFrame:CGRectMake(8, 297, 200, 300)];
    [self addSubview:myPieClass];
}

this is my console out put

"NSPoint: {595, 158}",
"NSPoint: {558, 154}",
"NSPoint: {535, 152}",
"NSPoint: {518, 152}",
"NSPoint: {500, 160}",
"NSPoint: {482, 175}",

now i want use this array to another class so that i called this for my another class
like this

- (void)drawRect:(CGRect)rect
{
      CanvasView *cnava =[[CanvasView alloc]init];
        NSLog(@"nextview:%@ ",cnava._array);

}

but here i get nextview:(null)
kindly guide how can access that array in other classes .

  • 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-29T09:43:28+00:00Added an answer on May 29, 2026 at 9:43 am

    Just have a property of PieClass

    @interface PieClass : UIView{
        // ... other things.
    }
    @property (nonatomic, retain)NSMutableArray *pointsArray;
    

    and don’t forget to synthesize it. Now when you initialize PieClass pass that array to this also

    PieClass *myPieClass=[[PieClass alloc]initWithFrame:CGRectMake(8, 297, 200, 300)];
    myPieClass.pointsArray = _array;
    [self addSubview:myPieClass];
    

    now in your drawRect

    - (void)drawRect:(CGRect)rect
    {
          //CanvasView *cnava =[[CanvasView alloc]init]; you don't need to do this
          NSLog(@"nextview:%@ ",self.pointsArray);  //passed from previous class
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A common issue I have is getting confused what $(this) is referring to. I
Have been getting pretty bald over this situation! I am using MS VS 2010
I have been getting this annoying error/bug in Visual Studio 2008 quite a bit
We have been getting this Oracle connection pool exception a lot recently for our
I have been getting this error for quite some time now and Google has
I have been getting this error and have no idea how to fix it.
I have been getting this error in Ruby 1.9, Rails 3.0, ActiveRecord 3.0: incompatible
I have been getting this PHP Warning: json_encode(): double INF does not conform to
I have been getting an error in VB .Net object reference not set to
I have been getting a number of attacks on my website lately, with a

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.