You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2014/09/25 00:38:35 UTC

[jira] [Commented] (CB-7631) CDVUrlProtocol - the iOS 8 NSHttpUrlResponse is not initialized with the statuscode

    [ https://issues.apache.org/jira/browse/CB-7631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146998#comment-14146998 ] 

Shazron Abdullah commented on CB-7631:
--------------------------------------

Update: we should remove usage of CDVHTTPURLResponse. 

As you can see the init function where you can specify the statusCode has been in there since iOS 5, so we can safely use it now.
{code}
-(id)initWithURL:(NSURL*) url statusCode:(NSInteger) statusCode HTTPVersion:(NSString*) HTTPVersion headerFields:(NSDictionary*) headerFields NS_AVAILABLE(10_7, 5_0);
{code}

The "iOS 8" fix was just to fix the build warning, which now appears when building with iOS 8 SDK. But the real problem was we didn't update our usage. We probably needed CDVHTTPURLResponse for iOS 4 and below.

> CDVUrlProtocol - the iOS 8 NSHttpUrlResponse is not initialized with the statuscode
> -----------------------------------------------------------------------------------
>
>                 Key: CB-7631
>                 URL: https://issues.apache.org/jira/browse/CB-7631
>             Project: Apache Cordova
>          Issue Type: Sub-task
>          Components: iOS
>            Reporter: Shazron Abdullah
>
> https://github.com/apache/cordova-ios/blob/b06ca8db4288f47e99f32294080106884e236d47/CordovaLib/Classes/CDVURLProtocol.m#L217-L220
> Init using:
> https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSHTTPURLResponse_Class/index.html#//apple_ref/occ/instm/NSHTTPURLResponse/initWithURL:statusCode:HTTPVersion:headerFields:



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)