Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the maximum key length in NSDictionary?

I'm currently working on an app which displays a bunch of files in a table, and you can add and remove them and whatsoever. To prevent duplicates in the table, I'd like to create a NSDictionary using the files full path as keys for another NSDictionary which contains all the file information, but I am a little concerned about the maximum key length of NSDictionary, and also whether this solution would be performance killer or not...

like image 641
fresskoma Avatar asked Dec 07 '22 02:12

fresskoma


1 Answers

There are no specific limits on the size of the NSString you use as long as it's not so big you fill up all the memory! The dictionary doesn't load in the characters and start looking at them itself so there won't be any internal NSDictionary issues related to that, or performance issues, as all it does is use the isEqual: method and if it returns true, it matches.

Hope that helps.

like image 141
DenverCoder9 Avatar answered Jan 07 '23 17:01

DenverCoder9