Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在ios中将数据表单tableview传递给viewcontroller_Ios_Objective C - Fatal编程技术网

无法在ios中将数据表单tableview传递给viewcontroller

无法在ios中将数据表单tableview传递给viewcontroller,ios,objective-c,Ios,Objective C,嗨,我是iOS开发新手。在我的应用程序中,我从数据库外部获取数据,并在tableview中查看,所以现在我已经在detailviewcontroller上创建了。提供有关数据的清晰视图,但数据不起作用 我使用的代码 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { detailviewpoliticalViewController *dvc =[[det

嗨,我是iOS开发新手。在我的应用程序中,我从数据库外部获取数据,并在tableview中查看,所以现在我已经在detailviewcontroller上创建了。提供有关数据的清晰视图,但数据不起作用

我使用的代码

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    detailviewpoliticalViewController *dvc =[[detailviewpoliticalViewController alloc]initWithNibName:@"dvc" bundle:nil];

    fieldpolitical * ff =[eventarray objectAtIndex:indexPath.row];

    dvc.eve =ff.title;

    [self.navigationController pushViewController:dvc animated:YES];
}
这是.h文件中数据的声明和初始化

#import <UIKit/UIKit.h>

@interface detailviewpoliticalViewController : UIViewController
@property (nonatomic,strong) NSString *eve;
@property (strong, nonatomic) IBOutlet UILabel *event;
@end

我认为ff.title没有任何价值,因为你们正在做的其他事情都很好。在将ff.title传递到下一个视图之前,请尝试打印它

首先检查dvc是您的nibxib名称

我想你的笔尖名称应该是detailviewpoliticalViewController。我从一开始就检查了您的xib名称是否正确,然后告诉我我将检查下一行

detailviewpoliticalViewController *dvc =[[detailviewpoliticalViewController alloc]initWithNibName:@"dvc" bundle:nil];

eve在detailviewpoliticalViewController中声明为属性吗?您真的应该使用更长的变量名。通过读取dvc.eve=ff.title;你不可能知道你在说什么。你确定ff.title不是空的吗?什么不起作用?它不是在推送新的视图控制器吗?或者新的视图控制器是空的?是的,它没有按下视图控制器。确定您是否检查了ff.title中的值。请打印出来。另外,print self.eve.im是ios的新手,请告诉我如何使用打印值NSLog@title是%@,ff.title&NSLog@passed值为%@,self.eve;第二个Nslog是详细的ViewPoliticalViewController Hi imac先生,如果我能获得你的skye或gmail id,我会有一些问题,这对我来说会更好,因为现在在一家小公司工作的新人现在我使用这个imac只有15天了,请帮我
detailviewpoliticalViewController *dvc =[[detailviewpoliticalViewController alloc]initWithNibName:@"dvc" bundle:nil];