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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:39:41+00:00 2026-05-15T09:39:41+00:00

I have a few properties defined in my header file like so @property (assign)

  • 0

I have a few properties defined in my header file like so

@property (assign) bool connectivity_N;
@property (assign) bool isConnected_N;

In my implementation file I have an init and the synthesized properties like so

@implementation Map
@synthesize connectivity_N;
@synthesize isConnected_N;

a init to set the initial values like so

-(id) init
{
    if( (self=[super init]) ) 
    {

        //initialise default properties
        self.connectivity_N=NO;
            self.isConnected_N=NO;
    }
    return self;
}

I’m running into an error that states Error: accessing unknown ‘connectivity_N’ class method. In this public method within the class

+(bool) isConnectable:(directions) theDirection{

    bool isTheDirectionConnectable= NO;
    switch (theDirection) {
        case north:
            isTheDirectionConnectable= self.connectivity_N;
            break;

I’m not sure why is this so as I’m trying to grab the value of the property. According to the apple developer documentation “The default names for the getter and setter methods associated with a property are propertyName and setPropertyName: respectively—for example, given a property “foo”, the accessors would be foo and setFoo:”

That has given me a clue that I’ve done something wrong here, I’m fairly new to objective C so would appreciate anyone who spends the time to explain this to me.

Thanks!

  • 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-15T09:39:41+00:00Added an answer on May 15, 2026 at 9:39 am

    You’ve defined isConnectable: as a class method by prefixing it with +. Probably you want it to be an instance method — start it with a minus sign - instead.

    You can’t access self within class methods, because there is no object instance.

    Although self exists in class methods, it doesn’t refer to an object instance — there is no object — so you can’t access object properties. (Thanks to Dave DeLong for the correction.)

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

Sidebar

Related Questions

This is a follow-up to this question . How do I display properties defined
I need to convert several Java classes to C#, but I have faced few
I'm implementing IXMLSerializable in one of my classes. It contains a few numeric properties
I currently have a solution with multiple projects that mostly use the same classes.
I have a Silverlight application with a Silverlight-enabled WCF service. The service passes along
[I posted a similar question on serverfault.com, but had very little feedback so trying
I want to do the following public abstract class MyAbstractClass { public static abstract
I'm trying to create a virtual wiki but I already struggle with In your
I'm working on a small online game where there is a need to store

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.