Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STTwitter CFNetwork internal error NSURLRequest

After looking at this link API mode error I corrected some code using STTwitter. This eradicated one error but made me notice a new CFNetwork error. Whenever I try to fetch statuses using either getHomeTimelineSinceID or getUserTimelinewithScreenName, the error "CFNetwork internal error (0xc01a:/SourceCache/CFNetwork/CFNetwork-695.1.5/Foundation/NSURLRequest.mm:798)" pops up in the debugger. After debugging I found the error pops right after [r Asynchronous] (line 272 of STTwitterAppOnly.m). I got to this spot by stepping into verifyCredentialsWithSuccessBlock.

The code I am currently using:

   [twitter verifyCredentialsWithSuccessBlock:^(NSString *bearerToken) {

    [twitter getHomeTimelineSinceID:nil
                               count:20
                        successBlock:^(NSArray *statuses) {

                            NSLog(@"-- statuses: %@", statuses);


                            self.twitterFeed = statuses;

                            [self.tableView reloadData];

                        } errorBlock:^(NSError *error) {
                        }];

And I have also tried:

        [twitter getUserTimelineWithScreenName:@"Dandelion_2014"
                              successBlock:^(NSArray *statuses) {

                                  self.twitterFeed = [NSMutableArray arrayWithArray:statuses];

                                  [self.tableView reloadData];

                              } errorBlock:^(NSError *error) {

                                  NSLog(@"%@", error.debugDescription);

                              }];

I'm not sure what is causing this error, does anybody have insight?

like image 326
Gabriel C. Avatar asked Jun 14 '14 19:06

Gabriel C.


1 Answers

I think I found the issue.

iOS 8 raises a runtime warning when setting -[NSURLRequest HTTPMethod] to nil.

I updated STHTTPRequest and STTwitter.

Let me know if it works for you.

like image 57
nst Avatar answered Oct 30 '22 03:10

nst