Logs give you a great opportunity to know the current progress of your application, track changes and find strange problems.
As you see on the screensht above, the Debugger Console window of project Logs is open. You will find it Xcode: Run => Console, or simply: Command+Shift+R.
Logs give you the many information, like when the program started and what cause the unexpected quit.
When I started programming I used a lot of UIAlertViews, to know the current state of my application, the knowledge what method has been just called. But alerts are not good for it. Each time the new alert is shown, the previous one is hidden, until you dismiss the one from top, and then you see them in backwards order – it’s very easy to get lost. That’s why it’s best to use NSLog.
To add your own log you have to use a single line of code:
NSLog(@"newLog");
And when you open the console you should see next row: with date, time, project’s name, memory address (don’t care about this now) and the log itself.
Of course you can save to logs not only defined text, but variable as well simply using NSString:
int someNumber = 5; NSString *someText = @"asdfg"; NSLog([NSString stringWithFormat:"someNumber: %i ; text: %@",someNumber,someText]);
Isn’t it easy? Yes it is, maybe on the beginning, you don’t need them at all, but believe me, they will be helpful when your project grows.
Of course when your app is finished you should disable the logs for the performance improvements and not to prevent, anybody will read the log file with our logs content. I know a lot of people really like to add very sophisticated logs like:
NSLog(@"Oh yeah man, do it again, I like that"); NSLog(@"I will tell your mother"); NSLog(@"You messed sth up!!!!"); NSLog(@"Oh F***");
Believe me or not, but this kind of logs tell you more than NSLog(@”method doSomething called”);.
So, to disable them, you can either delete them all, or disable by using a comments // before each log:
// NSLog(@"log content");
Logs can be really helpful when you develop a game. In early development when you detect a collision, save such an info as a log instead of losing a life and restarting level. Using this way you will easier track and bugs, dead-zones and more.
An as usuall:


look videos watch
I simply had to appreciate you all over again. I am not sure the things that I might have sorted out without those opinions revealed by you directly on my situation. Completely was the intimidating dilemma in my circumstances, however , noticing your expert fashion you treated it took me to weep over gladness. I am thankful for your assistance as well as have high hopes you recognize what a great job you are accomplishing instructing others with the aid of your blog post. Most likely you haven’t come across any of us. http://www.handbagsdreams.com
P4tC4l txtcwqyaepbj
Haha. I woke up down today. Youve cheeerd me up!