Sample code for 30+ languages & platforms
Objective-C

SearchAllForContent

See more XML Examples

Demonstrates the SearchAllForContent method.

Chilkat Objective-C Downloads

Objective-C
#import <CkoXml.h>

BOOL success = NO;

CkoXml *xml = [[CkoXml alloc] init];
CkoXml *xBeginAfter = 0;
CkoXml *xFound = 0;

success = [xml LoadXmlFile: @"qa_data/xml/pigs.xml"];
if (success != YES) {
    NSLog(@"%@",xml.LastErrorText);
    return;
}

xBeginAfter = [xml GetSelf];
xFound = [xml SearchAllForContent: xBeginAfter contentPattern: @"*pig*"];
BOOL searchForMore = YES;
while ((searchForMore == YES)) {

    NSLog(@"%@",xFound.Tag);
    NSLog(@"%@",xFound.Content);
    NSLog(@"%@",@"--");

    xBeginAfter = xFound;
    xFound = [xml SearchAllForContent: xBeginAfter contentPattern: @"*pig*"];

    searchForMore = xml.LastMethodSuccess;
}