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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:03:58+00:00 2026-06-11T04:03:58+00:00

I used to have a class called Constants . In it was this typedef

  • 0

I used to have a class called Constants. In it was this typedef:

typedef enum visible_thing {

    BACKGROUND,
    BACKGROUND_COLOR,
    MAIN_WINDOW

} VISIBLE_THING;

And my, was life rosy! I was importing ‘Constants.h` wherever I needed to access this type, and it all worked.

Then I decided to nuke the Constants class. I took the typedef and I put it in another class, for clarity let’s call it OtherClass. I went through and changed all the imports of Constants.h to imports of OtherClass.h That’s all I did, I didn’t touch any other code. And now the whole thing’s broke!

Methods that worked perfectly with Constants now give me this error: Parse Issue - Expected a type. What the heck? I sure hope someone has some leads on this!

Update: frustratingly, this is one of those problems that just seemed to go away on its own without explanation. I answered my own question, below, with a workaround I’d found that entailed #import-ing the same header multiple times in one file. But today I removed the extra #import, and everything still worked. Arg. Computers!

  • 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-06-11T04:04:00+00:00Added an answer on June 11, 2026 at 4:04 am

    The class that was generating the errors had two other class definitions inside it, helper classes that were only used internally. Apparently that was the root of the problem.

    What I didn’t know was that if you do that, if there is more than one class in a file, you may need to import the same header multiple times.

    Here’s what I did to fix it. I changed this:

    #import "OtherClass.h"
    
    @interface InnerClass
    
    // uses typedef from OtherClass
    
    @end
    
    
    
    @interface MainClass
    
    // uses typedef from OtherClass
    
    @end
    

    To this:

    #import "OtherClass.h"
    
    @interface InnerClass
    
    // uses typedef from OtherClass
    
    @end
    
    #import "OtherClass.h" //<--without this, MainClass won't recognize the typedef 
    
    @interface MainClass
    
    // uses typedef from OtherClass
    
    @end
    

    Which seems clunky and like I may be doing something else wrong, but at least it fixed the issue at hand. Any follow-up comments will be appreciated.

    • 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 CoverFlowClass. I used to do this to create a
I have a class called 'Constants' that I am storing a String variable in.
Suppose I have a class called Foo . This class will be modified by
I have a data model with an entity called Image. This will be used
I have a NSMutableArray (called listOfSites) that is created and used in classA.m. I
I have a class being used in node.js, and I want to pass various
I have a class containing Linq To SQL objects that are used to populate
I have a class that uses XStream and is used as a transfer format
I have a class with a std::map used as a container. I want to
I have a class named CommonCode that is used for stocking all methods I

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.