Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDXMLNode attributeForName fails after ARC Conversion #11

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

DDXMLNode attributeForName fails after ARC Conversion #11

kazapp opened this issue Dec 31, 2011 · 0 comments

Comments

@kazapp
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant