Search code examples
objective-cios9xcode7warnings

xcode 7 Objective c Warning - Null passed to a callee that requires a non-null argument


After Updating XCODE 7, I'm getting this warning, I am trying to get rid of this but I can't find a proper solution:

CFRelease(CFNetworkCopyProxiesForURL((CFURLRef)theURL, NULL));

Warning is:

Null passed to a callee that requires a non-null argument


Solution

  • Found a hack to get rid of this warning

     NSDictionary *proxySettings = NSMakeCollectable([(NSDictionary *)CFNetworkCopySystemProxySettings() autorelease]);
        CFRelease(CFNetworkCopyProxiesForURL((CFURLRef)theURL, (CFDictionaryRef)proxySettings));