Domanda

I'm trying to access an instance of NSURLSessionConfiguration
I've tried following statements to retrieve instance of NSURLSessionConfiguration.

Statement 1.

 NSURLSessionConfiguration *aConfig = 
     [NSURLSessionConfiguration defaultSessionConfiguration];

Above statement returns nil

Statement 2.

 NSURLSessionConfiguration *aConfig = 
     = [[NSURLSessionConfiguration alloc] init];

Above statement also returns nil.

Can anybody tell me whats wrong with NSURLSessionConfiguration class?

enter image description here

È stato utile?

Soluzione

It's because you are using this for iOS < 7.0. If you can see it in docs you will find this NS_CLASS_AVAILABLE(10_9, 7_0) which means that it's available in iOS 7.0.

So I'll suggest you to use simulator or device running iOS 7

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top