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,391
  • 5
  • 41
  • 73
Maurice
  • 1,466
  • 1
  • 13
  • 33

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,398
  • 2
  • 19
  • 36