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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:42:37+00:00 2026-05-23T02:42:37+00:00

I am getting the Subscripted value is neither array nor pointer error on a

  • 0

I am getting the “Subscripted value is neither array nor pointer” error on a boolean made from another class that gets allocated in another. After looking up lots of reasons for getting this error, I’m not sure how I can relate it to mine. I’m using the Cocos2D library, but I don’t think it has to do with that.

In another class this is my interface with a property. Just calling it ClassA for this example:

#import <Foundation/Foundation.h>
@interface ClassA : NSObject {
@public

    @public
        BOOL _deactivateLabelToggle;

}

@property(nonatomic, assign) BOOL deactivateLabelToggle;

.m

#import "ClassA.h"

@implementation ClassA
@synthesize deactivateLabelToggle = _deactivateLabelToggle;

BOOL _deactivateLabelToggle[100];

-(id) init{
    self = [super init];
    if (!self) {
        return nil;
    }

    return self;
}

- (void) dealloc{

    [super dealloc];

}   


@end

My main class header

#import "ClassA.h"
@class ClassA;

@interface MainClass : CCLayer {

    ClassA *classA;
}


@property(nonatomic, retain) ClassA *classA;

@end

MainClass.m

#import "MainClass.h"

@implementation MainClass

@synthesize classA;

-(id) init {

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

          classA = [[ClassA alloc] init];

          classA.deactivateLabelToggle[i] = 0; // <---- Error here

    }
    return self;
}
  • 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-23T02:42:38+00:00Added an answer on May 23, 2026 at 2:42 am

    Your deactivateLabelToggle property with this declaration in ClassA:

    @property(nonatomic, assign) BOOL deactivateLabelToggle;
    

    that you access on the // <---- Error here line is indeed neither array nor pointer. Simple BOOL variables can’t be subscripted.

    If you meant to reference the file-global BOOL array in your ClassA.m file, you can’t do it with a synthesized property (and the type needs to be BOOL* instead of BOOL).

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

Sidebar

Related Questions

I'm getting this error ev.c:11: error: subscripted value is neither array nor pointer for
I'm getting the following error in my AutoIt script: Array variable subscript badly formatted.
getting error: ActiveRecord::StatementInvalid (PGError: ERROR: argument of HAVING must be type boolean, not type
I'm getting a strange error when reading my data into an array. My goal
Getting this error while trying to compile a copied code from a Fortran 77
Getting the (hex) error code from an IOException, or regular Exception! Is this possible?
Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the
Getting the above error in following code. How to rectify it. Thanks. Please look
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/

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.