Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 557283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:00:36+00:00 2026-05-13T12:00:36+00:00

since yesterday I’ve got a bug in my application and I don’t get where

  • 0

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];
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:00:36+00:00Added an answer on May 13, 2026 at 12:00 pm

    It’s possible your preferences do not actually contain the values you asked for – in which case it will not have returned strings, and you could be getting the NSInvalidArgument exception.

    You can check this:

     if (![passworde isKindOfClass:[NSString class]] || ![usernamee isKindOfClass:[NSString class])
      {
        NSLog(@"Some problem with your preferences");
      }
    

    isKindOfClass Documentation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working since yesterday to get this function working, but its just not.
since yesterday is my app not rendering the xfbml Tags (name and picture). Iam
I already opened a bug , but since I need this ready yesterday (typical,
Since yesterday, I am analyzing one of our project with Ndepend (free for most
Since Rails is not multithreaded (yet), it seems like a threaded web framework would
Since yesterday I haven't been able to generate strong name keys using sn.exe or
Since yesterday, during my development I’m experiencing bailout or exit my dreamwever. I was
Since yesterday everytime I open my layout Editor in Eclipse for the Android UI
Since Embarcadero's NNTP server stopped responding since yesterday, I figured I could ask here:
I am receiving a SecurityException since yesterday when I launch the service using signature

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.