Reputation: 379
My question is for all the iPhone developers, since I'm new to iPhone I'm struggling a bit. I have an XML file which has data like this
<results>
<from_user_id_str>84092950</from_user_id_str>
<profile_image_url>http://a0.twimg.com/profile_images/592722322/GJ_normal.png</profile_image_url>
<text>haguregumo) シリアの悲劇⑨・・・反政府グループ支援=犠牲者増加の構造… http://t.co/wj6dMcFQ #india</text>
</results>
The results tag is multiple in my XML. Now I want to show this content in a UITableView. I feel that NSDictionary would be the right class to implement here, but I don't know the following:
Any help would be great.
Thanks and Regards Abhishek
Upvotes: 1
Views: 307
Reputation: 43543
Expanding on @competent_tech (short ;-) answer...
How to convert my XML in a NSDictionary object. I want to do this in MonoTouch.
Since you selected MonoTouch you should try to stay .NET-ish, e.g. parse your XML using XmlDocument
or XML serialization or XLinq... lots of options are available in .NET to do this :-)
Also avoid using Objective-C types, like NSDictionary
unless they are needed by some other API you need to use (there are often better .NET alternatives).
E.g. use a generic-based Dictionary or define your own structures (great match for XML serialization).
How to display content like images, text, and other buttons in a UITableView.
Using UITableView
can be a bit complex.
Many people, including myself, will encourage you to use MonoTouch.Dialog instead. It has great sample code, it's easy to customize (you'll find lots of questions and answers here on stackoverflow.com) and it will feels much more .NET-ish.
Upvotes: 0
Reputation: 44921
I would recommend creating a class to hold the data from the file, then use MonoTouch.Dialog to render the class in a table view. Here is a very good article on the subject.
Upvotes: 2