Search code examples
iphoneios5xcode4delegation

multiple .h and .m files, multiple interface definition


sorry, I'm quite new to Xcode, but I'm building a project and am very stuck. I am trying to combine two previous projects, which worked fine, into one project, and am having trouble. Initially the .h files said

@interface ViewController : UIViewController <AVAudioRecorderDelegate> {

and

@interface MusicViewController : UIViewController <MPMediaPickerControllerDelegate> {

As they refer to different interfaces it won't work if I just import the .h and .m files into the one project, as I only have one .xib file which I want them all to work with, I can't simply change this first line in the .h files as then I have multiple interface definitions, and when I try combine these .h files things aren't defined properly. Is there any way to use multiple delegations in the one .h file, that refer to the same .xib file? Or any other way to get around this?

Thanks


Solution

  • You probably want to use the following to refer to several Delegates:

    @interface ViewController:UIViewController <AVAudioRecorderDelegate, MPMediaPickerControllerDelegate> {