当时正试图从网络服务中恢复过来的xml所有节点获得价值。 但是,仅仅花在《基本要素》一纸上,它就应当去其他复制件,但只是在那个时候终止,它不会再读。 法典:
-(void)parseData页: 1
NuanceAppDelegate *appDel = (NuanceAppDelegate *)[[UIApplication sharedApplication] delegate];
NSString *url = @"http://cmweb.bpomatrix.net/SmartPhoneService.svc/login/";
url = [[[url stringByAppendingString:UserName] stringByAppendingString:@"/"] stringByAppendingString:Password];
url = [[url stringByAppendingString:@"/"] stringByAppendingString:appDel.CPAID];
NSLog(@"log: @%",url);
NSURL *loginURL = [NSURL URLWithString:url];
NSXMLParser *home_Parser = [[NSXMLParser alloc] initWithContentsOfURL:loginURL];
[home_Parser setDelegate:self];
dict = [[NSMutableDictionary alloc] init];
[home_Parser parse];
iii
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict
页: 1
if([elementName isEqualToString:@"Address"])
addressFound = TRUE;
if([elementName isEqualToString:@"Name"])
nameFound = TRUE;
if([elementName isEqualToString:@"LoyaltyNum"])
loyaltyNumFound = TRUE;
if([elementName isEqualToString:@"City"])
cityFound = TRUE;
if([elementName isEqualToString:@"Province"])
proFound = TRUE;
if([elementName isEqualToString:@"Zip"])
zipFound = TRUE;
//NSLog(@"Response %@",responseFound);
iii
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string页: 1
if(addressFound)
页: 1
[dict setObject:string forKey:@"address"];
addressFound = FALSE;
iii
else if(nameFound)
页: 1
[dict setObject:string forKey:@"name"];
nameFound = FALSE;
iii
else if(loyaltyNumFound)
页: 1
[dict setObject:string forKey:@"loyaltyNum"];
loyaltyNumFound = FALSE;
iii
else if(cityFound)
页: 1
[dict setObject:string forKey:@"city"];
cityFound = FALSE;
iii
else if(proFound)
页: 1
[dict setObject:string forKey:@"province"];
proFound = FALSE;
iii
else if(zipFound)
页: 1
[dict setObject:string forKey:@"zip"];
zipFound = FALSE;
iii
iii
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
页: 1
if([elementName isEqualToString:@"clsUserProfile"])
页: 1
[self parsingOver];
iii
iii
- (void)parsingOver
页: 1
NuanceAppDelegate *appDel = (NuanceAppDelegate *)[[UIApplication sharedApplication] delegate];
appDel.dictProfile = dict;
iii