I used the "action=query&prop=revisions&rvprop=content&titles=%@&format=json&redirects" api for getting the details about Anil_Ambani. In response i got the following dictionary
<i> query = {
normalized = (
{
from = "Anil_Ambani";
to = "Anil Ambani";
}
);
pages = {
1222313 = {
ns = 0;
pageid = 1222313;
revisions = (
{
"*" = "{{BLP sources|date=June 2012}}\n{{Infobox person\n| name = Anil Ambani \n| image =AnilAmbani.jpg\n| image_size = \n| caption = Ambani in 2009\n| birth_date = {{Birth date and age|1959|6|4|df=y}}\n| birth_place = [[Mumbai]], [[Maharashtra]], [[India]]\n| nationality = Indian\n| occupation = Chairman of [[Anil Dhirubhai Ambani Group]] \n| networth = {{loss}} [[United States dollar|$]]5.2 billion (2012)<ref name=\"forbes.com\">[http://www.forbes.com/profile/anil-ambani/.] Forbes.com. Retrieved April 2013.</ref> \n| residence = Mumbai, Maharashtra, India\n| alma_mater = [[Warwick Business School]]<br />[[Wharton School of the University of Pennsylvania|The Wharton School]]\n| parents = [[Dhirubhai Ambani]]<br>Kokilaben Ambani\n| brother = [[Mukesh Ambani]]\n| spouse = [[Tina Ambani]]\n|
the value for "" here is a NSString. The value for "" is
<i>$3 = 0x0755bb50 {{BLP sources|date=June 2012}}
{{Infobox person
| name = Anil Ambani
| image =AnilAmbani.jpg
| image_size =
| caption = Ambani in 2009
| birth_date = {{Birth date and age|1959|6|4|df=y}}
| birth_place = [[Mumbai]], [[Maharashtra]], [[India]]
| nationality = Indian</i>
now i want to filter the string to get the name, birth_date, etc. I tried
<i>NSArray *arr=[htmlSrc componentsSeparatedByString:@"|"]
for (int i=2; i<mutArr.count; i++)
{
NSArray *DictKeyValueArray=[str componentsSeparatedByString:@"="];
[mainDict setObject:[DictKeyValueArray objectAtIndex:1] forKey:[DictKeyValueArray objectAtIndex:0]];
}
But it is crashing after birth_date. Because there is "|" after birth date and age. So I won't get any key value pair after birth_date.
Please suggest me some other way to filter the string.