multiple delegates give warning

62 Views Asked by At

This is not a serious bug I'm just wondering because XCode is throwing me a warning when I'm trying to do 2 delegates from one view. my view interface declaration looks like this

@interface C4WorkSpace : C4CanvasController<UITextViewDelegate, UIImagePickerControllerDelegate>

and then I have a UIImagePicker that goes like this

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;

and a UITextViewDelegate like this

userNameField = [[UITextView alloc] initWithFrame:textViewFrame];
userNameField.delegate = self;

I'm rather new to delegates and basically all that code is made up by using code from somebody else so I'm not sure I completely understand the concepts of delegates.

The warning I get is: "Assigning to 'id' from incompatible type 'C4Workspace *const__strong'"

Is it that I need to delegate to something else then self? If so to what? Or is it a C4issue?

1

There are 1 best solutions below

0
On

so the magic is just adding UINavigationControllerDelegate to the interface declaration. It looks like this then

@interface C4WorkSpace : C4CanvasController<UITextViewDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate>

thanks everyone for the help in the comments!