NSDataWithContentsOfURL data is null after upgrading Xcode 6.4 to Xcode 7.0

Before upgrading to Xcode 6.4, it still works fine.

here is my code

 - (NSArray*)getData{
NSMutableArray *result = [[NSMutableArray alloc] init]; 
    NSString *path = @"http://rmfl.nagasoftware.com/api/plant_by_season.php?lang_code=1&season_id=0";

    if(path){
     NSLog(@"%@",path);
        NSURL *json = [NSURL URLWithString:path]; // jsonString
         NSLog(@"URL is %@",[json absoluteString]);
        NSData *jsonData = [NSData dataWithContentsOfURL:json];

Here is the link to see the image from NSLog.

enter image description here

+4
source share
1 answer

I suspect you also updated iOS 9 if this is a problem.

See: Application Transport Security Technology

The solution is to bring the server to https TLS 1.2 and forward security.

" " URL- , , HTTP-. , - .

+4

Source: https://habr.com/ru/post/1607887/


All Articles