Can we get the key for an object in an NSDictionary
by passing a particular value or object?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
-[NSDictionary allKeysForObject:]
returns anNSArray
of all the keys whose objects match the passed object, where "match" is determined byisEqual:
.This is how you can get a first key for object (in case it is an
NSString
):This handles if the object is not found in in the dictionary.
To answer you question in a more specific manner, use the following to get a key for a particular object: