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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:00:49+00:00 2026-05-23T15:00:49+00:00

So I have this class called a Cell which is a subclass of CCSprite

  • 0

So I have this class called a Cell which is a subclass of CCSprite then I have three other subclasses of Cell.

In one of the subclasses I am overriding a method called addCellToCell in class Cell:

-(void)addCellToCell:(id)_cell;

And I am trying to do this:

    self = [CCSprite spriteWithFile:@"Jet.png"];
    [self setPosition:ccp(_cell.position.x+5, _cell.position.y)];

Where I am trying to set the object self‘s position (which since it is inheriting from Cell it makes it essentially a modified CCSprite) relative to another Cell subclassed object (potentially from any one of the three subclasses).

But when I do this I get the error:

request for member ‘position’ in ‘_cell’, which is of non-class type ‘objc_object*’

It also suggest I use “->” instead of “.” so I change it to that:

‘struct objc_object’ has no member
named ‘position’

Sorry if it is confusing… Please ask for any clarification if you need some. How can I fix these errors?

Definition of Cell class:

@interface Cell : CCSprite {
}

-(void)addToCell:(id)_cell;

@end
  • 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-23T15:00:49+00:00Added an answer on May 23, 2026 at 3:00 pm

    Cast it to Cell object before using it,

    Cell aCell = (Cell *)_cell;
    

    and then

    [self setPosition:ccp(aCell.position.x+5, aCell.position.y)];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class called MainGame, which is defined like this in my .h:
I have a class called Cell with two properties. One is called Value of
I have a class called SparseMatrix which contain a private vector of type Cell.
I have this class called Table: class Table { public string Name { get
i have this class called MemoryManager, it is supposed to implement a simple smart
I have this class called SiteAsyncDownload.cs Here's the code: public class SiteAsyncDownloader { WebClient
I have this class called PollFrame that extends JFrame in a file called PollFrame.java
I have this small class called City that simply holds some information about a
I have a class called MyClass This class inherits IEquatable and implements equals the
Let's say I have a model class called Project, but instead of this: class

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.