Intermediate Debugging with Xcode 4.5

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

Intermediate Debugging with Xcode 4.5

Postby rwenderlich » Tue Feb 12, 2013 11:00 am

This is the official thread to discuss the following blog post: Intermediate Debugging with Xcode 4.5
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2230
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 366 times

Re: Intermediate Debugging with Xcode 4.5

Postby shmidt » Tue Feb 12, 2013 3:14 pm

This post is extremely useful.
User avatar
shmidt
Baby Hacker
 
Posts: 5
Joined: Sat Nov 12, 2011 8:03 am
Location: Russia, Saint-Petersburg
Has thanked: 0 time
Been thanked: 0 time

Re: Intermediate Debugging with Xcode 4.5

Postby KingBabar » Tue Feb 12, 2013 3:46 pm

Great post!
But for it to be really useful i will need some kind of log level. like: log, warning, error.
Any ideas on how to use breakpoint with log levels?

Thanks
KingBabar
n00b
 
Posts: 1
Joined: Tue Feb 12, 2013 3:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Intermediate Debugging with Xcode 4.5

Postby cpprulez » Wed Feb 13, 2013 5:30 pm

Extremely useful post, full of practical tricks!
My favorite one was the #warning. My code unfortunately is full of TODOs, which I completely forget over time, so this is awesome!
Huge thanks for the wonderful tutorial!
cpprulez
n00b
 
Posts: 4
Joined: Wed Nov 16, 2011 4:46 pm
Location: Sofia, Bulgaria
Has thanked: 0 time
Been thanked: 0 time

Re: Intermediate Debugging with Xcode 4.5

Postby abujar82 » Wed Feb 13, 2013 6:22 pm

I am new to IOS development . This post is very useful and did tech some features that I am not aware of. Thank you for your time. Also, I would like to give a big thanks to every one in this site for delivering these great tutorials. The raywenderlich website is my first resource for IOS development and every day i can see that i am getting better in my IOS skills. great job :D :) ;)
abujar82
n00b
 
Posts: 1
Joined: Tue Mar 13, 2012 11:23 pm
Location: Houston,TX
Has thanked: 0 time
Been thanked: 0 time

Re: Intermediate Debugging with Xcode 4.5

Postby everydave » Wed Feb 13, 2013 9:12 pm

Great post. I especially like the part about breakpoint logging, but I'm hesitant to change to this method because while my code can be littered with a bunch of NSLogs that I use while developing/debugging I know exactly what they are when looking at code. With the breakpoint method, the only visual clue that there's something going is the little breakpoint carrot on the left bar. I have to click and "edit" the breakpoint to discover that it is, in fact a logging one. This is also the case in the breakpoint navigator. Does anyone know of a way to make these types (or any specific) type of breakpoint visually stand out so I can have a clue that it's a logging breakpoint vs some other type?

Thanks!
everydave
n00b
 
Posts: 2
Joined: Wed Feb 13, 2013 9:07 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Intermediate Debugging with Xcode 4.5

Postby VegetarianZombie » Thu Feb 14, 2013 5:10 am

@schmidt Thank you!

@KingBabar Thanks for reading! Can you explain how your log levels are being implemented?

@cpprulez hahahaha ... I hear that. There's nothing like a good warning to get your attention.

@everydave ... I hear what you are saying and at the end of the day, it's what ultimately benefits your workflow. The awesome thing about breakpoint logging is that you can add them a runtime. Also, it would be trivial to wrap NSLog in a wrapper function, then turn on the logging through a debugger command via. a breakpoint. That way, you get the best of both worlds. Thanks for reading the article :)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Brian Moakley
Twitter: @zombietreats
My latest app: http://www.razeware.com/battle-map-2/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
VegetarianZombie
Team Member
Uber Haxx0r
 
Posts: 51
Joined: Wed Oct 24, 2012 8:50 pm
Has thanked: 6 times
Been thanked: 7 times

Re: Intermediate Debugging with Xcode 4.5

Postby dkb » Sat Feb 16, 2013 8:09 pm

Where is this mystical return value in the debugger? I can't seem to get it to appear. I was expecting to see it just from stepping into and out of a method that returns a value.

I also find using breakpoints for logging not very useful. I instead use CocoaLumberjack. This is much faster then NSLog and better yet you can have it log to a file. So when a user has an issue you can get the log file from them.
dkb
n00b
 
Posts: 3
Joined: Sat Feb 16, 2013 8:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Intermediate Debugging with Xcode 4.5

Postby spulver » Sun Feb 17, 2013 6:40 am

Great tutorial - thanks a lot Brian.

Maybe it is worth mentioning that the breakpoints are stored in a separate file in the xcode project bundle in the xcuserdata folder.
This means they are stored on user basis - sometimes this is good :-) but stay cool when you think you have lost all your hard work adding the log breakpoints to your project - maybe you just work under a different user.
spulver
Subscriber since Feb 10, 2014
Hacker
 
Posts: 12
Joined: Thu Dec 22, 2011 12:38 pm
Location: Basel, Switzerland
Has thanked: 1 time
Been thanked: 0 time

Re: Intermediate Debugging with Xcode 4.5

Postby gargoyle » Sun Feb 17, 2013 6:10 pm

One problem I'm having with this is we lose where we are. I like to put __func__ in the output of my NSLog() so that I know what file/routine I'm currently in. When I use your trick of doing this via a breakpoint, the routine looks like this: ($__lldb_category) $__lldb_expr:

That's not entirely helpful. Is there a way to get the current function name with your method?
gargoyle
Subscriber since May 12, 2014
Hacker
 
Posts: 22
Joined: Sun Feb 26, 2012 8:34 am
Has thanked: 0 time
Been thanked: 2 times

Next

Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 11 guests