UILabel won't display in app

Go To StackoverFlow.com

0

I am completely stumped by this one.

I am having a problem getting UILabels to display in an app.

I have three labels added to the xib. All three of them have identical settings with exceptions of the text, the text alignment, and the IBOutlet they are connected to. When the app loads, only one of the three labels displays on the screen. I have done everything I can think of to troubleshoot this bug and fix it, and I am coming up empty.

I have done the following in an attempt to fix this behavior:

  1. verified that the IBOutlets are connected properly in IB
  2. deleted and reconnected the outlet connections in IB
  3. verified that the labels are alpha=1, and hidden=NO
  4. deleted the labels entirely, recreated and reconnected them
  5. NSlogged them to ensure they weren't nil
  6. NSlogged their attributes to ensure that they had valid CGRects, and that all other settings were as expected
  7. numerous clean builds
  8. deleting the app from the device
  9. reinstalling the app on the device
  10. quitting and restarting xcode
  11. dragged a completely new label onto the xib in IB, changed its background color, inputted static text. This UILabel did not display either
  12. dragged various UI elements (buttons, controls, switches, some of my UI imagery) onto the area of the xib where the labels should be, all of them DID display
  13. verified that no other views are obstructing the layout and/or covering the labels
  14. verified in the code that I am not altering the labels in any way that would make them not visible (i.e. no alpha or hidden changes, text and background colors are not clear, I am not overwriting the memory locations, reassigning the values, releasing)
  15. programmatically created the labels and drew their Rects in the appropriate spot
  16. I even got a different device and performed the same device-related steps on it
  17. google searched for answers
  18. found Greg Fiumara's blog and followed his steps
  19. there are likely a few other things I tried that I can't remember at the moment

After doing all of this, I still can't get the labels to display at all. While the third label, which I mentioned at the beginning of this question, displays just fine. I am completely stumped. I could include code snippets, but I'm not sure how that would help at this point, especially given steps 11,12, and 13 above.

Does anyone have any ideas?

2012-04-05 21:53
by EmphaticArmPump
Is the view controller class set to the correct class in the xib - lnafziger 2012-04-05 21:58
@inafziger Thanks for your comment. Yes, the view controller class is correctly set in the xib. It's weird because EVERYTHING else in the xib and that I create and add to the view programmatically displays correctly. It is just these two labels (and the label from #11 above) that won't display - EmphaticArmPump 2012-04-05 22:03
I've no idea what's going wrong but would be interested in the xib. Could you post the source here - Andy Friese 2012-04-05 22:04
I didn't see if you checked the text color to ensure it is different than the background. Have you tried that - Rob 2012-04-05 22:32


0

As it relates to number 7 in your list...I've had weird stuff like this in xcode before. Have you tried running Onyx? This has fixed a variety of items related to xcode. Seems xcode leaves lots of residual files and ghosts on the mac that can have very strange outcomes...especially if you do a lot of apps or samples at a time.

http://www.macupdate.com/app/mac/11582/onyx

Hope this helps. (if not, upload the sample code and I/we can take a look at it) Mike

2012-04-09 20:28
by Mike
Ads