NSLog for Console window - nslog

I just upgraded to Xcode 7 and I can no long use the NSLog statement to show messages for debugging? NSLog(#"I am at the start of the loop"); This used to work and now I can't even write the statement in the code, it gives me a "expected parameter declarator"? What am I missing? I researched this and can't find anything saying it's changed. One day it worked and now it doesn't. I can find it in my older projects and it still works within those older projects. Any help would be appreciated.

Try Shift +  + C (equivalent to View > Debug Area > Activate Console)
Credit to this original answer

Related

Code Composer Studio MSPFR6989 variables&expressions won’t come up

I am using CCS to program a MSPFR6989 and I’ve debugged and the code is working but I can’t get variables or registers to come up. It remains blank. enter image description here
use double click onto your variables and choose watch expression. You can find your variables under expression from now. If it shows you its name but a red error message try step by step debugging, works for me everytime.

No Way to get the console handle (Dev-Pascal)

I've tried the simple program for my exercise but if i compiled, it turned give a message "No Way to get the console handle" (Dev-Pascal).
Here's my code:
program square;
uses crt;
var
side,circumference,broad:real;
begin
write('Input the side value of the square: ');
readln(side);
circumference := 4 * side;
broad := side * side;
writeln('The circumference value of the square = ', circumference);
writeln('The abroad value of the square = ', broad);
writeln();
write('Press any key...');
readkey();
end.
thank you for helping and teaching me
i would appreciate
Dev-pascal comes with a 10+ years old Free Pascal version. I really have no idea. Try to run the example on the cmdline to see if dev-pascal is the cause or something else. Temporarily disable security software might also be something to try.
I suppose, you've created a Window Skeleton project.
It has it's description: A Windows skeleton application (no window).
In this case you'll get this error though you code compiles (I've got this error too with your code).
Try to create Console Application project which has it's own description: A standard console-based (MS-DOS) application (Your code has compiled and the program worked as well).
P.S. Can't say what exactly happens -- couldn't find any documentation about errors in Dev-Pas (1.9.2).
My assumption is that skeleton program doesn't imply console window for execution program while console application does.
just close the project and then re-open the pascal source file (.pas). And maybe put "readln;" just before "END.".

C4Camera example crashes on XCode 4.6 and XCode 5

The main example https://gist.github.com/C4Tutorials/5399635 crashes in the simulator with the following error: NSInvalidArgumentException', reason: '*** Can't add a nil AVCaptureInput'
It does work when launched on hardware. Is this a known issue or is there a workaround?
i think you can prevent the crash by checking the availability of the AVCaptureInput object before you add it to the AVCaptureSession.
to simplify it check the below code this will prevent the crash on the simulator but it won't help you test it.
try to find where ever you add a AVCaptureInput to a AVCaptureSession and put the following piece of code .
if ([session canAddInput: backCameraDeviceInput])
{
[session addInput: backCameraDeviceInput];
}
i wish this was helpful :)

NSLog not printing to console

I have an Xcode project I've been working on for months. I've never had a problem with NSLog, but after upgrading to Xcode 4.2 nothing will log to the console. I even tried throwing this in viewDidLoad:
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(#"Can anyone hear me?");
And nothing. Is anyone else having this problem or know a solution?
Well, this is embarrassing. The console got deactivated somehow and I was actually watching the variables window. Pressing Shift +  + C did the trick.
Many thanks to Robert King on this thread:
https://devforums.apple.com/message/565880#565880
This is a bug of Xcode8 + iOS10, we can solve it in this way:
When on simulator, add the Name OS_ACTIVITY_MODE and the Value
Variables disable and check it (Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment).
When on device, only add OS_ACTIVITY_MODE and check it(don't add the Value). You'll see the NSLog in the Xcode8 Console.
In iOS10, a lot of system logging is displayed on the console. This can be disabled by including the OS_ACTIVITY_MODE = disabled in the Run Arguments for your scheme
However for iOS10, NSLog messages will not be displayed anymore.
In lower iOS versions the messages will still be displayed. So maybe for most test cases you can use a lower iOS version.
Otherwise you can include a Swift function which prints (print function) your text, this is working okay in iOS10.
Tested on iOS10.0.2 and iOS9.3
My issue is that I have Debugger Output selected. Once I changed it to either All output or target output NSLogs appear fine.
In case this confuses you its on the left of the Debug area.
I had the same issue.
The trick is to search and remove the below mentioned line from the project.
#define NSLog(...)
Search the entire project and remove it.
I just experienced this, so here's another thing to check.
-> Make sure you don't have anything typed in the Filter field below the Log Output. So, in my case I was searching for a term in the logger and forgot to delete the searched terms out of the Filter text field. DOH!
My issue was that I'd accidentally severed the referencing outlet from App Delegate (delegate - file's owner).

Xcode 4 disable "fix-it" popup

I'm fine with Xcode 4 telling me that I have an error. But that pop-up pretty much always has the wrong solution. Is there any way I can get rid of it permanently?
From what I've seen, it looks like you may need to disable the various types of warnings one by one. A list is found here:
http://developer.apple.com/library/mac/#documentation/DeveloperTools/gcc-4.0.1/gcc/Warning-Options.html#Warning-Options
To change them:
Bring up the project navigator and choose your project. In the main window that appears, choose "All". Under the section "LLVM compiler 2.0 - Warnings", choose "Other Warning Flags". Add the flag "Wno-idiomatic-parentheses" for both "Debug" and "Release." Now clean and recompile ( from if(self = [super init]) - LLVM warning! How are you dealing with it?)
I noted in the apple dev link that the following option should inhibit all warnings:
-w Inhibit all warning messages.

Resources