Images in NSButton not showing up? - objective-c

I've tried that several times, and it seems there is some bug with that (Xcode 4.3.3 - OS X 10.7) :
Put an NSButton in Interface Builder
Set it to 'Image Only'
Drag'n'drop a system icon (e.g. NSAddTemplate)
But the icon fails to show (while I'm perfectly able to see icons when they're not system icons, but added by me).
Any ideas?

I've just tried, it works in a weird way.
Try to set image and alternate in the NSButton inspector.
Pick the images from the drop-down menu directly instead of drag-dropping it.
It works but it's just a workaround...

Alternate answer: Make sure the image files are included in the Copy Bundle Resources phase for your target (especially if you have multiple targets in your Xcode project). There is no build-time error or warning if you specify an image that is not in your bundle. (There is a runtime warning).

Related

Apple Watch Images not showing on simulator

I am working with the apple watch and I would like to just simply set an image in the storyboard. It is a png file and I set it in the storyboard, but it doesn't show up in the simulator. I have tried all of the aspect and fitting options. I believe the view is called a wkinterfaceimage. I have also tried adding programmatically and that does not show up either. Hidden is not checked. Any ideas of what I might be missing?
If you have your image included as a file in your app's bundle select the file, choose File Inspector and add the target under Target Membership:

Storyboard not rendering added views

I am trying to execute the steps described in iOS developer library basics tutorial. When I add "Scene to story board" run the simulator, I am not seeing the label. It is just white screen. Not sure what is causing this issue. Any suggestions?
Environment:
iOS SDK7.1
XCode 6.0
Rented server machine from MacInCloud.
EDIT:
Here is snap shot of my Xcode:
When I use "Single View Application" template, "Views" I am adding to story board are showing up properly in simulator.
It could be that the positioning of the label is outside of the visible screen. One quick way to rectify this would be to add a new Alignment Constraint so that the label is "Horizontal Center in Container". An example of how to add an Alignment Constraint below...
I thought to close this question first, but it seems not a good practice, so adding solution as answer.
I missed To configure the app delegate implementation file step from the documentation, which is why it is showing white screen. Make sure you delete the code which renders white background.

Cordova mac default window height width

I just downloaded Cordova for mac from https://github.com/apache/incubator-cordova-mac.
I haven't made any changes, so I just load it up in Xcode and hit run, but the first thing I would like to do is specify the window size. I'm not very conversant with xcode and can't find references to the window size, I can't find any nib files either.
How would I set the window size?
Edit I used the method described at How to set NSView size programmatically? in my contentView implementation file.
Cordova runs full screen, and depending on the size of the splash screens included in the project will scale to all respective devices.
If you want to embed Cordova in your application you have to look here: http://docs.phonegap.com/en/2.4.0/guide_cordova-webview_index.md.html#Embedding%20WebView

Image load on iOS simulator but not on iPad

The title pretty much describe my problem. I have a UIButton on which I applied a .png background. The .png load fine on the iOS simulator but not on the actual iPad. Any hints as to why it does that ?
EDIT:
When the view with the button in question loads I get this error message in the console
Could not load the "fosse.png" image referenced from a nib in the bundle with identifier "ca.polymtl.PolyPuttZE"
Try doing this.
In Xcode press:
Command+Shift+K and press Yes.
Command+Shift+Alt+K and press Yes.
The try building, running.
Also, check if the image has correct targets (you can check by clicking on the image in Xcode and then in Inspector you'll find build targets).
I've solved the problem. Turns out that the image wasn't encoded as a png even if it had the proper extension. So I juste opened it with gimp and exported it as a PNG.
Click on your project. Then go to the Build Phases tab and ensure that the file is in the Copy Bundle Resources list.
If not then add it...

iOs application icon, no as bright as on monitor

Small problem here, I'm building an app for ios, and I've added and icon to my project 57x57, and 114x114, but when I run my app on the device, icon is very dim, when original is very bright. How can I fix it? Does it matter if I build my app in debug mode or release?
iOS adds a gloss/shine effect to your app icon that can sometimes reduce the saturation of your image. Add the UIPrerenderedIcon flag to your info.plist file as described here to disable this.
EDITED to add iOS5 details
On iOS 5 there is a new key for specifying icons: CFBundleIcons is the raw name and it displays as 'Icon files (iOS5)' in the plist editor. To turn off the icon shine effect on iOS 5 devices you need to set the UIPrerenderedIcon flag on the Primary Icon as shown below.
To cover all cases (iOS3 - iOS5) you need to specify UIPrerenderedIcon in both places.
This is probably due to physical differences between your desktop monitor and iOS screen. Only thing you can do is redesign the icon and check the colors on an iOS device.
Check the brightness setting of your device's display. Perhaps it's not "up" as much as you think.
Or, you can disable the "shine" effect that iOS applies to your icon by adding the "Icon already includes gloss effects" boolean to your Info.plist file. That might help.