1

I am performing a facebook people search graph request like so:

-(void)searchFBFor:(NSString*)query {


     NSString *q = [NSString stringWithFormat:@"search?q=%@&type=user", [query stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
     NSLog(@"%@", q);

[FBRequestConnection startWithGraphPath:q
                      completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                          if(error) {
                              NSLog(@"Error: %@", error);
                              return;
                          }
                          else {
                              NSLog(@"%@", result);
                          }
                      }];


}

The request works and returns results if my query is something like @"mark" but there are never results for a first and last name (ie. @"mark+smith" OR @"mark smith").

Does anyone know why this may be? Is it possible that I need special permissions I have not considered?

Many thanks.

Zigglzworth
  • 6,645
  • 9
  • 68
  • 107
  • I guest the problem is that the function `stringByApp...` is not escaping properly, take a look to this other question and its answers http://stackoverflow.com/questions/659602/objective-c-html-escape-unescape to solve this – tkanzakic Apr 10 '13 at 14:13
  • If I use + there is nothing to escape. I am logging the query and it looks fine so I don't think this is the problem... – Zigglzworth Apr 10 '13 at 16:40

0 Answers0