What is the closest implementation of Objective-C’s NSDictionary in Java? To me, it looks like HashMap<String, Object>, but I’m very new to Objective-C.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
NSDictionaryis a class cluster (see the “Class Cluster” section in The Cocoa Fundamentals Guide), meaning that the actual implementation is hidden from you, the API user. In fact, the Foundation framework will choose the appropriate implementation at run time based on amount of data etc. In addition,NSDictionarycan take anyidas a key, not justNSString(of course, the-hashof the key object must be constant).Thus, closest analog is probably
Map<Object,Object>.