I'm learning objective-c and cocoa touch at the same time as building an app so I've got a fairly simple question (I think), sorry I don't have enough brownie points on the site to show a visual diagram of my site.
But let me explain, I have the following
- Main ViewController
- ViewController A
- ViewController B
- ViewController C
- ViewController 1
- ViewController 2
ViewController A, B and C all have protocol delegates that is being used by Main ViewController.
ViewController 1 and 2 have protocol delegates that is being used by ViewController C.
However I also need ViewController C to be a delegate for Main ViewController.
Because of this I recently created a protocol delegate within Main ViewController, however when trying to assign ViewController C as the delegate I'm getting errors, more specially when trying to import the header file of Main ViewController into View Controller C I'm getting a failed compilation message for the following reasons
- Main ViewControllers header file can no longer find the protocol for ViewController C
- Expected specifier-qualifier-list before 'ViewController C'
Is what I am trying to accomplish possible? Can two view controllers bd delegates for one another? And if not what would be an idea way of accomplishing what I am doing?
Within ViewController C I tried an alternative, having a method to call Main ViewController by creating a pointer of the parent view controller, creating an instance of ViewController B (this is why I want the delegate to work) then adding ViewControler B's view to the new pointer I created, this compiles but doesn't work (I'll try and find out why, this isn't what I'm asking here).
Many thanks, I'm really appreciating this site for a while now