Is there a way to get readable information from the following NSErrorPointer
in Swift?
var downloadErrorPointer = NSErrorPointer();
self.rssString = String(contentsOfURL: url!, encoding: NSUTF8StringEncoding, error: downloadErrorPointer);
Is there a way to get readable information from the following NSErrorPointer
in Swift?
var downloadErrorPointer = NSErrorPointer();
self.rssString = String(contentsOfURL: url!, encoding: NSUTF8StringEncoding, error: downloadErrorPointer);
You're not supposed to directly use an instance of NSErrorPointer. Instead you create an optional NSError variable and pass it's address using the
&
operator, just as in Objective-C:But with Swift 2 there is new syntax for error handling so this cannot be used any more. The new syntax is the following: