Quote:
Originally Posted by msencenb
Fairly simple concept.. want to display a modal view and am having some issues with delegation. Here is what I have when I want to present the modal view:
Code:
LoginViewController *lvc = [[LoginViewController alloc] init];
lvc.delegate = self;
[self presentModalViewController:lvc animated:YES];
[lvc release];
Then in that view when I want to dismiss I call:
Code:
[self dismissModalViewControllerAnimated:YES];
I also have this in the .h file @interface of the view in which the modal view is called:
Code:
UIViewController <LoginViewControllerDelegate>
There are two errors:
"Cannot find protocol definition for LoginViewControllerDelegate"
and
"Request for member delegate is not something in structure or union"
Anyone have a solution? Thanks 
|
A view controller doesn't have a delegate by default. The only reason you would need to add a delegate to your LoginViewController is because you've added a delegate property and defined a set of messages (protocol) that the delegate is supposed to handle.
Unless you're LoginViewController defines a delegate property, it doesn't have one.
Also, with this statement:
Code:
UIViewController <LoginViewControllerDelegate>
You are telling the compiler that your view controller supports a "LoginViewControllerDelegate" protocol, but it sounds like you never defined such a protocol.
Unless you have a specific reason for assigning a delegate to your LoginViewController, don't. Unless you've defined a LoginViewControllerDelegate protocol, don't tell the system that your view controller supports it. In other words, get rid of the "<LoginViewControllerDelegate>" part in the definition of your view controller.