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.
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"];
- Can downloaded images/files be added to my app bundle?
- Push segue in xcode with no animation
- How do you see the specific methods responsible for memory allocation in XCode Instruments?
- Testing with iOS 6.1 simulator and XCode 4.6
- NSTextView with Smart Quotes disabled, still replaces quotes
- Playing audio in Xcode 7 / Swift 2 Not Working
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 🙂
- @selector with multiple arguments
- iOS – Cydia open command and its counterpart?
- MKAnnotation, simple example
- _OBJC_CLASS_$_SBJsonParser referenced from: error
- Looking to understand the iOS UIViewController lifecycle
- Why is it necessary to call dispatch_group_leave the same number of times as dispatch_group_enter?
- UILabel – string as text and links
- Can't move keyboard view iOS9 swift
- iOS color to transparent in UIImage
- Growing NSTextView to fit contents is clipping last line of text
- Handling login functionality for native app connecting to web service
- Write a method signature including the class name for documentation
- UIDocumentPickerViewController – How to set the navigation bar color
- Push Notification in Iphone application
- Create and Present modal view controller programatically