I have a UITe开发者_开发问答xtView which I create in Interface Builder for an iOS app. I checked (and double checked, and triple checked) that it is properly connected to the outlet in my code. I create a property and synthesize it, and when I run NSLog(@"%@", myTextView);
, it returns the UITextView's properties, not null. However, when I try calling [myTextView setText:@"My Text."];
, it doesn't change anything on the view. I have found many people with similar problems like this on Stackoverflow and other places on the internet, however none of the solutions there helped me. I am using Xcode 4.0.2 on Snow Leopard. I am attempting to do this in the -viewDidLoad
method. What could be causing this issue?
If you need any more information about my code setup, post a comment and I will update this post.
Are you sure the whole text view is visible on screen, and that the font color is not the same as your background?
It is very likely that the view that is displayed on the screen is not the same view as myTextView
points to. Check [myTextView superview]
and make sure it's onscreen. Then look and see if you've accidentally covered it with something. Change other aspects like the backgroundColor
. Also, check the frame
and make sure it's not CGRectZero
.
精彩评论