Providing text container breaks UITextView editing

Originator:robnapier
Number:rdar://14571453 Date Originated:28-Jul-2013 01:01 PM
Status:Open Resolved:
Product:iOS SDK Product Version:
Classification: Reproducible:
 
Summary:

If an NSTextContainer is provided in -[UITextView initWithFrame:textContainer:], the resulting object does not conform to UITextInputTraits, and will crash when the keyboard is displayed.

Steps to Reproduce:

  UITextView *nilContainerTextView = [[UITextView alloc] initWithFrame:CGRectZero textContainer:nil];
  NSTextContainer *container = [[NSTextContainer alloc] initWithSize:CGSizeZero];
  NSLog(@"%d", [nilContainerTextView autocapitalizationType]);
  NSLog(@"%d", [containerTextView autocapitalizationType]);  // Crashes


Expected Results:

Should output "2" for both NSLog() statements

Actual Results:

Crashes with "-[UITextView autocapitalizationType]: unrecognized selector sent to instance" in the last NSLog().

Regression:

Yes (vs OS X equivalents)

Notes:

I am trying to port TextLayoutDemo from OS X to iOS 7:
   https://developer.apple.com/library/mac/#samplecode/TextLayoutDemo/Introduction/Intro.html

I would expect this to be trivial, but I keep running into crashing problems like this one. See also radar: //14568899. I would like an piece of example code demonstrating editable multi-column layout on iOS 7.

Duplicates

Number Status Originator Product Title
rdar://14568899 Duplicate/14571453 robnapier iOS SDK Turning off text view scrolling crashes layout manager

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!