in Education by
I am creating an application where a user can click a city name in a tableview. I'm identifying the name the user selected to match a key in a NSDictionary. The problem is that some of the cities are having å ä ö in their name, since the app should work in Sweden. The NSDictionaries are stored in a plist-file. Looks like this: { Göteborg = { name = "Göteborg"; adress = "xxx"; phone = "xxx"; }; } How should I make this work? I can think of a few stragies, which I don't know how to implement: Escape the å ä ö in in the plist file some way. But how? In the plist, instead of Göteborg I could call the key Goteborg and in the code always exchange the å ä ö to a a o before calling the key in the dictionary. But how do I do that if I'm not going to loop through the string and build up a new one? I assume it's possible in an easy way, e.g. a "change all ö to o" method. This is the error message I get when trying to compile the application: English.lproj/factories.plist: Unexpected character { at line 1 Command /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 1 Thanks in advance! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
NSString and plist file format do support Unicode, without any problems. You should not care about using Unicode strings in NSDictionary. Still there are two potential issues with what you want to do. You may need to normalize Unicode strings when you add them as keys and before checking if key is in the dictonary. The second, you may want to be able to do partial matches inside the dictionary, for example if someone enters a name without diacritics (accents). For this I think it would be easier to add aliases inside the hash.

Related questions

0 votes
    I have the following dictonary: inventory = {'apple':(3, 133), 'banana':(9, 407), 'pear':( ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 3, 2022 in Education by JackTerrance
0 votes
    I have the following dictonary: inventory = {'apple':(3, 133), 'banana':(9, 407), 'pear':( ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I have the following dictonary: inventory = {'apple':(3, 133), 'banana':(9, 407), 'pear':( ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I'm using EF code first. By convention, I have added a foreign key and a reference to the foreign ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I'm trying to install a GoDaddy SSL certificate on a new load balancer I'm setting up on Amazon AWS. I ... verify this. Any ideas? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    What are the shortcuts key using keyboard for opening a new document?..please anyone? Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    In the above DDL command the foreign key entries are got by using the keyword (a) References (b) ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    Which one of the following uses a 128bit round key to encrypt the data using XOR and use it in ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    Which of the following are the key concepts of Functional Programming a. Immutability b. Pure functions c. Inheritance d. Referential Transparency...
asked Mar 7, 2023 in Technology by JackTerrance
0 votes
    In asymmetric key cryptography, the public key is available with ________. A. sender B. receiver C. sender and receiver D. everyone in the network...
asked Nov 30, 2022 in Education by JackTerrance
0 votes
    I am working on a voting table design using Postgres 9.5 (but maybe the question itself is applicable ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    Have jquery dialog as closeOnescape as false. want to trigger an event based on esc key press how do ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I am working on a voting table design using Postgres 9.5 (but maybe the question itself is applicable ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I am getting empty row on following sql SELECT * FROM flyers WHERE fId='6' AND 'userId'='400' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: How to reshape data from long to wide format (12 answers) Closed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
...