-1

I am trying to debug an IOS application developed in Objective C. When using messages with NSLog or print instructions, they are ignored and my console is always empty.

Ali HAMDI
  • 365
  • 1
  • 11
  • Set breakpoints to verify if your app actually executes that code. Also, make sure there's not active filter in the console, and that it's set to show All Output. – Gereon Apr 16 '20 at 19:23
  • @Gereon thanks for answering, I did check both of them. The code is executing and I can try my app on the iPhone. But the console shows just few logs from other components. BTW, I am maintaining an application that I didn't develop, and I am still learning Objective C – Ali HAMDI Apr 16 '20 at 19:39
  • So does the execution halt at your breakpoints? If so, you won't need NSLog anymore. – Gereon Apr 16 '20 at 20:14
  • My project is composed of two modules , one in Swift and the other one (that I have problem with) is on Objective C When I start debugging, code is stopped in the breakpoints in Swift part, but it does nothing in Objective C part. I tried to add NSLog to my code but didn't get output in the console. – Ali HAMDI Apr 16 '20 at 20:19
  • So set a breakpoint at a place where your Swift code calls into ObjC. Single-step from there. What happens? – Gereon Apr 16 '20 at 20:36
  • Unfortunately, bow modules are not related. the main application is built with Swift, the share extension is built with Objective C. I am able to debug the main application, but I am not able to debug nor to print logs for the share extension. – Ali HAMDI Apr 16 '20 at 20:43
  • @Gereon thanks for your help, I found what was wrong and I added the answer – Ali HAMDI Apr 17 '20 at 08:30

1 Answers1

-2

It seems that I was doing things wrong, Debugger does not attach automatically to debugger, we need to attach it manually as answered in How to debug ios share extension?

Ali HAMDI
  • 365
  • 1
  • 11