Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CFArrayMBS.arrayWithContentsOfFile(file as folderitem) as CFArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method CoreFoundation MBS MacCF Plugin 10.0 Yes No No Yes, macOS only No
Function: 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
Notes:
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.

Feedback, Comments & Corrections

CFArrayMBS.arrayWithContentsOfURL(URL as string) as CFArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method CoreFoundation MBS MacCF Plugin 10.0 Yes No No Yes, macOS only No
Function: Creates and returns an array containing the contents specified by a given URL.
Notes:
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.

Feedback, Comments & Corrections

CFArrayMBS.arrayWithHandle(Handle as Integer) as CFArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method CoreFoundation MBS MacCF Plugin 16.4 Yes No No Yes, macOS only No
Function: Creates a new array object based on a handle value.
Notes: Will retain the reference.

Feedback, Comments & Corrections

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




Links
MBS Xojo blog