You have an "import loop" because "SuperViewController.h" imports "SubViewController.h" and vice versa.
Removing #import "SuperViewController.h" in "SubViewController.h" should fix the problem.
If you really need this class to declare in "SubViewController.h", use @class SuperViewController; to avoid import cycle.
Note: The declaration of the <SubViewControllerDelegate> protocol is probably not necessary in the "SuperViewController.h" public interface.
In "SuperViewController.h" declare the class as
@interface SuperViewController : UIViewController
In "SuperViewController.m" define the class extension with the protocol:
@interface SuperViewController () <SubViewControllerDelegate> @end
source share