【发布时间】:2013-02-07 14:25:42
【问题描述】:
对不起,这对你们很多人来说可能是一个新手问题,但过去几个小时我一直在绕圈子。
我有一张桌子,当按下该行时会弹出第二个视图。
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
BlogDetailViewController *blogDetailViewController = [[BlogDetailViewController alloc] initWithNibName:@"BlogDetailViewController" bundle:nil];
blogDetailViewController.title = [idArray objectAtIndex:indexPath.row];
blogDetailViewController.newsArticle = [content objectAtIndex:indexPath.row];
[self.navigationController pushViewController:blogDetailViewController animated:YES];
}
然后在我的下一个视图中,我有一个文本框,我想显示 [content objectAtIndex:indexPath.row]; 的内容。
到目前为止,我已将其添加到 secoundview.h
@interface BlogDetailViewController : UIViewController{
NSDictionary *newArticle;
IBOutlet UITextView *descTextView;
}
@property (nonatomic, copy) NSDictionary *newsArticle;
我也有@synthesize newsArticle;在 secoundview.m 上,并连接了 IBOutlet。
目前为止
- (void)viewDidLoad
{
[super viewDidLoad];
descTextView.text = [content];
// Do any additional setup after loading the view from its nib.
}
希望能解释一些事情,如果这没有意义,我可以上传 zip。
谢谢
【问题讨论】:
-
有什么问题?你没有问问题:)
-
标题在哪里? newsArticle怎么去UITextField?
-
对不起,如果我不清楚,我希望 textview 显示我传递给它的信息。
-
如何在 UITextField 中显示 NSDictionary?你只能显示 NSString。
-
所以如果我将它更改为 NSstring,我如何让字符串显示在 descTextView.text 中
标签: iphone xcode json uitableview