Can't use NSMutableArray data after Parsing with NSXMLParser (objective-c) -
hi did parsing nsxmlparser of xml :
<company> <name>idan</name> <country>israel</country> ..... <gender>man</gender> </company>
i see parsing success , have mutablearray 1 object contain strings (idan,israel etc.) when want utilize array, can't strings contain. when :
nsmutablearray *use = [pars users ]; nslog(@"%@",use );
(users it's array object) see:
<list:03f5a78>
where list in code is:
#import <foundation/foundation.h> @interface list : nsobject{ nsstring *name; nsstring *country; nsstring *status; nsstring *gender; } @property (nonatomic, strong) nsstring *name; @property (nonatomic, strong) nsstring *country; @property (nonatomic, strong) nsstring *status; @property (nonatomic, strong) nsstring *gender; @end #import "list.h" @implementation list @synthesize name,date,city,country,status, gender; @end
i seek this:
nsmutablearray *use = [pars users.name ]; nslog(@"%@",use );
but not working, ideas how prepare this?
override description
method of list
class, , homecoming string includes values of of properties, output did first time. console print value returned.
example:
@implementation list ... ... -(nsstring *)description { nsmutablestring *desc = [nsmutablestring string]; [desc appendformat:@"name=%@, ", self.name]; [desc appendformat:@"country=%@, ", self.country]; [desc appendformat:@"status=%@, ", self.status]; [desc appendformat:@"gender=%@", self.gender]; homecoming desc } ... ... @end
objective-c parsing nsmutablearray nsxmlparser
No comments:
Post a Comment