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

  • Home
  • SEARCH
  • 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 5838585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:29:01+00:00 2026-05-22T11:29:01+00:00

I’m developing a Twitter app and I’m having problems with adding tweets to an

  • 0

I’m developing a Twitter app and I’m having problems with adding tweets to an NSArray. The problem is I get the tweets, and all the content ok, but the last query i got is just for control, so it doesn’t contains the object “tweet” (which is the tweet content). I have tried stopping it if it detects the control query but no luck. This is the normal search query:

See dictionary: {
    "created_at" = 1305363612;
    "from_user" = IamDeShayDenise;
    "from_user_id" = 123375840;
    "from_user_id_str" = 123375840;
    geo = "";
    id = 69326131068813312;
    "id_str" = 69326131068813312;
    "iso_language_code" = en;
    metadata =     {
        "result_type" = recent;
    };
    "profile_image_url" = "http://a3.twimg.com/profile_images/1336852311/110302-003005_normal.jpg";
    source = "web";
    "source_api_request_type" = 33;
    text = "@LondonBlackk Yeah....and Yes I was With My Mommy and Nana!!! && Still Pulling All The Guys...LoL";
    "to_user" = LondonBlackk;
    "to_user_id" = 172117314;
    "to_user_id_str" = 172117314;
}


In that one I get the text object ok and I can read it. The problem comes when I get this:

See dictionary: {
    "source_api_request_type" = 33;
}


Or this:

See dictionary: {
    "completed_in" = "0.027116";
    "max_id" = 69324964586725376;
    "max_id_str" = 69324964586725376;
    "next_page" = "?page=2&max_id=69324964586725376&q=lol";
    page = 1;
    query = lol;
    "refresh_url" = "?since_id=69324964586725376&q=lol";
    "results_per_page" = 15;
    "since_id" = 1;
    "since_id_str" = 1;
    "source_api_request_type" = 33;
    warning = "since_id removed for pagination.";
}


And this is the code I use for filling the arrays:

tweets = [[NSMutableArray alloc] init];
    usernames = [[NSMutableArray alloc] init];
     for(NSDictionary *d in searchResults) {

     NSLog(@"See dictionary: %@", d);
     Tweet *author = [d objectForKey:@"from_user"];
     Tweet *tweet = [d objectForKey:@"text"];
     if ([d objectForKey:@"from_user"] == nil || [d objectForKey:@"text"] == nil){
         NSLog(@"end");
     } 
    [usernames addObject:author];
    [tweets addObject:tweet];

     [author release];
     [tweet release];
 }

I don't know what can be wrong 🙁

Thanks in advance 😀

*UPDATE:*Got it working in this way


if ([d objectForKey:@"from_user"] == nil || [d objectForKey:@"text"] == nil){
             NSLog(@"end");
         } else {
             [usernames addObject:author];
             [tweets addObject:tweet];
         }


instead of:


if ([d objectForKey:@"from_user"] == nil || [d objectForKey:@"text"] == nil){
             NSLog(@"end");
         } 
    [usernames addObject:author];
    [tweets addObject:tweet];


Then the other problem was also solved. Thanks y'all!!

  • 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-22T11:29:01+00:00Added an answer on May 22, 2026 at 11:29 am

    The way of solving it is this:

    
    if ([d objectForKey:@"from_user"] == nil || [d objectForKey:@"text"] == nil){
                 NSLog(@"end");
             } else {
                 [usernames addObject:author];
                 [tweets addObject:tweet];
             }
    

    instead of:

    
    if ([d objectForKey:@"from_user"] == nil || [d objectForKey:@"text"] == nil){
                 NSLog(@"end");
             } 
        [usernames addObject:author];
        [tweets addObject:tweet];

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.