iphone - How can get value NULL in parse XML iOS -


i want value response server. used nsparsexml parse xml when element null, missed value , not add array. example: xml

 <file>      <state>2</state>      <memo/> </file> 

in xml, null.

this code:

 - (void)parser:(nsxmlparser *)parser didstartelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qualifiedname attributes:(nsdictionary *)attributedict     {         nslog(@"did start element"); if ( [elementname isequaltostring:@"filename"])     {         xml_field = filename_cloud;         nslog(@"found rootelement");          return;     }        else if ( [elementname isequaltostring:@"memo"])         {             nslog(@"found rootelement");             xml_field = memo;             return;         }      }      - (void)parser:(nsxmlparser *)parser didendelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qname     {               nslog(@"did end element");             if ([elementname isequaltostring:@"filename"])             {                 nslog(@"rootelement end");             }             xml_field = unimportant;      }         - (void)parser:(nsxmlparser *)parser foundcharacters:(nsstring *)string     {        if (xml_field == filename_cloud)     {         nslog(@"value %@",string);         [filecompletedarray insertobject:string atindex:0];      }        else if (xml_field == memo)         {             nslog(@"value %@",string);             [memoarray insertobject:string atindex:0];         }      } 

when load data tableview, not load value null in label. i'm debug, memoarray not add null value. how can null value? in advance


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -