Today View Extension (Widget) not working - ios

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.

Related

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]

Including a Playground in my project

I'm working in Xcode 9 on a Swift project, and I'm in table flipping mode with this.
Here's my end goal: put my tests next to my logic in a playground so that as I write the logic, I can see the tests pass in close to real time.
I will also accept how to put my tests in a playground by themselves, I just don't want to be running tests on a simulator for every little thing.
My problems in trying to get this to work are many. First and foremost, I can't find a way to add a playground directly to my project/workspace. When I right click on a group in the project navigator and select 'New file...' I get this:
As you can see, no option for playground. Filtering also returns no results. If I press the plus button at the bottom of the project navigator, the same dialog (with no playground option) pops up.
I thought it's in another menu so I went to the File menu, and in "New >" I find an option for creating a playground. I select a blank playground from the chooser, choose where to save it (strange that it wanted to save it under 'Unsaved Xcode Documents') and a basic playground comes up in a new tab. Odd thing I notice, though, is that there's no longer a play button or scheme/simulator selector at the top on this tab.
It now doesn't recognize ANY modules other than Apple provided ones! And sure enough, creating the playground didn't actually add it to my workspace. I guess I have to manually add it to my project. Upon doing so, it will recognize my pods but none of my project files! Any class I try to use gives me an Unrecognized identifier. Trying to import my project doesn't work either, it just gives me a No module.
I tried clearing DerivedData, I tried cleaning, I tried restarting Xcode, I even made sure I had an iPad Pro in the list of simulators (since that seems to matter for some people).
In frustration, I deleted the playground, and resolved just to deal with running my tests constantly. But now, my project has persistent errors! Despite moving the playground to the trash, Swift continues to error saying 'Unresolved identifier' for that playground!
As the excellent Brandon Williams says in his talk at FrenchKit, a playground "does not get access to anything in the application target." Which is ridiculous, but hey, what are you gonna do. So the answer is: there is currently no way to do this the way I asked.
It IS possible, however, to achieve this functionality if your logic is in its own framework/cocoapod. That is, move the logic you want to test out of your app target and into an outside library that your app, subsequently, imports. This will allow your playground to import it as well, and you can test to your heart's content.

Why does Acknowledgements.plist from CocoaPods look messed up on iOS 9 and what can you do about it?

CocoaPods auto-generates the Acknowledgements.plist file so that you can include that in your settings.bundle.
Following this, I have added Acknowledgements.plist into settings.bundle.
Acknowledgements.plist looks like this:
This appears nicely on iOS 8 like this (as intended):
However, iOS 9 inserts big blank spaces between title and footerText, which makes it ugly:
It looks like this is not this file (Acknowledgements) specific and iOS 9 in general puts huge vertical spaces between title and footerText. The question is, how can you solve this situation and put nicely formatted Acknowledgements in plist?
Good observation! I noticed the same some time ago, too. Hoped that this was already fixed.
Investigation
For me some footer texts are shown correctly. Those were very short, like just two lines. The longer the FooterText is, the larger is the empty space. E.g. Realm Database has a very long license text which leads to an empty space larger than one single device screen after its title and before its Footer.
I edited the Acknowledgements.plist manually to see if the line breaks make a difference: While keeping the text as long as it is I removed the line breaks.
Results
Unfortunately removing the line breaks does not help. So it's really related to the content length. Looks like it's a TableView and the row height calculation is just far off.
However, I didn't find any workaround. Title key is limited in its length so this cannot be used as a workaround. FooterText really needs to be fixed by Apple.
I filed it under rdar://24837397
There are several other bugs in the System Settings.app which are disturbing during development:
(Crash) Open the Acknowledgements section of your App. Run a new debug build of your App via Xcode and try to switch back to the Settings.app. Due to copying a new Settings.bundle with updated Acknowledgements.plist the Settings.app crashes.
(Missing content) Open Device Settings and scroll to your App's settings, but do not open them yet. Repeat the step from above and run a new debug build via Xcode. Switch back to Settings.app and try opening your App settings: Empty settings page shown, only permissions like Core Location and Mobile Data are available. You have to close Settings.app via the task switcher to see the new content of your Settings.bundle.
Beside those two bugs it drives me nuts that Settings.app doesn't have a section index. Scrolling to my own Apps during development is an unnecessary waste of time.. I know about the new search but that's also slower that an index just for the 3rd party Apps.
Edit: If you stumble upon this, please file a Radar too! This is important to really get it fixed, see https://blackpixel.com/writing/2012/02/radar-or-gtfo.html.
This is a bug in iOS 9, the problem has been fixed in iOS 10. Unfortunately nothing can be done for users that are still running iOS 9.
If you're using CocoaPods or Carthage, AckAck works well to generate the Acknowledgements plist for you. It removes unnecessary line breaks/indentation and generates a separate plist for each framework (making it less of an issue on iOS 9).
https://github.com/Building42/AckAck
(I'm the creator of AckAck)

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".

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

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!

Resources