Hi,
since yesterday I've got a bug in my application and I don't get where it is. Actually I am pretty sure that I did not change anything and that it worked perfectly yesterday.
I do not intent to publish all of the code but I can post my first ViewController, if you want.
The problem occurs in both ViewControllers. I use the MGTwitterEngine-API to send a message to Twitter. As far as I know the bug causing a crash is located in the following line.
MGTwitterEngine *twiit = [[MGTwitterEngine alloc] initWithDelegate:self];
[twiit setUsername:usernamee password:passworde];
I thought there is nothing wrong about it. Am I wrong? usernamee and passworde are NSStrings.
The console returns:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[MGTwitterEngine setUsername:password:]: unrecognized selector sent to instance 0x3911fb0'
If there are questions or if it's impossible to solve the problem like that i would agree to send my hole code to somebody for check. It is not very complex and it just has to Views. Stil I just send the code to trustworthy persons with many reputations.
In addition I am sure that there is nothing wrong about the MGTwitterEngine since I did not ever change its code. It worked probably and I even copied a fresh MGTwitterEnginge into the project's folder.
Oh and here the UIAction, which reacts on a button and let the app crash:
- (IBAction) post: (id) sender{
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *usernamee;
usernamee = [prefs stringForKey:@"name_preference"];
//everthing works great, I checked, that usernamee got the right Nsstring from the preference
NSString *passworde;
passworde = [prefs stringForKey:@"password_preference"];
MGTwitterEngine * twitter1 = [[MGTwitterEngine alloc] initWithDelegate:self];
[twitter1 setUsername:usernamee password:passworde];
NSLog(@"sendUpdate: connectionIdentifier = %@", [twitter1 sendUpdate:[@""stringByAppendingString:twittermessage.text]] ); //It is not important, if I use sendUpdate, getDirectMessagesSinceID and so on...
loadingActionSheet = [[UIActionSheet alloc] initWithTitle:@"Posting to Twitter..." delegate:nil
cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
[loadingActionSheet showInView:self.view];
}