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

The Archive Base Latest Questions

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

I am updating some old code and I have a subclassed UIView (GraphView) that

  • 0

I am updating some old code and I have a subclassed UIView (GraphView) that has the following touchesBegan code:

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint point = [[touches anyObject] locationInView:self];
if ([self.grapher.gLayers pointInside:point]) {
NSLog(@"gLayer has point");
... do some stuff
}

// Draw a red dot where the touch occurred
UIView *touchView = [[UIView alloc] init];
[touchView setBackgroundColor:[UIColor redColor]];
touchView.frame = CGRectMake(point.x-5, point.y-5, 10, 10);
touchView.layer.cornerRadius = 5;
[self addSubview:touchView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[touchView setAlpha:0.0];
[UIView commitAnimations];
[touchView release];  
} 

I’d like to move this code (which works fine in GraphView.m) into the GraphViewController.m for this view but I’m getting 2 errors. The first is that

self.grapher.gLayers 

generates an error saying the ‘Property grapher not found on object of type UIView.’ How would I write this properly in the viewcontroller? I’m currently using

self.view.grapher.gLayers

The second error I’m getting is on the line

touchView.layer.cornerRadius = 15;

The error says ‘Property ‘cornerRadius’ cannot be found in forward class object ‘CALayer *”. Why would this code work in the UIView but not the viewcontroller?

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

    Is grapher a property of your view?

    Did you import <QuartzCore/QuartzCore.h>?

    Edit

    OK. You’re moving this from GraphView to GraphViewController? Does GraphViewController use a xib? You’ll need to change the class of view from UIView to GraphView. With IB, select the View and then change the Custom Class to GraphView.

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

Sidebar

Related Questions

I'm updating some old code that has several POD structs that were getting zero'd
I'm updating some old old code (that works for now, but is using OpenTransport,
I'm working on updating an old app. It has some dependency files that live
I am updating some old c++ code and am finding that many of the
I am updating some code from the old mysql_* functions to PDO. It connects
I have encountered a weird situation while updating/upgrading some legacy code. I have a
Ahoy! I've been looking into updating some old test code in an attempt to
I am updating some older OpenCV code that was written in (I guess) an
Hello! I am updating some C code that copys files with a certain name.
I have inherited a very old database that needs some data to be updated.

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.