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 8540087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:31:10+00:00 2026-06-11T11:31:10+00:00

I am using MGtwitterengine in iPhone , I want to use USER search API

  • 0

I am using MGtwitterengine in iPhone , I want to use USER search API http://api.twitter.com/1/users/search.json?q={username} but I don’t find any method for this in MGTwitterengine. how can I use this API in iphone to get users.
Thanks

  • 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-06-11T11:31:12+00:00Added an answer on June 11, 2026 at 11:31 am

    Use like This :-

    - (void)searchforTwUser {
        OAToken *access_token = [[OAToken alloc] initWithKey:[tEngine oauthKey] secret:[tEngine oauthSecret]];
        OAConsumer *aconsumer = [[OAConsumer alloc] initWithKey:kOAuthConsumerKey
                                secret:kOAuthConsumerSecret];
        OADataFetcher *fetcher = [[OADataFetcher alloc] init];
    
        NSString *spaceString=@" ";
        NSCharacterSet * set = [[NSCharacterSet characterSetWithCharactersInString:self.searchName] invertedSet];
    
        if ([spaceString rangeOfCharacterFromSet:set].location == NSNotFound) 
       {
            NSString *Name = [self.searchName stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
           NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.twitter.com/1/users/search.json?q=%@",Name]];
           NSLog(@"search name 1 is ..................................... %@",url);
           OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL:url
                                                                          consumer:aconsumer token:access_token realm:nil
                                                                 signatureProvider:nil];
           [request setHTTPMethod:@"GET"];
           [fetcher fetchDataWithRequest:request 
                                delegate:self
                       didFinishSelector:@selector(searchTicket:didFinishWithData:)
                         didFailSelector:@selector(searchTicket:didFailWithError:)];
           [request release];
    
        }
            else
            {
                NSString *addStr = @"%20";
                NSString *firstCapChar = [[searchName substringToIndex:1] capitalizedString];
                NSString *cappedString = [searchName stringByReplacingCharactersInRange:NSMakeRange(0,1) withString:firstCapChar];
                NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.twitter.com/1/users/search.json?q=%@%@",cappedString,addStr]];
                NSLog(@"search name 2 is ..................................... %@",url);
                OAMutableURLRequest *request = [[OAMutableURLRequest alloc] initWithURL:url
                                                                               consumer:aconsumer token:access_token realm:nil
                                                                      signatureProvider:nil];
                [request setHTTPMethod:@"GET"];
                [fetcher fetchDataWithRequest:request 
                                     delegate:self
                            didFinishSelector:@selector(searchTicket:didFinishWithData:)
                              didFailSelector:@selector(searchTicket:didFailWithError:)];
                [request release];
    
            }
        [access_token release];
        [aconsumer release];
    }
    - (void) searchTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data {
    
        NSString *response = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        NSDictionary *dict = [response objectFromJSONString];
        NSLog(@"Dict %@",dict);
        [twSearchArray removeAllObjects];
        if (twSearchArray != nil) {
            [twSearchArray release];
            twSearchArray = nil;
        }
        twSearchArray = (NSMutableArray *)dict;
        NSLog(@"Twitter %@",twSearchArray);
        self.twLoaded  = YES;
        [twSearchArray retain];
        [self prepareSearchResults];    
        [response release];
    }
    
    - (void) searchTicket:(OAServiceTicket *)ticket didFailWithError:(NSData *)error {
    
    
        NSLog(@"Errors is %@",error.description);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MGTwitterEngine for integrate Twitter on my iPhone application. so i want
I am using Ben Gottlieb his implementation of MGTwitterEngine and OAuth (https://github.com/bengottlieb/Twitter-OAuth-iPhone). When I
I'm working on a twitter app for the iphone using oAuth/MGTwitterEngine The source it's
I am using MGTwitterEngine for iPhone to support twitter, I am getting error(403) while
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
I've converted from using MGTwitterEngine to the new iOS 5.0 twitter API. My app
I'm using MGTwitterEngine to add Twitter functionality to my app. It's very easy to
I'm using MGTwitterEngine for an iPhone app. I've managed to get it to send
I'm using Matt Gemmell's amazing MGTwitterEngine for an iPhone project, and my lack of
I am using Twitter+OAuth which uses MGTwitterEngine and SAOAuthTwitterEngine. My app works great in

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.