How to get the data from xml file
I have an application which binds a map with user's location, 2 pictures and so开发者_JAVA技巧me text in the xml file and send it to the other user through email. Now the question is that if the other user who is receiving it, how i should make this xml file parsed in my application so that the receiver can have a sensible look of the data like the map with two tabs (pictures and comments). The basic question is how i can read the sent xml file at receiver's end.
Thanks,
At the sender's end, create an NSDictionary
containing the location, the data of the two UIImage
s and the NSString
. Then, save it as a plist
, and send it via email. Then, at the receiver's end, create an NSDictionary
with the contents of the file (NSDictionary *dataDict = [[NSDictionary alloc] initWithContentsOfFile:YOUR_FILE];
), and then get the objects using the relevant keys that you set for them when you added them to the dictionary.
Hope this helps,
jrtc27
精彩评论