Platforms to show: All Mac Windows Linux Cross-Platform

Back to CFArrayMBS class.

CFArrayMBS.arrayWithContentsOfFile(file as folderitem) as CFArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreFoundation MBS MacCF Plugin 10.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an array containing the contents of the file specified by a given path.
Example
dim a as new CFMutableArrayMBS

a.Append NewCFStringMBS("Hello")
a.Append NewCFStringMBS("World")

dim f as FolderItem = SpecialFolder.Desktop.Child("test.xml")

if a.writeToFile(f, true) then
MsgBox "OK"
else
MsgBox "Failed"
end if

dim x as CFArrayMBS = CFArrayMBS.arrayWithContentsOfFile(f)
MsgBox x.XML.str

file: The path to a file containing a string representation of an array produced by the writeToFile method.

Returns an array containing the contents of the file specified by aPath. Returns nil if the file can't be opened or if the contents of the file can't be parsed into an array.

The array representation in the file identified by aPath must contain only property list objects (NSString/CFString, NSData/CFData, NSArray/CFArray, or NSDictionary/CFDictionary objects).

Returns nil on any error.

CFArrayMBS.arrayWithContentsOfURL(URL as string) as CFArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreFoundation MBS MacCF Plugin 10.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an array containing the contents specified by a given URL.

URL: The location of a file containing a string representation of an array produced by the writeToURL method.

Returns an array containing the contents specified by aURL. Returns nil if the location can't be opened or if the contents of the location can't be parsed into an array.

The array representation at the location identified by aURL must contain only property list objects (NSString/CFString, NSData/CFData, NSArray/CFArray, or NSDictionary/CFDictionary objects).

Returns nil on any error.

CFArrayMBS.arrayWithHandle(Handle as Integer) as CFArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreFoundation MBS MacCF Plugin 16.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new array object based on a handle value.

Will retain the reference.

The items on this page are in the following plugins: MBS MacCF Plugin.


The biggest plugin in space...