what might cause macOS app to render all blurry on retina macOS - xcode

I have a problem in my existing macOS project.
My windows/views render all blurry on a retina Mac when I run it.
It look perfectly fine in Xcode when working with the storyboard.
If I add a new window to my existing app it looks like this (all blurry):
while when I do a new project it looks like this (perfectly sharp):
i am searching for what might cause this for hours now but am still without a clue.
Does anyone know what might influences the rendering of my macOS app?

Turns out I had to set
NSHighResolutionCapable
to
yes
in my projects plist file.
Not sure tho what exactly is different on the "new" project that removes the necessity to do this.
with this property my old project is rendering properly now.

Related

Macos app displays view in Xcode, but is totally blank when launched outside of Xcode

I'm working on a small macos app, which I'm building with storyboards/interface builder in Xcode 10.2.1 on MacOS 10.14.5 (though I've set a deployment target of 10.13, if that matters).
When I run the app within Xcode, i.e., by hitting the "play" button, it loads up just fine and is visible and operates.
However, when I "archive" it to a freestanding executable and then try to run the app from the hard drive, it opens up on a blank screen. (See screenshots below.)
I've cleaned the build folder. I've also made sure to clear any/all build warnings and autolayout constraint warnings.
Here it is, running perfectly fine within xcode:
And here it is, displaying nada when run on its own:
The app uses no third-party libraries, no bundle assets, and only has one ViewController---nothing fancy at all happening here. The only weird UI thing that I'm doing is that there's a very small webview in the bottom-right corner that I'm using as a hack to load js-based web content (the mysterious white dot in the working screenshot).
Ok, I figured this one out myself, so for the purposes of google/if someone else has this problem: there seems to be a bug in WKWebView of some kind, adding it to IB kills everything else in the view. (Or maybe this is intended, and WKWebView requires it's own independent view? Dunno.)
The solution is to create it programmatically and never put it in the view at all. You can still load web content in the background, scrape information from pages, etc. without it ever being part of a view.
Not only WKWebView, also AVPlayerView should not placed int IB, too.
it cause same result.

Xcode storyboard showing osX object library. I want IOS object library

I develop mainly IOS apps but, recently, I worked on an OSX app. Both are possible with Xcode (I use 8, with swift).
Unfortunately, when I switched back to my already-existing IOS project (after restarting Xcode), the storyboard selection menu for the object library shows only OSX objects, not IOS (e.g. UIImageView).
I have googled without success and tried restarting Xcode, also without success. Can anyone help me fix this?
I did a lot more searching and came up with:
Xcode is loading in OS X objects instead of iOS objects
There there are other solutions proposed but the one that worked for me was to close the assistant editor and then, in the file list ( leftmost window in Xcode 8), I double clicked on the storyboard file. Problem solved. I am surprised that this bug still exists in this latest version...it is very troublesome.

How to setup correctly iPad Launch Images in xCode 4.2 for both orientations

Ok. So I have iPad app in Xcode 4.2 targeted for iOS 5.1. I provided it with launch images for both landscape and portrait modes and it has some serious trouble with using them properly.
First in landscape mode it shows proper landscape image but rotated by 90 degrees CW and cropped on the right side. Then when it starts to display it properly but does it also in portrait mode (as if it doesn't recognize portrait mode at all anymore).
I've seen some suggestions like providing portrait image with rotated content for landscape mode, etc. but the problem is I can't for the life of me make xCode use both images in right moments.
Is there some voodoo for that? Like setting them in proper order, use plist directly or the slots in GUI, putting them in some special directory or two different directories, I don't know - anything? Fighting xCode over such things will make me puke with blood one day...
Ok, one thing to know is that xCode seems to be very capricious when it comes to updating settings, resources etc. I deleted references to the launch images from the project, cleaned the product in xCode and removed the app from simulator but it still somehow managed to use the launch images even though it didn't show copying the images in build log.
I'm not sure if it took the pictures from derived data or what but I had to delete derived data and remove the images manually from the app bundle in ~/Library/Application\ Support/iPhone\ Simulator/5.1/Applications/ to make it stop. Then I pasted the images manually into the app bundle and now after publishing both images work properly in the simulator ignoring the fact that I didn't set them up at all in xCode!
I'm still not sure how to proceed with the device version - it obviously doesn't have the launch images now...
Apparently xCode doesn't care at all about setting anything about the launch images apart from including properly named images in the project so they get copied to the bundle. As I wrote above you can even inject the images into the app bundle and it still works.
The other side is that once you get the images there it may by hard to get rid of them.
So anyway now I have nothing in my plist about the images, nor anything in the slots in the Target Info and I have four working launch images in my app (both orientations and retina).
Hope it helps someone sometime..

XCode project corruption

I've been working on an iOS project in XCode for a while now (XCode 4.4.1). This morning, I started up XCode (first time fresh for a while) and it started downloading an update. Once this was done, I noticed that most of my project was gone. All of my original files had been removed from the project. I checked the filesystem and they were still there.
I restored the project folder from Timemachine but the project was really confused and throught it was a MacOS project. So I created a new project and just copied my files into it.
That kinda of worked but now when my app runs it always runs in portrait mode even though I've set the project options to only run in landscape mode. In landscape mode, the text (and buttons and such) are all 90 degrees off. When I rotate the simulator the app does not respond.
I've set the storyboards to all run in both inferred and landscape orientation but neither worked.
Am I missing a project setting that will let my app work again?
Has anyone else suffered a project corruption like this?
I saw something like this when I migrated to iOS 6. I just bit the bullet and manually changed my MainWindow/RootViewController setup into a MainStoryboard. It worked out pretty well. Make sure you've disabled devil autolayout too.
Problem solved: I'm dumb.
The project was corrected so I rebuilt it. Being stupid, I changed the name of a couple of files (the view controllers) but forgot to update the storyboards. That's what happened when things go bung at 5AM.

Tab Bar Icon display issue in universal app

I have an odd issue that's driving me nuts by now. Hopefully someone here can help me or ran into something similar. I've searched up and down but didn't find anything similar.
I am creating a universal app (Xcode 4.3.3) with storyboard including a UITabBar with 4 icons. The icons are from the free glyphish set, and look just fine in the iPhone simulator. In the iPad simulator, however, they look enlarged, and only about the top half is visible in the tabbar.
In addition to the original icon, I also created #2X, ~ipad and #2X~ipad versions (I did this for pretty much all art via batch in Photoshop). However, the icons look the same (i.e. too large) in the iPad simulator even when I remove these other versions and only keep the glyphish original.
I looked at the storyboard source code, I changed around a bunch of Tabbar and TabbarItem settings in the storyboard, nothing seems to help. HELP!
EDIT: I just noticed that the icons look fine in the iPad (Retina) simulator!?!?
SOLVED IT:
OK, solved it myself. Not sure which of these steps did it, but here's what I did:
delete the app from the simulator
Clean the Project
Recompile and Run
Now the icons display correctly. Go figure.
SOLVED IT: OK, solved it myself. Not sure which of these steps did it, but here's what I did:
Delete the app from the simulator
Clean the Project
Recompile and Run
Now the icons display correctly. Go figure.

Resources