Note that there are some explanatory texts on larger screens.

plurals
  1. POtextFieldShouldReturn - some methods in completionHandler are never called
    primarykey
    data
    text
    <p>I have a UITextField which lets the user enter a custom Album name for Facebook Photos. Once textFieldShouldReturn, I take the textField.text and send it to Facebook. Once the completion handler is called, I would like to update my model and reload the data in my tableView.</p> <p>My problem is that some lines of my completionHandler are never called. I marked all lines with the debugger and once I step through the code line-by-line, some of these lines are never called, especially not the tableView reload method.</p> <p>Am I doing something wrong thread-wise? Why is my completionHandler in parts cancelled and never called?</p> <p>Here's my code:</p> <pre><code>-(BOOL)textFieldShouldReturn:(UITextField *)textField { NSString *newAlbumName; newAlbumName = textField.text; NSMutableDictionary* parameters = [NSMutableDictionary dictionary]; [parameters setObject:newAlbumName forKey:@"name"]; [parameters setObject:newAlbumName forKey:@"message"]; FBRequest* request = [FBRequest requestWithGraphPath:@"me/albums" parameters:parameters HTTPMethod:@"POST"]; FBRequestConnection *connection = [[FBRequestConnection alloc] init]; [connection addRequest:request completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { if (!error) { NSDictionary *newAlbum; [newAlbum setValue:newAlbumName forKey:@"name"]; [self.albums addObject:newAlbum]; NSLog(@"created: %@", [newAlbum objectForKey:@"name"]); [self.tableView reloadData]; } else { NSLog(@"Error: %@", error.userInfo); } }]; [connection start]; [textField resignFirstResponder]; [textField removeFromSuperview]; return YES; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload