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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:56:32+00:00 2026-05-28T01:56:32+00:00

In my iOS5 app, I have NSObject States class, and trying to init it:

  • 0

In my iOS5 app, I have NSObject States class, and trying to init it:

states = [states init];

here is init method in States:

- (id) init
{
    if ((self = [super init]))
    {
        pickedGlasses = 0;
    }

    return self;
}

But there is error in the line states = [states init];

receiver type “States” for instance message is a forward declaration

What does it mean? What am I doing wrong?

  • 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-28T01:56:32+00:00Added an answer on May 28, 2026 at 1:56 am

    That basically means that you need to import the .h file containing the declaration of States.

    However, there is a lot of other stuff wrong with your code.

    • You’re -init’ing an object without +alloc‘ing it. That won’t work
    • You’re declaring an object as a non-pointer type, that won’t work either
    • You’re not calling [super init] in -init.
    • You’ve declared the class using @class in the header, but never imported the class.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITableView in an iOS5.1 app where I set self.tableView.allowsMultipleSelection=YES; The Apple
guys, I have iOS app, which running good on ios5.0, but on 4.3.3 it's
I'm working on an iOS5 app using storyboard, and I have a method in
I have a little iOS5 app that shows images. I click on the image
In an iPhone app for iOS5 I'm trying to create a controller object that
I have recently updated Xcode to use the iOS5 SDK. Since updating my app
I have noticed since upgrading to iOS5 that an audio app I have been
I am working on an iphone app in IOS5 that user storyboards. I have
I have a software-hardware related issue that I'm trying to troubleshoot. My app was
I have an ios5 app developed using storyboards that currently displays a tab bar

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.