5

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?

Community
  • 1
  • 1
Gabriel C.
  • 77
  • 9
  • I don't know for sure, but there may be something wrong in [STHTTPRequest](https://github.com/nst/STTwitter/blob/master/STTwitter/Vendor/STHTTPRequest.m). – nst Jun 20 '14 at 07:14
  • 1
    Your exactly right, the exception is being thrown by [request setHTTPMethod:_HTTPMethod] (line 357, requestByAddingCredentialsToURL:) Going to do some more digging to see if I can find the issue. – Gabriel C. Jun 20 '14 at 19:02
  • 1
    After some more investigation and a bit of looking into the Apple documentation, it looks like `[setHTTPMethod]` is obsolete in iOS 8 (I am using the beta). I ran the same code on an older device using iOS 7.1 and the error did not come up. However, neither did a tableview of twitter feed entries. Going to keep looking. – Gabriel C. Jun 24 '14 at 16:42

1 Answers1

5

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.

nst
  • 3,862
  • 1
  • 31
  • 40
  • 2
    Quick link to the commit in question (for STHTTPRequest, which worked well for me): https://github.com/nst/STHTTPRequest/commit/2b7ef629475e0c8a73a6314f5ac1f4a4c79ba083 – Joshua Warner Oct 01 '14 at 16:56
  • 1
    sorry took me awhile to get back to this, work caught up to me and my side projects got put on hold. Thanks so much for the update! – Gabriel C. Oct 06 '14 at 14:36