2

i'm facing a really strange problem: i have some UILabel in my view, which has a black background, so i set their text color to white in Interface Builder in order to see them, the problem is, when i run the app on the simulator or on my iphone with ios7 or iOS 6.1.3 i can update them without problems (for update i mean: myLabel.text = @"Something")

but when i run the app on my sister's iphone 3gs with iOS 6.0 at the moment i update them the font color turns black. It seems that on her phone the label can't remember the color set on IB.

Does anyone of you know why this happens? Thanks

Trup
  • 635
  • 5
  • 17
Frankie94
  • 55
  • 9
  • The question has nothing to do with xcode,text and updates – Lithu T.V Jul 02 '13 at 10:00
  • 1
    well with updates maybe not, but i think a uilabel has to do with text and Xcode is used to compile for it, and it could be also an error of the compiler so... and last thing i think it's not polite only commenting that some tags are "not so" related instead of giving a real answer. anyhow... – Frankie94 Jul 02 '13 at 10:11
  • Did you try casual '*remove app from phone; clean/build project in XCode*' yet? – makaron Jul 02 '13 at 10:18
  • Is the label text type set to "Plain" or "Attributed"? – Fogmeister Jul 02 '13 at 10:51
  • As soon as possible I'll try makaron's solution, and let you know, meanwhile if anyone else has an alternative solution is welcome – Frankie94 Jul 02 '13 at 13:30
  • checked with my mother's iphone too and the problem is still there, so i tried to compile with xcode 4.5 and had no issues, so the problem is related to the beta ios7 sdk and this is not where to talk about it. thanks anyway for the help. – Frankie94 Jul 04 '13 at 07:57

3 Answers3

0

It sounds like you have set the label "type" to "Attributed" in Interface Builder.

If this is the case then it is not the label that holds the text colour. It is the text itself.

If you replace the text with something else then the default text color of black will be used.

If you want to continue using Attributed text then you need to add a "foregroundColor" attribute to the text before setting it to the label.

The easier way round this is to change the label type to "Plain" in Interface Builder.

Of course, this depends on you having set it to Attributed.

Fogmeister
  • 76,236
  • 42
  • 207
  • 306
0

I think you shouldn't use default label color in the interface builder, just provide something else (black color or etc.).

Oleg Kovtun
  • 362
  • 1
  • 3
0

I ran into a similar problem. Was stumping me completely, until I quit and relaunched the simulator. It wasn't enough to just close the window or rebuild. I had to cmd-q, then build and launch again. Magically fixed the issue. Annoying.. but worked for me

Adam B
  • 3,662
  • 2
  • 24
  • 33