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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:14:06+00:00 2026-05-22T15:14:06+00:00

NOTE: i changed the names, i dont actually have a type letters. in my

  • 0

NOTE: i changed the names, i dont actually have a type letters.

in my root view controller .h, i do

typedef enum {
a,
b,
c,
d,
e }letters;

i have several other classes, most of which need to use this “letters” type. in my root view controller, i use “#import “MyClass.h” to import the class (since i make an instance of it in rootViewController). however, this does not allow MyClass to use the type “letters”.

i tried adding in MyClass.h, “#import rootViewController.h”, but xcode started giving me errors (only sometimes, it was on and off). what is the best way to do this? should i just import the rootViewController to all of the classes that need this “letters” type? is it ok to have both rootViewController importing MyClass and MyClass importing rootViewController?

  • 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-22T15:14:07+00:00Added an answer on May 22, 2026 at 3:14 pm

    If you need to use the enum only in connection with one class, go ahead and include it in that class’s .h file. If you need to use the enum in many different places, you would probably be better served by creating a .h file just to declare the enum, and include that wherever you need it.

    Your errors were probably coming from missing forward declarations. If RootViewController has ivars, properties, or method signatures that refer to MyClass, then there needs to be either a @class MyClass; or an @interface block for MyClass visible before the compiler gets to those ivars, properties, or method signatures. If RootViewController.h and MyClass.h both include the other, then it will work if RootViewController.h is imported first but fail if MyClass.h is imported first.

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

Sidebar

Related Questions

NOTE: I have changed the details provided due to comments provided. The new technical
Note: The Data schema can not be changed. I'm stuck with it. Database: SQLite
NOTE: This is a followup to my question here. I have a program that
I am having trouble getting NCover to properly cover a .dll. I have several
I have the following xml code in a document called note.xml <?xml version="1.0" encoding="ISO-8859-1"?>
Note: I'm not talking about the names of event handlers . I'm talking about
i have a code that works fine with ruby 1.87 but dont works with
So I have a couple of functions that work with a string type I
I have a MySQL table with coordinates; the column names are X and Y.
I get the No Items found toast on the ListActivity. Note: When I change

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.