I have run into a definite issue with NSString and boundingRectWithSize.
On an iOS 8 iPhone, everything is sound and well. It calculates the correct size of a string when rendered with a font at a certain size.
With a iOS 9 GM seed iPhone, the width is always maxed out at 320, consistently. If the string is short, below 320 points, that will be correctly and consistently reported as on an iOS 8 device, but when an iOS 8 device reports a width beyond 320, the iOS 9 device always reports a width of 320.
The app is compiled using Xcode 6.4, ie using iOS 8 SDK. The OS I use is OS X El Capitan GM seed. I have heard, that using Xcode 6 on El Capitan is not really recommended. The recommended version of Xcode for El Capitan is Xcode 7. I cannot use Xcode 7 yet (but will try it shortly, just to try...) because of business reasons.
UPDATE: I just tried compiling using Xcode 7 and SDK 9.0 - the widths are still maxed out at 320. The Xcode and/or SDK version is not the issue. iOS 9.0 is either bugged here or just behaves differently ;-)
Anyone ran into the issue?
If I find no one else, I guess I will report this bug (I suspect it is a bug. Or just inconsistent behaviour which I really don't think Apple meant without giving some kind of deprecation warning) to Apple.
I have found a solution, or answer if you will.
I don't think there is a bug in iOS 9, it just behaves differently, and from what I understand, more correct, than iOS 8. So yes, inconsistent, but better...
The size I fed to boundingRectWithSize: was always set to like 320x30ish. On iOS8 this function happily ignored the max width there and returned sizes above that, above 320 in my case. iOS 9 however correctly does not return sizes beyond that max size.
So I just changed the maxsize to CGSizeMake(CGFLOAT_MAX, 30) and now iOS 8 and 9 seem to both report the same sizes even beyond 320. Case closed.
Related
I've recently updated my iOS app project for Xcode 9 and iPhone X and have a very strange problem.
The app, which looked good when built with Xcode 8.3.3, now looks all blurry. Fonts are not longer crisp.
The app is iPhone only and the target platform for the app is iOS 9.
I've noticed that the only device the app still looks good on is the "iPhone mode" (little sreen in the middle) of an iPad Air.
It seems as if some weird scaling effect is happening in the background but I can't figure out what it is.
I've tried setting the frames of labels with CGRectIntegral() method, to insure OK coordinates, but it did not change.
If you are noticing this behavior in the simulator, it's likely that you enabled Physical Size scaling. Go to Window and select Pixel Accurate to disable this function.
I have designed my storyboard in Xcode 7 and it's looking fine across all devices. I set the fonts from Interface Builder but when I run the app from Xcode 8 beta in iOS 9.x, the button's and label's fonts are changed automatically. Is it a bug in Xcode 8 beta? Also, is there any way to fix this issue without changing every components fonts manually?
I have the same issue in Xcode 8 release with iOS 10. In the app built for iOS 10 in Xcode 8 running on iOS 9.3 both simulator and on a real device 6plus the font size decreases in size. Oddly enough running on an iPad
Running the same build in iOS 10 everything is fine.
This is a iPhone app, not universal.
[Edit] - If I check Check the "Selectable" checkbox in the xib attribute inspector the problem goes away. This is for a read-only UITextView.
Interesting.
I'm using Xcode 7 beta 4, Mac OSX 10.10. My app's deployment target is iOS 7.0.
I know that standard Aqua space is 20 between a view and its superview. But when I design storyboard for iOS 7, I must use 8, like this:
and it looks fine (above constraints is for search bar). When I run iOS 8 simulator, it appears like this:
So I must use right value is 20. But using 20 will cut off subview in iOS 7.
Anyone know if this is a bug or is there anything different between iOS 7 and 8? This happens with all simulators and real devices too.
It looks like this (what I actually see):
However, a screenshot taken from the simulator looks like this:
Here's another pair:
I've tried uninstalling the simulators, but that doesn't fix the issue. I've tried
⌘+1, ⌘+2, ⌘+3, but that hasn't fixed anything. I think this is because of a recent system upgrade to OS X 10.10.2 and Xcode 6.1.1. Is the easiest/best/only path a full uninstall of Xcode and downloading an older version? Please give me an alternative.
This is a known bug in OS X 10.10.2 beta.
https://devforums.apple.com/thread/243676
https://devforums.apple.com/thread/254997
iOS simulator scaled bug
iOS 8 and Xcode 6 Simulator Display Out of Alignment
iOS Simulator display scaled incorrectly
iOS Simulator drawing too big (not a window scale issue)
I am finding that Xcode 6.0.1 is messing up my code and output on simulator and iphone
Xcode 6 is making my landscape games look like crap on the simulator and phone (iOS 8).
When I run it on simulator for iOS 7 it works fine. Does not run still not on iPhone 5 iOS 8. Runs fine on iOS 7 iPhone 4 iOS 7
Therefore the issue is not the code, but Xcode or IOS or some combination.
Help me, thanks in advance
Here is a image on Xcode 6.0.1 with iOS 8
Here is a image on Xcode 5.1.1 with iOS 7
I had the same problem but then noticed the width and height were swapped around for ios8 so now my initwithframe looks like this
- (id)initWithFrame:(CGRect)frameOrg
{
CGRect frame = frameOrg;
isIOS8= ( frameOrg.size.width > frameOrg.size.height);
if (yes && isIOS8)
{
frame.size.width = frameOrg.size.height;
frame.size.height=frameOrg.size.width;
}
self = [super initWithFrame:frame];
...
...
...
}
I needed to delete the apps from all devices that it was installed on and clean all the projects (including deleting from the simulator) occasionally still runs in rotten apple mode but haven't found a way around that yet. About 95% of time runs in apple goodness mode. Seems to be something to do with the compile as when it switches to rotten apple mode it consistently mucks up everytime I run until I clean and recompile. Likewise everytime I get a good compile I can run that as many times as I like without if mucking up. So I think its an xcode 6 issue myself :( hope this helps.
Ps the game looks Cooool.
Just looked at your screen shots more closely. As well as the above , have you checked your iPad and iPhone settings are both set to landscape AND your not running the iPhone app on the iPad. Im just looking at the change in scale between your background and your icons. It looks a bit like another iOS8 problem I had when I accidentally ran the iPhone version on the iPad sim. UnClick "Universal" and try specifically setting and running the iPad version!