xcode 5 can't see NSLog(s) from old iOS project - ios

I have an older iOS6 app that I was playing with last year; it was only for my wife, so I never released it, but I wanted to dust it off and see if it was potentially useful to others. So I load it up in XCode5 (5.0.2 running on 10.8.4; I've also tried this on my home laptop running the same XCode and Mavericks). However, though the app builds and runs fine, none of my NSLog statements show up in the console, on either computer. I've cleaned, rebuilt, run it on every simulator and iPad I have, hunted through settings, torn my hair out, etc., but I can't figure out how to get them to show up. I started a new iOS app to make sure it's not something in my setup, but NSLogs from there work just fine. Unfortunately, I'm not even sure where to start looking to fix this. Does anyone have any ideas for directions that I should be exploring here? Thanks!
Edit: I just tried copying over the files into a new project, and now the NSLogs are showing up! Still leaves me with no ideas as to why they're not showing up in the old project.
Edit2: It's not just user error; I can see the log messages from the new project with the copied files (see image). They just don't show in the old project when I run it.

Maybe you're not opened a Console in XCode 5, it seems, you're trying see a logs in member console.
Try click at here and you will see console with "All Output" option:

As noted in the comment by #combinatorial, I had a debug statement hidden (so cleverly that I fooled myself) in the pch file. Thanks so much for helping me nail that down!

Related

What is the simplest way to copy project folder to new Mac with updated IOS and Xcode?

I recently acquired a newer MacBook to run the most recent iOS and Xcode versions. I copied a project folder to the new Mac and opened it with Xcode 11.4 (was 10.1 on old Mac). I get 14 errors all related to "Failed to render and update auto layout status for ..VeiwController". The simulator runs fine, but the main storyboard doesn't render the button icons properly. I can add new constraints to the buttons to show them properly but the errors don't go away. I assume I have lost some info/files related to autolayout when I copied folders. I have read about similar issues. Most talk about using Github or some other 3rd party for maintaining files. Is there any other way to get this done? It seems like updates computers/software should be simpler.
Since reporting this, I have used the same process of copying folders of all other projects and have had no problems. But one project, the largest and most complex continues to have 14 rendering errors and always the displayed err message "An internal error occurred. Editing functionality may be limited." The strange thing is going in and out of viewing Main.storyboard several times gets rid of the errors eventually. Unfortunately, the errors always come back when I open the project. And sometimes they go away, then come back randomly in the same session.
So the answer to "whats the simplest way to copy a project folder to new computer is just that - Copy the project folder! But thats the wrong question for this problem.

Audiokit 4.5 playgrounds opening, building, but no sound

In the past I've got previous versions of the playgrounds to work. However I can't get the new 2 day old version (4.5.0) from GitHub to work.
I downloaded the zip file from https://audiokit.io/downloads/ page.
I expanded the zip.
I launched Xcode by clicking on the AudioKitPlaygrounds.xcodeproj file.
I go to the Hello World tutorial.
I click on run button and it builds successful.
No errors, nothing in console, no yellow or red build or runtime errors - but no sound. Also no sound in the handful of other playgrounds I spot tested.
I search on the internet - and found an answer saying to add this setting, but it had no effect.
AKSettings.playbackWhileMuted = true
The volume is definitely on. I have got the ROMPlayer working as a separate project using cocoa pods. But not the playgrounds. Any help much appreciated. Thanks Domc
I've resolved partly the issue - although not clear to me why this works - answer posted in case it's helpful for others.
Having tried downloading various versions, none of which worked, I tried to build many times. I noticed it seemed to be getting stuck on "Running ...." with spinning dial at top.
Researching this led me to a post re another playground with similar problem that said to untick and tick the links to the frameworks on the individual frameworks pages which I did.
A few minutes later I tried running again and I got sound! However if I select the table of contents the whole program crashes x-code and on reload you have to 'reconnect' the frameworks by ticking and unticking. [Probably this shouldn't be happening]

Xcode 7 crash every time I try to print something in the debugger console

I've searched around and can't find anything on this.
Using Swift 2 and Xcode Version 7.0.1 (7A1001). Every time I execute something in the debugger console, Xcode crashes.
The project is not very big, and has less than 10 third party frameworks.
I can't think of much more information that's relevant, but I'm sure there's more, so please do ask me if there's anything I should add to my question that would help.
I've of course cleaned build and derived data.
It's driving me insane. Thanks!
UPDATE 16/11/12
Submitted rdar://23559366.
How are you maintaining your third party frameworks? Via Carthage?
If so then this is probably your issue: https://github.com/Carthage/Carthage/issues/924
This is an issue if the location of the /Carthage/Build/iOS folder is in a different location to where it was produced (i.e if it was compiled on a different machine and the absolute file path has changed).
A temporary fix would be to run carthage build --no-use-binaries on your machine to rebuild the symbols using the current absolute file path working around the bug.
But if you wasn't using carthage then its probably not your issue so sorry
I had similar problem with Xcode whenever I hit breakpoint.
In case you see this screen right before your Xcode crashes - you are lucky and my fix might save you. All you need to do is open this window and in the Project Navigator, select any file that you want, so that instead of that white blank view you would get your code. After this you are most likely will be able to successfully stop your app at your breakpoint and perform the debug.
I am not sure why this happens, but I suspect that the reason is Debug View Hierarchy mode, which you might have triggered prior to setting you breakpoint and trying to stop at it. At least this is when it happens to me.
I have similar problem earlier.
If you try to print non-optional variable and unfortunately it holds nil value then it breaks/crash. so that make sure declare all possible variables as "Optional type".

Cannot run program in Xcode

I've recently made an app and could successfully run and test it until this suddenly happened,
fail to run program
It doesn't looks like an issue, but the "run" button is unavailable. Usually it should look something like,
successfully run a program
As in the image, first there are two buttons, run and stop, after that there is the name of the program/app and its icon (fun facts) and then the iphone simulator it will run on (iphone 6). On the image on top, the failed to run program attempt, it is totally different, first the run button is disabled, second, the icon is a gear and not the app icon, and third, there is no simulator, it appears "my mac".
I don't know why this happened but this cannot let me run the app. I searched in the apple documentation and didn't found anything. If someone knows how to solve this please tell me.
The simplest solution is to rebuild your project from scratch. This is not difficult because you still have all your code. So, start with a new project from the iOS template. Copy your code from the old project into the new project.
And try to avoid renaming your project from now on, because there is a bug in some versions of Xcode where it crashes and destroys the project in just the way you describe in your question.
And update to the latest version of Xcode, because it is less likely to cause this problem (though in fact I have not found it reliable for renaming projects even now).

Today View Extension (Widget) not working

I found several other threads with similar problems, but no one has exactly the same problems.
Besides it DID work some time! the errors now keep occurring while it was working some time before..
When Running my app, that has a build Target "Today View Extension", I get no actual result.
The Extension is shown in Notification Center, but has no body (Simulator AND device).
Also when I try to run the App (not the target extension) and attach the process manually by PID I get this error:
I also had the error that my Extension (that has a "Bundle Display Name" entry in Info.plist for a custom Name) did show the Name of the Extension-containing App, and not the string that was set in the Info.plist
Strange thing is that sometimes it worked, sometimes it doesn't, but when it does not there were like five different reasons why not.
I want to ask people who have similar/same problems to post them here to collect all the issues appearing and possibly collect workarounds / solutions for these problems.
Thank you.
For anyone having troubles now:
With beta 4 and beta SDK 4 a lot of bugs were fixed:
[self setPrefferedContentSize:]
to set the views size is now working properly (if you have troubles viewing your Extension)
If your updated Extension is not showing in Notification Center be sure to have a look at the log output, there you can see what task the debugger is attached to, if there is "no Selection" try stopping and running again, it will work after some tries!
If you have questions feel free to ask,
Happy coding
I don't exactly have a solution, but I've observed this happening when anything is "wrong" with my Today extension. For example, if I don't have a file properly targeting the widget. I'm guessing that instead of just crashing to the home screen, iOS just gives you an empty widget? I've written about my own issues here, for reference.
I had similar issues. But it seems to be alright now. Since the "Today View" is an extension and is bundled with the containing app, you should just build and run the containing app. From there, you can pull down the "Today View" and if your widget / today view is not added, add it.
You should be able to see all your updated changes without a problem with this and you won't have to attach any process.

Resources