0
-(void)walkDOM:(SEL)visitor node:(QuadNode*)node {
    [self performSelector:visitor withObject:node]; /* ------>100% leaks shown here */
    NSArray* children = node.children;
    if (children) {
        for (QuadNode* child in children) {
            [self walkDOM:visitor node:child];
        }
    }
}

I dont know what's wrong in the above it crashes.Any Help Suggestions!!!!!

Edit:

-(void)registerFramesetterVisitor:(TDOMNode*)node {
     [strMaker reset]; 
     [node registerFramesetter:self]; 
}
danqing
  • 3,348
  • 2
  • 27
  • 43
  • Please take a look at: http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown – Robin van Dijke Aug 21 '12 at 11:38
  • You'll need to show us the methods that `visitor` describes. – trojanfoe Aug 21 '12 at 11:43
  • -(void)registerFramesetterVisitor:(TDOMNode*)node { [strMaker reset]; [node registerFramesetter:self]; } In the above code my selector is registerFramesetterVisitor – pppp aaaa Aug 21 '12 at 12:51
  • Where is `[NSObject performSelector:withObject:]` defined? I cannot find it... – trojanfoe Aug 22 '12 at 10:58
  • @trojanfoe: It's defined in the NSObject Protocol Reference: [link](https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html#//apple_ref/occ/intf/NSObject) – Robin van Dijke Aug 22 '12 at 11:05
  • OK thanks - didn't think to look there... – trojanfoe Aug 22 '12 at 11:08

1 Answers1

1

It's only a matter of compiler warnings, you can suppress them using:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
    [self performSelector:visitor withObject:node];
#pragma clang diagnostic pop

Source

Robin van Dijke
  • 752
  • 4
  • 13
  • Given the OP used the phrase "100% leaks shown here" that would imply that he's seeing these leaks using Instruments; which as you know is way past compilation... – trojanfoe Aug 22 '12 at 10:52
  • Another way to see these leaks is using Build & Analyze. In that way the compiler would complain about the performSelector which is something I experienced a few weeks ago. – Robin van Dijke Aug 22 '12 at 11:03
  • But Analyze doesn't use the term "100% leaks..." does it; Instruments does though. – trojanfoe Aug 22 '12 at 11:04