5

We had a strange bug report from a user who has iOS 4.2.1 on an iPhone 3GS. A lot of the UITextLabels in the app are offset at strange locations. Has anyone else come across this issue.

The app is laid out correctly on all devices we have tested on and we have only heard of this issue from 2 users out of over 100,000.

This could be related to Three20 styles.

misaligned text

enter image description here

Eamonn Fallon
  • 543
  • 5
  • 15
  • You should mention Three20 in your headline and in the first line of your question, as this is almost certainly the source of your problem. Also, why would you use something like Three20? Laying out tableviews is really not especially difficult, and using a third-party library (for anything, really) exposes you to this kind of hard-to-debug problem. – MusiGenesis Nov 15 '11 at 14:38
  • can we see the code related to this TTTableItemCells? it's probably a reuse issue either in the layoutSubviews or the prepareToReUse function – aporat Nov 15 '11 at 15:22
  • I don't think it's a reuse issue as the back button text is also off – Eamonn Fallon Nov 15 '11 at 15:33
  • Point taken, it's annoying to have to rely on a 3rd party library, but Three20 has some really nice features like styled text, image caching, photo browser, styled buttons etc. Regardless, it would require a ground-up rewrite to remove three20. – Eamonn Fallon Nov 15 '11 at 15:37
  • We have similar issues reported for our iPhone app which uses Three20's TTLauncherView: similar problems, similar apparent rarity. We are going to switch to Nimbus, which is basically Three20 built from the ground up with much better documentation and - hopefully - less issues. – cthulhu Nov 30 '11 at 08:23

2 Answers2

9

We hit exactly the same issue with our layouts. We are not using Three20 though. There is a known issue when building with iOS 5.0 and running on iOS 4.2.1 that causes CGRects to be initialised incorrectly once you are using optimised code. (ie compiled with the fastest,smallest optimization level) so you won't see it when testing on a debug version which usually has this set to None.

There is a workaround to fix it. You simply need to add a compiler flag for:

"OTHER_CFLAGS[arch=armv6]" = "-mno-thumb";

(You can add this either directly into the project file or from the build settings tab of the project).

Please see an apple forum thread explaining the complete issue:

https://devforums.apple.com/thread/122059?tstart=15

Cliff
  • 138
  • 5
  • Thank you so much for this! I was banging my head against this for hours trying to figure out why my UIView's center property had funny values after setting the frame. To be clear, this is NOT in any way related to Three20, it is a 4.2.1 issue on armv6. -mno-thumb cleared it up. Thanks again! – Mirkules Dec 31 '11 at 08:53
  • Great thanks for that! For instructions on how to add this flag using the ui see: http://stackoverflow.com/questions/8390606/is-there-a-way-to-compile-for-arm-rather-than-thumb-in-xcode-4/8391567#8391567 – Eamonn Fallon Jan 04 '12 at 18:32
  • Dear user! You can't even imagine how much I love you at the moment! – Anton Jan 18 '12 at 14:22
  • Thank you user973793 for solving this issue with Xcode optimization problem! And thank you Eamonn for posting the original question! Reading the apple forum discussion, this issue still exists in Xcode 4.2.1 and is only repaired in Xcode 4.3 beta for now. – Rei Feb 22 '12 at 17:17
0

Ask the users if their device is jailbroken and if they installed any fonts on their device.
Or does your app come with new fonts?

I one had exactly the same issue on both mac and iOS when i added a custom font that replaced a system font.. (that was actually the same font but the OS was drawing it differently)

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
  • The user is no longer responding, so I'm not sure if jail breaking was the issue. I've added a jailbreak check now to the feedback email in the app. Thanks for that! – Eamonn Fallon Nov 20 '11 at 18:47