ios - NSData only has class method "NSData.dataWithContentsOfMappedFile(<#path: String#>)" -
Whenever I try to enter NSData.dataWithContentsOfURL ()
, Xcode does not recognize it is. Only one identifies this
NSData.dataWithContentsOfMappedFile (& lt; # path: string # & gt;)
Here it looks like:
When the OBJC has a SWIFT import interface, then it considers the methods of the factory category that use the coca naming conventions in the initial form.
In general, the column method on nSThing
is changed to thingWithNumber:
initiator init (number :)
and you Beginner with the syntax and class name says: NSThing (number: 42)
. In the case of those who have a item number:
-style class method and an initWithNumber:
-style instance method that does the same thing, for the same swift initiator Both maps
In this case, dataWithContentsOfURL:
and initWithContentsOfURL:
become init? (Content of URL)
. You can find more of these conversions Swift interface in Xcode (command-click on class name) or in class
Comments
Post a Comment