5

I have a method which returns a block. I want to add a breakpoint inside the block. In Xcode adding a breakpoint on a line that's inside the block causes execution to pause when the method is returned and not when the block is executed. How do I add a breakpoint inside a block?

2 Answers 2

1

I had the same difficulty, until I tried using Xcode 4's LLDB debugger (go to Product>Edit Scheme to turn it on). Perhaps you'll have better luck with it.

Sign up to request clarification or add additional context in comments.

1 Comment

Great! Unfortunately it doesn't support iOS yet.
0

From the documentation

You can set breakpoints and single step into blocks. You can invoke a block from within a GDB session using invoke-block, as illustrated in this example:

$ invoke-block myBlock 10 20 

If you want to pass in a C string, you must quote it. For example, to pass this string into the doSomethingWithString block, you would write the following:

$ invoke-block doSomethingWithString "\"this string\"" 

1 Comment

Abizem: Thank you, but that doesn't answer my question. I want to pause inside a block and inspect it in the context.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.