Assigning Parse Array to UITextView

I’ve successfully managed pointing my Parse Data Strings to UILabels and having them display the content on a UITableViewController.

On my UITableView Cell I also have a UITextView to display an Array from Parse. This Array is called “Post_Description”. Within my cell on Storyboard I have given my UITextView a tag of 103.

  • Xcode “Message from debugger: got unexpected response to k packet: OK”
  • Added pod files and pushed. How to undo? how to use gitignore in Xcode & github?
  • How to set a conditional breakpoint in Xcode based on an object string property?
  • Swift - Compressing video files
  • What OSX/XCode version control system should I use for iPhone development?
  • NSURL errors with caret ^ in string
  • However when I run this code, I’m getting a crash.

    Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI length]: unrecognized selector sent to instance 0x170239c60'

    Here is the code i am calling for the UITextView:

        UITextView *postView = (UITextView*) [cell viewWithTag:103];
    postView.text = [object objectForKey:@"Post_Description"];

    enter image description here


    Solutions Collect From Internet About “Assigning Parse Array to UITextView”

    This is good because I ended up figuring this out by myself after digging deep into some material.

    First you create your UITextView identifier and point to the cell tag of your UITextView:

    UITextView *myTextView = (UITextView*) [cell viewWithTag:100];

    Then you assign an NSArray to your Array in Parse:

    NSArray *myArray = [object objectForKey:@"MyArrayInParse"];

    Then you join them in marriage like so:

    [myTextView setText:[myArray objectAtIndex:[indexPath section]]];

    And that’s how you display an Array in Parse, into a UITextView 🙂