Properties continue to confuse me to no end...
I have a view controller which contains the properties username and password (both NSStrings.)
These are both synthesized in the main...
and then set in the initWithStyle
Later on, a module view controller is added to the initial view controller.
I would like this modual view controller to display the username and password, but it wasn't working. So I commented out the lines telling it to do that and instead have a simple NSLog to make sure it gets the username and password. Here's that code:
This gets me the error: accessing unknown 'password' getter method
I don't understand. The delegate of composeViewController is userTableController, shouldn't self.delegate.password just grab the password then? I'm either using delegates or properties (or both) incorrectly... I still don't understand either of them particularly well and I tend to just copy and paste example code for them without understanding why.
*** The actual code has the actual password in it... I'm not copying it down for obvious security reasons.
I have a view controller which contains the properties username and password (both NSStrings.)
Code:
@interface UserTableController : UITableViewController <ComposeViewControllerDelegate>
{
NSArray *users;
NSOperationQueue *infoQueue;
NSMutableArray *userInfoArray;
NSMutableArray *spinnerArray;
NSString *username;
NSString *password;
}
- (void) loadInfo:(NSString *)i;
- (void) compose;
@property (readwrite, assign) NSString *username;
@property (readwrite, assign) NSString *password;
@end
These are both synthesized in the main...
Code:
@synthesize username;
@synthesize password;
and then set in the initWithStyle
Code:
self.username = @"ArtOfWarfare";
self.password = @"***";
Later on, a module view controller is added to the initial view controller.
Code:
ComposeViewController *composeViewController = [[ComposeViewController alloc] init];
composeViewController.delegate = self;
[self presentModalViewController:composeViewController animated: YES];
[composeViewController release];
I would like this modual view controller to display the username and password, but it wasn't working. So I commented out the lines telling it to do that and instead have a simple NSLog to make sure it gets the username and password. Here's that code:
Code:
NSLog (@"I say the username is %@ and the password is %@.", self.delegate.username, self.delegate.password);
This gets me the error: accessing unknown 'password' getter method
I don't understand. The delegate of composeViewController is userTableController, shouldn't self.delegate.password just grab the password then? I'm either using delegates or properties (or both) incorrectly... I still don't understand either of them particularly well and I tend to just copy and paste example code for them without understanding why.
*** The actual code has the actual password in it... I'm not copying it down for obvious security reasons.