Wrong image is shown in interface image in WatchKit - swift

I'm seeing a bug in WatchKit where it shows a wrong image when assigned by name programmatically or from the storyboard. Am I doing anything wrong here?
How to reproduce
Add images to the WatchKit app with names image_1.png and image_10.png.
Set the first image to the interface image: image.setImageNamed("image_1")
Expected behaviour
First image image_1.png is shown.
Actual behaviour
Second image image_10.png is shown.
Tested in Xcode
Version 6.2 (6C131e)
Version 6.3 (6D532l)
Demo
https://github.com/evgenyneu/watch-image-glitch-demo
Update
This bug has been submitted to Apple Bug Reporter. Apple confirmed that this is a bug.

You should definitely file a Serious Bug radar. I pulled down your sample project (great work by the way) and ran it. I'm certainly seeing the same behavior on Xcode 6.2 (6C131e).
I also moved the images into the xcassets bundle which didn't have any affect on the issue. The only thing that I noticed is that renaming the image_10 to image_11, image_12 or image_100 did fix the problem. It appears that only image_10 is the culprit.

If you want to show just one image, you can still use startAnimating with a range that starts at your image and has a length of 1 (duration is 0 in this case). It works fine as a workaround until the bug is fixed.

Related

Background color won't change xcode

I just opened up a new default swift project, and no matter what I do, this background color will not change. As you can see, I have it set to the system yellow color but it's still on the default black color it comes with. The internal error warning keeps coming up as you can see in the photo below, and even if I clear the derived data it's still there so it may have something to do with that. It may also be important to mention that I'm running xcode off of an external ssd which I figured out how to do using these instructions. It does say that I may run into issues as the answer is for older versions of xcode, so that could be something, I'm not sure. Thanks in advance!
I don't have 10 reputation yet so here's the photo link

SKLabelNode creates black line and not showing text on iPhone4

I am loading different texts into a SKLabeNode it works fine on iPhone5, simulator, etc... but on iPhone4 I sometimes just get a black line, instead of the text.
It is weird that always the same texts are generating the failure, but I cannot figure out what is happening.
The code is:
ButtonText=#"";
ButtonLabel=[SKLabelNode labelNodeWithFontNamed:#"Marker Felt"];
ButtonLabel.fontSize=46;
ButtonLabel.text=ButtonText;
ButtonLabel.position=CGPointMake(0, 0);
ButtonLabel.verticalAlignmentMode=SKLabelVerticalAlignmentModeCenter;
ButtonLabel.horizontalAlignmentMode=SKLabelHorizontalAlignmentModeCenter;
ButtonLabel.colorBlendFactor=1.0f;
When I am changing the text, simply using the
ButtonLabel.text=NewString;
What can be the issue?
I have filed a bug report on this bug to Apple. After few weeks they replied and requested to check the issue with the updated IOS. It worked better and accepted longer texts. Later they fully solved the problem.

Is it possible to fix an iPhone app for iOS6+7 and 3.5 + 4 inch displays without editing code?

At this time I'm trying to edit an app of mine to support iOS6+7 aswell as 3.5+4 inch displays.
However I'm trying to do this without changing the code. And it works fine...for one of my requirements.
First I tried fix the 3.5/4 inch display issue with autolayout/contraints. It worked well but either it looked good with iOS6 or iOS7. And I didn't find a way to fix the iOS6/iOS7 diffrence without adjusting tons of code.
Then I resetted my contraints, disabled autolayout and fixed the iOS6/7 issue via offsets (iOS6/7 Deltas). Worked fine too for resolving the other requirement.
Since you can't use offsets AND autolayout at the same time I'm wondering if it's not possible to fix both problems without either checking iOS version or display size in my code?
I didn't provide code or screenshots because it's a more general question and I'm trying to solve this issue without touching my code. However what I can say is that I'm using .xib files to create the views not knowing if that's a problem too...
Thanks in advance,
blaluma
if your using storyboard with autosizing you can achieve that one

Couldn't find default.styleproto in framework. iOS 6.0 on 4.5

Its showing up with no graphics because of this, and this just happened. Everything was working fine until this new update came out. I created a new project to test if I messed up the original one, but still same problem. I also repeated the steps but I keep finding the source of the problem to be in the actual Map view in the objects folder for you to add to the storyboard. It does not seem to be in the Mapkits framework, but I may be wrong.
I just ran up against the same problem. It appears to be a problem with setting the mapType property of a MKMapView. In my code I commented out this set and everything ran fine.

Problem displaying font texture (SDL Xcode 4 project)

The below project of mine works fine with OpenGL on Windows and the Mac but will not work on the iPhone simulator or physical device.
The below link is to an Xcode 4 project containing the usual SDL examples plus an extra one called Rectangles2. I can't get my font characters to appear on the screen - I just keep getting a white rectangle.
Can somebody please have a look and tell me what is wrong with my project?
Please don't be critical of how its coded - I would just like to know what I'm missing to make it work.
Xcode Project
Thanks
I've just been told the problem was my parameter to the glTexImage2D function. The code I borrowed uses some literal values 3 and 4 whatever they are. Anyway, changing these to GL_RGBA has solved my problem.. so I'll have to go and read up on what this function actually does and how it works etc.