Questions tagged [nslog]

Logs an error message to the Apple System Log facility.

The message consists of a timestamp and the process ID prefixed to the string you pass in. You compose this string with a format string and one or more arguments to be inserted into the string. The format specification allowed by this function is that which is understood by NSString’s formatting capabilities.

Displaying log messages in the system console while running your application is one of the oldest debugging mechanisms available. Using logging, you can generate a transcript describing the operations being performed by your application that you can review long after your application has finished running. Also, while your application is running, you can observe log messages being generated and written to the console as the events in your app they describe are taking place. As a developer, you are in complete control of the text and information displayed in the console by NSLog. Logging can reveal even the toughest to find problems in an app.

Here is an example of what a call to NSLog looks like:

NSString *message = @"test message";

NSLog( @"Here is a test message: '%@'", message );

Console:

Here is a test message: 'test message'

Reference:

Basic debugging with the NSLog function and the DEBUG preprocessor macro

667 questions
-3
votes
2 answers

NSLog not printing out BOOL result to console

I have a location app that already successfully asks the user to enable location services, and then can show them their coordinates on a button press as well. So I decided to play around with everything that is available in the CLLocationManager…
user3117509
  • 833
  • 3
  • 14
  • 32
-3
votes
2 answers

Integer formatter for string ios

I want to know what will be the result of the following code NSString *str = @"0"; NSString *str1 = @"12"; NSLog(@"str int value %d, %d",str, str1); Result I got is 18036, 18052 I used a wrong format specifier in my code and came across this weird…
pa12
  • 1,493
  • 4
  • 19
  • 40
-4
votes
1 answer

NSLOG does not work

I try to get info for the array in the console but the NSLOg does not show anything. This is a class where i store data for the app. Here is the code. #import #import "DAObject.h" @interface DataModel :…
Newbie
  • 25
  • 7
-4
votes
1 answer

Integers not being printed in NSLOG

NSLOG("your current number of users is:%@",userNumber); this doesn't print the userNumber which is 5(i checked in debugging mode). any advices?
-4
votes
5 answers

NSLog giving error when trying to print a single unformatted integer

Hi this is third day of mine using Objective-C today I was writing few simple programs and i ecncountered the following warning main.m:19:5: warning: passing argument 1 of 'NSLog' makes pointer from integer without a cast [enabled by default] …
iamyogish
  • 2,372
  • 2
  • 23
  • 40
-4
votes
2 answers

See NSLog at wrong time

I have two layers. The bottom layer consists of hidden UIImageViews, the upper layer consists of visible UIImageViews. They have labels in it. When all the frames of the bottom layer UIImageViews are equal to the frames of the upper layer…
Steven
  • 1
  • 4
-6
votes
2 answers

Accessing Objective-C hidden _cmd argument from Python

I've poked around at the PyObjC innards quite a bit trying to figure this out. Is it possible to access Objective-C's hidden SEL _cmd method argument when writing a Python method? It's got to be generated at some point, but I'm not sure if that…
jscs
  • 63,694
  • 13
  • 151
  • 195
1 2 3
44
45