2015-07-19 115 views
1

我已成功管理将我的分析数据字符串指向UILabels并让它们在UITableViewController上显示内容。将分析数组分配给UITextView

在我的UITableView单元格上我也有一个UITextView来显示Parse的数组。这个数组被称为“Post_Description”。在我的Storyboard上的单元格中,我给了我的UITextView 103的标签。

但是,当我运行此代码时,我遇到了崩溃。

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

这里是我的呼吁UITextView中的代码:

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

enter image description here

Parse

回答

1

这是一件好事,因为我结束了深挖洞后自己搞清楚了这一点进入一些材料。

首先创建您的UITextView的标识,点到你的UITextView的电池标签:

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

然后你在解析分配一个NSArray给您的数组:

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

然后你加入他们的行列婚姻是这样的:

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

这就是你如何显示在解析数组,到UITextV iew :)