ios 将消息传递给模态视图

发布于 2024-11-18 07:24:46 字数 1245 浏览 1 评论 0原文

我有一个视图 [xib] 调用其他视图 [xib], 当我转到第二个视图时,一个值会发送到第二个视图.m

initWithNibName

但是当我将第二个视图调用为模态视图时,我的消息未发送,

我该怎么办?

Contacts *info = [XlistArray objectAtIndex:indexPath.row];

        string1 = info.c_name;
        editContactViewController *mensaje =[editContactViewController alloc];
        mensaje.string2 = string1;

        editContactViewController *vistaEdit = [[editContactViewController alloc] initWithNibName:nil bundle:nil];

        vistaEdit.modalPresentationStyle = UIModalPresentationFormSheet;



        [self presentModalViewController:vistaEdit animated:YES];



        /*
        Contacts *info = [XlistArray objectAtIndex:indexPath.row];

        string1 = info.c_name;

        editContactViewController *mensaje =[editContactViewController alloc];
        mensaje.string2 = string1;


        editContact = [[editContactViewController alloc] initWithNibName:@"editContactViewController" bundle:nil];

        [self.view addSubview:mensaje.view];

        [UIView commitAnimations];

        [tableView deselectRowAtIndexPath:indexPath animated:YES];*/

请注意,string1是我的发送者消息,string2是我的接收者, 评论部分是有效的,用于发送,

我该如何发送消息?基本抱歉

非常感谢!

I have a view [xib] that calls other view [xib],
when I go to the second view, a value gets send to the second view .m

initWithNibName

but when I call that second view as a modal view, my message is not sent,

how can I do it?

Contacts *info = [XlistArray objectAtIndex:indexPath.row];

        string1 = info.c_name;
        editContactViewController *mensaje =[editContactViewController alloc];
        mensaje.string2 = string1;

        editContactViewController *vistaEdit = [[editContactViewController alloc] initWithNibName:nil bundle:nil];

        vistaEdit.modalPresentationStyle = UIModalPresentationFormSheet;



        [self presentModalViewController:vistaEdit animated:YES];



        /*
        Contacts *info = [XlistArray objectAtIndex:indexPath.row];

        string1 = info.c_name;

        editContactViewController *mensaje =[editContactViewController alloc];
        mensaje.string2 = string1;


        editContact = [[editContactViewController alloc] initWithNibName:@"editContactViewController" bundle:nil];

        [self.view addSubview:mensaje.view];

        [UIView commitAnimations];

        [tableView deselectRowAtIndexPath:indexPath animated:YES];*/

Please note that string1 is my sender message, and string2 is my receiver,
The commented portion is the one that works, for sending,

how can I send the message? basic sorry

thanks a lot!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橙味迷妹 2024-11-25 07:24:46

发送至 dany_dev

   Contacts *info = [XlistArray objectAtIndex:indexPath.row];

    string1 = info.c_name;

    editContactViewController *vistaEdit = [[editContactViewController alloc] initWithNibName:nil bundle:nil];

    vistaEdit.string2 = string1;

    vistaEdit.modalPresentationStyle = UIModalPresentationFormSheet;


    [self presentModalViewController:vistaEdit animated:YES];

tnx to dany_dev

   Contacts *info = [XlistArray objectAtIndex:indexPath.row];

    string1 = info.c_name;

    editContactViewController *vistaEdit = [[editContactViewController alloc] initWithNibName:nil bundle:nil];

    vistaEdit.string2 = string1;

    vistaEdit.modalPresentationStyle = UIModalPresentationFormSheet;


    [self presentModalViewController:vistaEdit animated:YES];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文