|
|
#1 |
|
Annotation in Plist
Hey!
I'm making a map application with annotations, and but i'm a bit confused when using plists and then choosing between dictionaries and arrays in a plist. I'm not sure when I need to use a dict and then array? I would have a sorted list from A to Z. and in the A to Z comes my Annotations with name, and then within the name an Description, subtitle, picture, title, aso. So i would try someting like this ? Code:
<dict> - <array>(for the A to Z) -- ??? - </array> </dict> Grz |
|
|
|
0
|
|
|
#2 |
|
No. A dictionary consists of keys and values. You have no key.
__________________
Sponsor me to cycle 100Km round London in the dark |
|
|
|
0
|
|
|
#3 |
|
|
0
|
|
|
#4 |
|
If you want an array use an array. If you want a key/value pair set use a dictionary. You say you want an array representing A-Z and then some sort of dictionary structure for each element. So you would have an array containing 26 dictionaries.
__________________
Sponsor me to cycle 100Km round London in the dark |
|
|
|
0
|
|
|
#5 | |
|
Quote:
Cocoa Core Competencies: Property list. |
||
|
|
0
|
|
|
#6 |
|
Oke i have someting like this now!
Would this be the right way? Code:
<dict> <key>A</key> <array> <dict> <key>description</key> <string>Bla</string> <key>lat</key> <string></string> <key>long</key> <string></string> <key>picture</key> <string></string> <key>subtitle</key> <string></string> <key>title</key> <string>First Annotation</string> </dict> </array> <key>B</key> <array/> <key>C</key> <array/> <key>D</key> <array/> <key>E</key> <array/> <key>F</key> <array/> <key>G</key> <array/> <key>H</key> <array/> <key>I</key> <array/> <key>J</key> <array/> <key>K</key> <array/> <key>L</key> <array/> <key>M</key> <array/> <key>N</key> <array/> <key>O</key> <array/> <key>P</key> <array/> <key>Q</key> <array/> <key>R</key> <array/> <key>S</key> <array/> <key>T</key> <array/> <key>U</key> <array/> <key>V</key> <array/> <key>W</key> <array/> <key>X</key> <array/> <key>Y</key> <array/> <key>Z</key> <array/> </dict> |
|
|
|
0
|
|
|
#7 |
|
It's a way. This will not give you an array representing A-Z, rather a dictionary indexes A-Z. This may or may not be better, depends in your usage.
__________________
Sponsor me to cycle 100Km round London in the dark |
|
|
|
0
|
|
|
#8 | |
|
Quote:
Code:
self.alfabet = [[AnnotationsData allKeys] sortedArrayUsingSelector:@selector(compare:)]; |
||
|
|
0
|
|
|
#9 | |
|
Quote:
Code:
<array> <!-- A --> <array> <dict>...</dict> .... </array> ... <!-- Z --> <array> <dict>...</dict> </array> </array>
__________________
Sponsor me to cycle 100Km round London in the dark |
||
|
|
0
|
|
|
#10 | |
|
Quote:
|
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 06:00 PM.







Linear Mode
