0

I'm using a UISplitViewController, with a view that has a UITextView as the master view, but the text does not load until I rotate the ipad twice.

Logging when the app starts shows that the text view is available and the text inside it (which is defined in the nib file) is also loaded properly.

What am I doing wrong?

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
zlog
  • 3,316
  • 4
  • 42
  • 82
  • It seems to only occur in the simulator. On an iPad, the text appears when I first run it. – zlog Jan 06 '11 at 17:17
  • Actually, it's not showing on the iPad now too. Strange. – zlog Jan 06 '11 at 17:19
  • It seems like the problem only occurs when I start the app in portrait mode - it could be an issue with the UIPopoverController not loading the text view text properly. – zlog Jan 07 '11 at 11:03

1 Answers1

3

It seems like I've found the limit to how many characters can be initially loaded into UITextView in a UIPopoverController (for portrait mode in UISplitViewController). The maximum number of characters is 621.

I thought it weird that if I override the text view in viewDidLoad with

self.textView.text = @"hello";

it would work, but loading the text from the nib as is didn't. Through some trial and error, it seems like 621 is the maximum number characters before the text view doesn't show upon initial load.

Using a UIWebView and loading the content in code fixes this.

zlog
  • 3,316
  • 4
  • 42
  • 82
  • 1
    For me it seems based on number of lines instead of number of characters (specifically, it won't show if I have more than 23 lines). – ryleigh Nov 25 '11 at 01:46