DDXMLNode attributeForName fails after ARC Conversion #11

Open
kazapp opened this Issue Dec 31, 2011 · 0 comments

Comments

Projects
None yet
1 participant

kazapp commented Dec 31, 2011

The code below compel;lied and ran fine before converting to ARC and using the new KISSXML 5.0 libraries updated for ARC. I now get an error when compiling the ARC project at these lines:

            DDXMLNode *attrRecSeqNoName = [node attributeForName:@"recSeqNo"];

ERROR is:
Automatic Reference Counting Issue:
Receiver type 'DDXMLNode' for instance message does not declare a method with selector 'attributeForName:'

Hope you can help me.

CODE SNIPPET:

DDXMLDocument *doc = [[DDXMLDocument alloc] initWithData:xmlData options:0 error:nil];
NSArray *items = [doc nodesForXPath:@"//block/*" error:nil];

for (DDXMLElement *item in items) 
{

    for (int i = 0; i < [item childCount]; i++) //START LOOP
    {  
     DDXMLNode *node = [item childAtIndex:i];

        name = [node name];
        value = [node stringValue];

        if ([name isEqualToString:@"recordBnr"])
        {

            DDXMLNode *attrRecSeqNoName = [node attributeForName:@"recSeqNo"];
            NSString *attrRecSeqNo = [attrRecSeqNoName XMLString];
            DDXMLNode *attrLimitMaxName = [node attributeForName:@"limitMax"];
            NSString *attrLimitMax = [attrLimitMaxName stringValue];
            DDXMLNode *attrLimitMinName = [node attributeForName:@"limitMin"];
            NSString *attrLimitMin= [attrLimitMinName stringValue];

            NSLog(@"attrRecSeqNo = %@", attrRecSeqNo);
             NSLog(@"attrLimitMin = %@", attrLimitMin);
             NSLog(@"attrLimitMax = %@", attrLimitMax);
         }
    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment