0

Here is situation :

I have ViewController that have SideMenu that need to import

#import "SideMenu.h"

A I've to call the delegate method of ViewController from sidemenu so I've to import ViewController in sidemenu that lead me to error :

Cannot find protocol declaration for 'onClickCategory'

So I've to import both files to each other. How to handle this situation?

@class not work in both class.

Dx Android
  • 61
  • 2
  • 13

1 Answers1

0

As Ben Gottlieb answer here

import brings the entire header file in question into the current file; any files that THAT file #imports are also included. @class, on

the other hand (when used on a line by itself with some class names), just tells the compiler "Hey, you're going to see a new token soon; it's a class, so treat it that way).

Community
  • 1
  • 1
KDeogharkar
  • 10,939
  • 7
  • 51
  • 95
  • it give me error on ' objSideMenu = [[SideMenu alloc] initWithNibName:@"SideMenu" bundle:nil];' Receiver 'SideMenu' for class message is a forward declaration – Dx Android Mar 25 '16 at 11:54