Got memory leak problem when i used NSXMLParser same as SeismicXML Example

前端 未结 3 579
说谎
说谎 2021-01-27 10:42

I have done xml parsing same as SeismicXML example. But now it gives me memory leak problem.

When i tested SeismicXML with instruments, it also give same memory leak.

3条回答
  •  长情又很酷
    2021-01-27 11:38

    Before I initialize my NSXMLParser I set the following:

    [[NSURLCache sharedURLCache] setMemoryCapacity:0];
    [[NSURLCache sharedURLCache] setDiskCapacity:0];
    NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:URL];
    

    This stops leaking.

提交回复
热议问题