1

I have a Xcode project where I have to transfer Data from my SettingsViewController to my ViewController, the Problem is that I have to implement my SettingsViewController.h in my ViewController, because it gets pushed out of that - but to send data from the SettingsViewController to ViewController I have to implement the ViewController in SettingsViewcontroller too thats when the Program gets stuck - it's not possible having a circular #import reference, isn´t it?

Dan
  • 9,257
  • 5
  • 40
  • 72
Maurice
  • 1,448
  • 1
  • 13
  • 31

1 Answers1

4

Use forward declaration in all the .h files then and import the files in .m files

Check this question Objective-C: Forward Class Declaration

A forward declaration looks like this:

@class SettingsViewController;
Community
  • 1
  • 1
Mahmoud Fayez
  • 3,350
  • 2
  • 18
  • 34