English 中文(简体)
Heeelp! Debugger says "out of scope"!
原标题:

I just cannot imagine what the hell the problem could be. I made a pretty app, and decided to use only CALayers to "render".

When I saw that the changes in the position property gets animated, decided to implement a custom getter-setter "abstract" property called tanCenter to set the position without animating.

-(void) setTanCenter: (CGPoint) sentCenter
{   
    //Remove any transactions.
    [CATransaction begin];
    [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
        //Set position.
        self.position = sentCenter;
    [CATransaction commit];

    //Set value.
    tanCenter = sentCenter;
}
-(CGPoint) tanCenter { return tanCenter; }

Since I merged this into the project, it crashes without any "understandable" (for me) error message. I can see only those "out of scope"-s. I cant even get this tanCenter property NSLog-ged without crash.

Help me, Obi-Wan Kenobi; you re my only hope.

问题回答

If you run in the debugger (Command-Y) and make sure you have global breakpoints enabled, the debugger should stop at the place where the crash occurred giving you an idea of what is nil or over-released.

hey I had the same problem till now. Finally I have found my bug after investigating 2 weeks of bug tracking (it really sucks)

maybe my problem helps you:

I started with a TableView that opens on click another view. So I created in:

-(void)tableView:didSelectRowAtIndexPath:

first the controller for the other view and set the value for a global variable:

SomeView *dtview = [[SomeView alloc] initWithNibName:@"SomeView" bundle:nil];
dtview.lblTitle = cl.textLabel.text; // cl is the cell
[self presentModalViewController:dtview animated:NO];
[dtview release];

So opened the other view and done much functions with much memory usage :)

When I after that close the other view and go back to the table and scroll some times the App terminates with the message "out of scope"

I searched really, really long to find out what was the effect. It seems that when the other view is released also the text of the first table is released.

After putting a copy to the call it worked for me:

dtview.lblTitle = [cl.textLabel.text copy];

For int and bool the first solutions works fine, because these aren t objects but for NSObject s you should copy the values to another view.





相关问题
Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Asp.Net MVC - Problem returning a model to the view

I ve recently started using the Areas functionality of the Preview2 and it was working ok until I needed to return a Model to the view. Controller: public ActionResult ForgotPassword() { return ...

Unable to generate PDB files in Visual Studio 2005

For most assemblies, I m able to generate their respective .pdb files. However, I ve got one project that isn t generating their .pdb files. I ve made sure that it on debug mode and that the project ...

热门标签