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

I have a few classes and I am having problems accessing properties defined in
I have a DTD and I would like to limit a few attribute properties'
I have a few DependencyProperties defined in some custom user controls. I'd like for
I have a PHP class with a few static properties like so: static public
So I have a few properties that I'm using in some sample code I'm
Does this smell? I have a few properties you can only set once. They
I have a class with few properties in it and for few reasons i
I have a few computationally expensive properties on some classes. These properties do not
I have an IAddress class with a few properties. I then have a concrete
I have a few basic questions regarding the syntax and usage of properties in

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.