One Logo Pool Ball
Foundation · IOS API REFERENCE

NSDictionary

class · SDK 27.1

class NSDictionary

Members (51)

init · iOS 8.0+

init

TypeScript
static initDictionary(otherDictionary: NSDictionary): NSDictionary
Swift declaration
@objc(__swiftInitWithDictionary_NSDictionary:) dynamic convenience init(dictionary otherDictionary: NSDictionary)

Initializes a newly allocated dictionary and adds to it objects from another given dictionary. - Returns: An initialized dictionary--which might be different than the original receiver--containing the keys and values found in `otherDictionary`.

init

init

TypeScript
static initObjectForKey(object: unknown, key: SDKHandle): NSDictionary
Swift declaration
convenience init(object: Any, forKey key: any NSCopying)
static · iOS 6.0+

sharedKeySet

TypeScript
static sharedKeySet(keys: Array<SDKHandle>): unknown
Swift declaration
class func sharedKeySet(forKeys keys: [any NSCopying]) -> Any
method

allKeys

TypeScript
allKeysFor(anObject: unknown): Array<unknown>
Swift declaration
func allKeys(for anObject: Any) -> [Any]
method

description

TypeScript
descriptionWithLocale(locale?: (unknown) | null): string
Swift declaration
func description(withLocale locale: Any?) -> String
method

description

TypeScript
descriptionWithLocaleIndent(locale: (unknown) | null, level: number): string
Swift declaration
func description(withLocale locale: Any?, indent level: Int) -> String
method · iOS 4.0+

enumerateKeysAndObjects

TypeScript
enumerateKeysAndObjects(block: ((arg0: unknown, arg1: unknown, arg2: NativeOut<boolean>) => void)): void
Swift declaration
func enumerateKeysAndObjects(_ block: (Any, Any, UnsafeMutablePointer<ObjCBool>) -> Void)
method · iOS 4.0+

enumerateKeysAndObjects

TypeScript
enumerateKeysAndObjectsOptionsUsing(opts: NSEnumerationOptions, block: ((arg0: unknown, arg1: unknown, arg2: NativeOut<boolean>) => void)): void
Swift declaration
func enumerateKeysAndObjects(options opts: NSEnumerationOptions = [], using block: (Any, Any, UnsafeMutablePointer<ObjCBool>) -> Void)
method

fileCreationDate

TypeScript
fileCreationDate(): (globalThis.Date) | null
Swift declaration
func fileCreationDate() -> Date?
method

fileExtensionHidden

TypeScript
fileExtensionHidden(): boolean
Swift declaration
func fileExtensionHidden() -> Bool
method

fileGroupOwnerAccountID

TypeScript
fileGroupOwnerAccountID(): (NSNumber) | null
Swift declaration
func fileGroupOwnerAccountID() -> NSNumber?
method

fileGroupOwnerAccountName

TypeScript
fileGroupOwnerAccountName(): (string) | null
Swift declaration
func fileGroupOwnerAccountName() -> String?
method

fileHFSCreatorCode

TypeScript
fileHFSCreatorCode(): SDKHandle
Swift declaration
func fileHFSCreatorCode() -> OSType
method

fileHFSTypeCode

TypeScript
fileHFSTypeCode(): SDKHandle
Swift declaration
func fileHFSTypeCode() -> OSType
method

fileIsAppendOnly

TypeScript
fileIsAppendOnly(): boolean
Swift declaration
func fileIsAppendOnly() -> Bool
method

fileIsImmutable

TypeScript
fileIsImmutable(): boolean
Swift declaration
func fileIsImmutable() -> Bool
method

fileModificationDate

TypeScript
fileModificationDate(): (globalThis.Date) | null
Swift declaration
func fileModificationDate() -> Date?
method

fileOwnerAccountID

TypeScript
fileOwnerAccountID(): (NSNumber) | null
Swift declaration
func fileOwnerAccountID() -> NSNumber?
method

fileOwnerAccountName

TypeScript
fileOwnerAccountName(): (string) | null
Swift declaration
func fileOwnerAccountName() -> String?
method

filePosixPermissions

TypeScript
filePosixPermissions(): number
Swift declaration
func filePosixPermissions() -> Int
method

fileSize

TypeScript
fileSize(): number
Swift declaration
func fileSize() -> UInt64
method

fileSystemFileNumber

TypeScript
fileSystemFileNumber(): number
Swift declaration
func fileSystemFileNumber() -> Int
method

fileSystemNumber

TypeScript
fileSystemNumber(): number
Swift declaration
func fileSystemNumber() -> Int
method

fileType

TypeScript
fileType(): (string) | null
Swift declaration
func fileType() -> String?
init

init

TypeScript
static init(): NSDictionary
Swift declaration
init()
init

init

TypeScript
static initCoder(coder: NSCoder): (NSDictionary) | null
Swift declaration
init?(coder: NSCoder)
init · iOS 2.0+ · Deprecated in iOS 100000.0

init

TypeScript
static initContentsOfFile(path: string): (NSDictionary) | null
Swift declaration
convenience init?(contentsOfFile path: String)
init · iOS 2.0+ · Deprecated in iOS 100000.0

init

TypeScript
static initContentsOf(url: string): (NSDictionary) | null
Swift declaration
convenience init?(contentsOf url: URL)
init · iOS 11.0+

init

TypeScript
static initContentsOfError(url: string, error: void): NSDictionary
Swift declaration
convenience init(contentsOf url: URL, error: ()) throws
init

init

TypeScript
static initDictionary32275(otherDictionary: NativeMap<unknown, unknown>): NSDictionary
Swift declaration
convenience init(dictionary otherDictionary: [AnyHashable : Any])
init

init

TypeScript
static initDictionaryCopyItems(otherDictionary: NativeMap<unknown, unknown>, flag: boolean): NSDictionary
Swift declaration
convenience init(dictionary otherDictionary: [AnyHashable : Any], copyItems flag: Bool)
init

init

TypeScript
static initObjectsForKeys(objects: Array<unknown>, keys: Array<SDKHandle>): NSDictionary
Swift declaration
convenience init(objects: [Any], forKeys keys: [any NSCopying])
init

init

TypeScript
static initObjectsForKeysCount(objects: (SDKHandle) | null, keys: (SDKHandle) | null, cnt: number): NSDictionary
Swift declaration
init(objects: UnsafePointer<AnyObject>?, forKeys keys: UnsafePointer<any NSCopying>?, count cnt: Int)
method

isEqual

TypeScript
isEqual(otherDictionary: NativeMap<unknown, unknown>): boolean
Swift declaration
func isEqual(to otherDictionary: [AnyHashable : Any]) -> Bool
method

keyEnumerator

TypeScript
keyEnumerator(): NSEnumerator
Swift declaration
func keyEnumerator() -> NSEnumerator
method

objectEnumerator

TypeScript
objectEnumerator(): NSEnumerator
Swift declaration
func objectEnumerator() -> NSEnumerator
method

object

TypeScript
object(aKey: unknown): (unknown) | null
Swift declaration
func object(forKey aKey: Any) -> Any?
method

objects

TypeScript
objects(keys: Array<unknown>, marker: unknown): Array<unknown>
Swift declaration
func objects(forKeys keys: [Any], notFoundMarker marker: Any) -> [Any]
method

value

TypeScript
value(key: string): (unknown) | null
Swift declaration
func value(forKey key: String) -> Any?
method · iOS 2.0+ · Deprecated in iOS 100000.0

write

TypeScript
writeToFileAtomically(path: string, useAuxiliaryFile: boolean): boolean
Swift declaration
func write(toFile path: String, atomically useAuxiliaryFile: Bool) -> Bool
method · iOS 2.0+ · Deprecated in iOS 100000.0

write

TypeScript
writeToAtomically(url: string, atomically: boolean): boolean
Swift declaration
func write(to url: URL, atomically: Bool) -> Bool
method · iOS 11.0+

write

TypeScript
writeTo(url: string): void
Swift declaration
func write(to url: URL) throws
get

allKeys

TypeScript
get allKeys(): Array<unknown>
Swift declaration
var allKeys: [Any] { get }
get

allValues

TypeScript
get allValues(): Array<unknown>
Swift declaration
var allValues: [Any] { get }
get

count

TypeScript
get count(): number
Swift declaration
var count: Int { get }
get

description

TypeScript
get description(): string
Swift declaration
var description: String { get }
get

descriptionInStringsFileFormat

TypeScript
get descriptionInStringsFileFormat(): string
Swift declaration
var descriptionInStringsFileFormat: String { get }
get · iOS 8.0+

customMirror

TypeScript
get customMirror(): SDKHandle
Swift declaration
var customMirror: Mirror { get }

The custom mirror for this instance. If this type has value semantics, the mirror should be unaffected by subsequent mutations of the instance.

method · iOS 8.0+

makeIterator

TypeScript
makeIterator(): NSDictionary_Iterator
Swift declaration
func makeIterator() -> NSDictionary.Iterator

Return an *iterator* over the elements of this *sequence*. - Complexity: O(1).

get · iOS 8.0+

underestimatedCount

TypeScript
get underestimatedCount(): number
Swift declaration
@nonobjc var underestimatedCount: Int { get }

A value less than or equal to the number of elements in the collection. - Complexity: O(1).

subscript · iOS 8.0+

subscript

TypeScript
subscript(key: unknown): (unknown) | null
Swift declaration
@objc dynamic subscript(key: Any) -> Any? { get }

Accesses the value associated with a given key. - Parameter key: The key whose value you want to retrieve. - Returns: The value associated with the key, or `nil` if no value is associated with the key.

Skipped declarations

6 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NSDictionary.init(dictionaryLiteral:)

A variable number of Swift arguments is not supported.

NSDictionary.keysSortedByValue(using:)

Objective-C selectors cannot cross the bridge.

NSDictionary.keysSortedByValue(comparator:)

callback cannot propagate synchronous failure

NSDictionary.keysSortedByValue(options:usingComparator:)

callback cannot propagate synchronous failure

NSDictionary.keysOfEntries(passingTest:)

callback cannot propagate synchronous failure

NSDictionary.keysOfEntries(options:passingTest:)

callback cannot propagate synchronous failure

All Foundation types →