+1  A: 

If you couldn't see any helpful debug info, I would suggest you find all the places that you are doing a release. It is most likely the case that you have released something that did not need to be released. Code would help us in tracing the issue with you.

Erich Mirabal
Thanks. I just try this code(not actually like this) then found the problem appear repeatlyCGPDFDocumnetRef docA=CGPDFDocumentCreatWithURL(myurl);CGPDFDocumnetRef docB=CGPDFDocumentCreatWithURL(myurl);I put these 2 lines code in some other projects, no problem at all. but in this project, it will happen. So, i think it is not pdf doc problem.Is there a way the system-OS let us know which object or memory address which OS try to release have this problem. look for every object i tried release is painful, because too much and some involve multiple thread.
Well, look at where you are releasing that one object. It might be happening in various places, depending on how you are storing it, passing it around, etc.
Erich Mirabal
A: 

In addition to Erich answer, I'd want to add go backward. Start with the most recently added release and work from there.

I ran in to this and it turned out I was releasing an auto-released object that was returned from a convenience method built in to the Cocoa-Touch framework. My problem was as Erich described -- I released this auto-released object. When the system attempted to release it, the program gave the error you are describing.

Regards,
Frank

Frank V
Good suggestion. That usually is the fastest way to track it. I did the same thing in my own code. I am still getting used to the objective-c way of handling it (relatively easy, honestly, but just gotta get used to it).
Erich Mirabal
i am checking review my code base on this way right now, thanks
A: 

The best way to know what happend is using the xCode Debbuger, give it a try.

Juan Karam
A: 

As Juan noted, the first stop is the Debugger - what does the debug window give for a stack trace when the app crashes? You should be able to see the line it crashed on... you said in a comment to one response that you saw the crash happen around the lines:

CGPDFDocumnetRef docA=CGPDFDocumentCreatWithURL(myurl);
CGPDFDocumnetRef docB=CGPDFDocumentCreatWithURL(myurl);

Are you really using the same URL object for both calls? Which line is it exactly?

It could be something around the way you make use of the CGPDFDocumentRef, you can find example code how Apple uses them in the QuartzDemo project, file "QuartzImageDrawing.m" (you can find the demo project from the developer portal or embedded in the iPhone documentation with XCode).

XCode is actually pretty powerful, but it does things differently from other IDE's.

Kendall Helmstetter Gelner
Thanks, Here is the stack looks like in debuggerobjc_msgSend. Error happened here:I never manually call this method.what is thisCFStringGetLength_CFString...MyMethod: which i can understand
If you see a crash in msgSend, it usually means you are sending a message to an object that has been released.The CFStringGetLength part means that it was trying to ask a string what the length of the string was - but that string is gone, the memory for it released but you are still using the variable that was referring to it.When you click on the MyMethod line in the stack trace, you should see the exact line of code that caused the crash. What is that line?
Kendall Helmstetter Gelner
YOU are absolutely right, finally figure it out because I write some code like this NSLog("Memory warning"). How stupid I am!. Here is objc_msgSend article: http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.htmlWish everybody never goto that far.
A: 

thanks a lot. Same eror here and i was releasing something to early.