Jason Pawlak
Jason Pawlak

Reputation: 802

Breakpoint breaking at wrong line

breakpoint wrong line

The screen shot should be pretty self-explanatory, but I am having issues ensuring my viewDidAppear method is being called. When I set a breakpoint, it breaks in viewDidLoad.

As a side note, none of my NSLog()s are writing to the console either.

I did clean my build directory as I had seen recommended elsewhere, but no joy.

Upvotes: 8

Views: 3598

Answers (4)

iPatel
iPatel

Reputation: 47099

press command+alt+b to see all breakpoints.

select the breakpoint that you want to remove and press delete.

if problem is not solve then do follwing

With-in "Build Settings" under the project target change the "Optimization Level" for "Debug" to "None".

OR

In xCode4:

Your Project Name -> Edit Scheme Info tab (in run configuration) Set Build Configuration to "Debug", Debugger - to "LLDB" ("GDB" was before) Run your project..

Upvotes: 1

Jason Pawlak
Jason Pawlak

Reputation: 802

Solution was (as originally suspected... bad cached data. But looking in the wrong place. Someone in the iOS Simulator, the app was not being updated and was running off old data.

Deleted app from Simulator (Reset Contents and Settings) and all is good with the world.

Killing the derived data both manually in Finder and through Xcode did not give a complete solution.

Appreciate you all that were quick to respond.

Upvotes: 5

Anoop Vaidya
Anoop Vaidya

Reputation: 46563

There may be a two reasons...

1.Your program is crashing in that line itself before the breakpoint.

2.After compiling you have deleted 6 lines, therefore the breakpoint shows 6 lines later.

Never put enter or remove empty lines, while you put breakpoints in your code. You will not get breakpoint at correct line.

Upvotes: 2

One Man Crew
One Man Crew

Reputation: 9578

try to add breakpoint at the line [super viewDidLoad]; and then to delete it.

Upvotes: 1

Related Questions