Currently I'm working on an iPhone app that asks the user for login information, verifies this information and presents the user with a table view of their information.
On launch the application delegate launches an empty table view along with the modal view to ask for login credentials. The login credentials consist of a standard username/password field and a button to send the information to a server.
When the users credentials have been verified I want to send a message to the TableView beneath the LoginView that says 'hey, the users credentials have been verified, could you please gather all the data for this user and dismiss the view controller.' I looked at a few tutorials from Apple, specifically the Recipe Table View example, (uses delegation to add recipes) however the method I'm implementing is never executed and was hoping someone could shed some light on my problem.
LoginViewController.h
@protocol GatherDataDelegate;
@interface LoginViewController : UIViewController {
//lots of ivars
id <GatherDataDelegate> delegate;
//more ivars
}
//other properties
@property (nonatomic, assign) id <GatherDataDelegate> delegate;
@end
@protocol GatherDataDelegate <NSObject>
- (void)gatherForUserName:(NSString *)userName gatherForPassword:(NSString *)password;
@end
LoginViewController.m
else if ([dataString isEqualToString:@"Credentials Verified"]){
[self.delegate gatherForUserName:username gatherForPassword:password]
}
TableView.h
@interface RootViewController : UITableViewController <GatherDataDelegate>
//ivar and properties
TableView.h
- (void)gatherForUserName:(NSString *)userName gatherForPassword:(NSString *)password;
NSLog(@"calling gather");
}
It's probably something stupid that I'm missing, like I said, I don't have a lot of experience using delegation, but I see a lot of posts about it. Thanks for any help in advance and taking the time to read this.