Sometimes in Xcode 6 Assistant Editor -> Preview stops working.
Showing just "No selection" even if no errors and Storyboard is ok.
Why does this happen?
The reason is "?" (questionmark) in Project's name (maybe there is a bug with other symbols – didn't check it).
You can try to rename Project or just create new one with name without "?" in it.
You must to Kill Xcode from processes for complete and then open it again. You can do it with Activity Monitor o CLI. Voila! - Preview is working again.
Don't just close Xcode keeping the app working. Sometimes also works closing with CMD + Q.
I had similar problem, but fixed it
You must open the xib or storyboard file in both assistant editors. Click the navigation button in the second editor (either the bottom or the right editor, depending on how you stack the assistant editors) and choose Preview to get the preview to appear.
thanks to
http://meandmark.com/blog/2014/09/xcode-6-no-simulate-document-in-interface-builder/comment-page-1/#comment-2883
I have played with Xcode 6 for a while and I encountered similar problems occasionally. I never used special characters in project or class names but the problem sometimes happens.
Now I have to test all ViewControllers at starting point to see if the Assistant Editor work. If not, I will just delete the class file and recreate the same one, it usually fix the problem.
Hope this can be fixed soon.
I waited long time but my playground project is not showing result on right side bar
I am using right code but still right bar is not updating i don't know what is the problem i tried lot of time.
here is my code
var str = "Hello, playground"
var str1 = "this is my first program"
let kermit = "kermit"
let msPiggy = "ms. piggy"
let string1 = msPiggy + " and " + kermit + ", sitting in a tree"
let string2 = "\(msPiggy) and \(kermit), sittting in a tree "
let string3 = " kermit has \(5*2) fingers"
let chr1:Character = "💿"
As of Xcode 8, unless you are print-ing out things, results in the playground could take a little bit more work to show.
In this screenshot, I show two things you can click on. #1 is the the "Show Debug Area" button, the middle button in the top right of the toolbar (i.e. which toggles the lower pane that slides up and down in the Xcode window). Results from print end up there.
Also, the second set of (multiple) circles shows that you can click on to show results. You can slide the gray bar space wider to make things show.
Lastly, where you see the "Play" triangle in the lower toolbar, try clicking on that to force the Playground to execute your code again.
In my case, I had to close Xcode 9.2 and close all simulators, then restart playground file, then it worked.
I am also facing this problem as shown in below image
There is no log on the right bar
So what we do :
We just Quit Xcode and again open playground project
and it works fine
also, there is one more button through which you can set automatically and manually run
If you have M1 chip MacBook Pro, you have to uncheck Rosetta to get the Playground working.
My result area was somehow too narrow to show the results. Try dragging it larger.
It's not the assistant editor that should be enabled. It's the little grey bar to the right that is too narrow. If you hover your mouse pointer just next to an expected result, you will see the familiar little eye and radio button icon. Then drag the bar out and it'll show.
Hope it works!
I had the same issue, and discovered that if I held down the Play icon above the debug area (revealed at the bottom of the playground), it had an option, 'Automatically Run'.
I selected that, and all is well!
Cheers.
add import PlaygroundSupport to the top of your code! i had the same issue and it worked perfectly.
In Xcode 10.1 I changed build system to Legacy Build System from file > Playground Setting. It fixed my problem
In my case I have two Xcode versions installed on my mac. (v8.2.1 and v7.3.1)
The two Xcode is running simultaneously, and then when I decided to open a playground on v8.2.1 and printed out some codes. Playground should run it automatically but it is stuck in Running my file.
What I did is I restarted both of my Xcode applications and then Playground succesfully printed my codes.
https://forums.developer.apple.com/thread/3672
playground will not show results if any of your previous lines has error, you will have to remove those errors and all the results would immediately start showing up on right side bar.
In my case for Xcode 9.2, output started appearing when I clicked File/New/Tab. So, Playground seems missing some refresh option and new tab did that.
oftentimes, I need to close my playground and Xcode and relaunch it again to see the results.
Also had this problem. "Editor › Run Playground" worked for me.
In my case i ensured i set the right Command Line Tool version by tapping Xcode>Preferences>Locations and it worked.
i made a checklist to resolve this issue
First of all make sure your 'result area' is not hidden, There
should be some grey (result area) on right side, if whole
screen is white then try to pull it from right-edge of screen.
Make sure there is no code error, you can check code error in 'debug
area'.
If both point are resolve though you can not see result then try to
print('hello world') at last.
In my case, I was saving my playground somewhere else than the default path and it didn't show the result. Saving it on the default path made it work.
In my case,
ios: macOS Catalina Version 10.15.7
Xcode
Version 12.1 (12A7403)
1.First Go to Editor then click run playgound
2.Then it will show the running results on the right side.
With Xcode 12+, please uncheck Open using Rosetta.
I saved my playground to the folder of my choosing, all the solutions to save it in default location are simply silly...
I did have enabled the right-hand side area and console-output on the bottom.
Whether running from Edit->Run Playground or using Cmd+Return didn't help, still no output was shown. Even though my code was solid and I could see Build Succeed in the top notificaiton area...
After checking Preferences->Locations I could see there are no Command Line Tools seleceted, so I choosed only one available option (Xcode 13.2.1) and... still no output...
Then I closed XCode with Cmd+Q and started it again...
Finally it worked and output was shown...
In XCode, let's say I call a method that doesn't exist. Well, XCode gives me a nice little warning when I click "Build." Then, if I immediately click "Build" again, that warning goes away mysteriously! How do I fix this? I don't want my warnings to ever go away :)
Try selecting the All option for your build information
Other way is to clean all targets and build again :)
I have a strange issue and possibly a bug. My NSLog statements have stopped working completely, they do not print even in view did load, application didfinishlaunching etc. The have all turned a brown colour (the same colour as a pragma mark in xcode) and they all have a warning saying 'expression result unused'. Has anyone ever seen this before or know what to do? Am i running in some kind of weird mode? Im running xcode 4.0.2.
Many thanks
Jules
for completeness, I had the same problem and the answer was different, hope it helps someone else who bumps into this post:
I had a framework (an Amazon one) redefining NSLog, went there (Cmd+Click on the Brown NSLog) and commented out the redefinition...
The actual problem was the release_build set to 1. So it wasn't recognizing nslog, as you said it was set for a release build.
I had the same issue :
what worked for me is given below:
Remove the derived data folder
After removing derived data perform the clean action (You can see this option in the product menu)
Quit the Xcode and start it again.
And this did the trick all my NSLog were working fine.
Hoep this helps
Ensure that scheme chosen corresponds to Debug mode because sometimes the pch file might have some definitions such that logging is done only in the debug mode
(Scheme is on to the left of the place where you select iPhone Simulator / iOS Device)
In the view select Debug Area
(There are 3 view buttons, on the top right hand corner of Xcode, press the center button)
Select "Show variables view and the console"
(In the debug area (bottom) there are ther 3 buttons, press the center button)
I had the same issue and the problem was that I was building an Ad Hoc version (schema was for Ad Hoc build). The warnings disappeared when I built for debug.
Try changing the dropdown menu at the bottom of the console to 'All Output'.
if you are using libraries like 'KScan' or 'iKEA' or 'kdc-scan', so it can happens that, they will call methods like this one 'redirectNSLogToDocuments'.
in my case the object of 'iKEA' call the method 'CheckIfDeviceConnected' and this one redirect all nslog outputs to documents. after commenting out, all nslogs works again :)
hope this will be useful for some one.
some steps :-
1) "Clean all targets" or delete your build and rebuild again.
2) If step 1 doesnt work , reinstall xcode
I created a blank NavBar project and only touched a couple lines or so on one of the view controllers. I tested it fine in the 4.3 iPad and iPhone emulator but can't make it work for 4.2 at all. I get an error saying:
The selected run destination is not valid for this action.
This is what I have on my project settings:
Usually in XCode 3 that was all I needed to change but I guess I'm missing some setting in XCode 4.
What could this be?
#pokstad, you are right. I was looking at the wrong place indeed!
Choosing the target and changing the SDk there did the trick.
Thanks!
I really had troubles with this and none of the hints helped.
Finally I got an error message that pointed to an old file in the build folder, in the end a simple clean did resolve my issues (shift+cmd+K). It compiled fine. So remember to clean your current build after you changed the build settings in Xcode4.
This may be obvious, but at that moment it wasn't obvious to me.