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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:18:48+00:00 2026-06-08T04:18:48+00:00

I don’t know if it is a flaw in XCode or my lack of

  • 0

I don’t know if it is a flaw in XCode or my lack of experience in Obj-C but I have run into an issue trying to make properties in one class that contains the pointer to the other, while the other class has a property containing a pointer to the first class.

I know the above may not be clear but hopefully this example shows what I mean:

//Class Journal.h

@property (strong) JournalVC *JVC

//Class JournalVC.h
//IVar
Journal *_Journal

In both classes I import the header of the other so XCode knows the class of the other. If I dont import the headers it complains it does not know what type the property/IVar should be and wants to replace it with the class it is(JournalVC as Journal vice versa). This also happens when both classes have the import statement for the header of the other.

This does not happen if only one knows of the other. It works when JournalVC is replaced with UIVIewController(its parent class) and no import statement, while the IVar remains the same and that header imports the other.

I think the problem is that both headers are importing each other, which causes confusion with XCode. Is there any other way to let one of the header files know of the class of the property without this issue?

  • 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-08T04:18:49+00:00Added an answer on June 8, 2026 at 4:18 am

    You can use the @class forward declaration. Don’t make a circular header import; instead, just declare the Journal class in the JournalVC header with the line:

    @class Journal;
    

    Then, do the traditional header import in JournalVC.m. See this question for more info.

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

Sidebar

Related Questions

don't know if the title describes anything about what I'm trying to say but
Don't know how to explain it better but i'm trying to get a response
I don't have much PHP experience and I want to know how to best
Don't know why but I can't find a solution to this. I have 3
don't know better title for this, but here's my code. I have class user
Don't know a better title but here is what im trying to do. I
I don't know to explain this but here i go, so i have a
Don't ask me how but I'm in a situation where I have DCPs published
Don't really know how to formulate the title, but it should be pretty obvious
Don't know how to google for such, but is there a way to query

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.