• <small id='kX0Ii'></small><noframes id='kX0Ii'>

    <i id='kX0Ii'><tr id='kX0Ii'><dt id='kX0Ii'><q id='kX0Ii'><span id='kX0Ii'><b id='kX0Ii'><form id='kX0Ii'><ins id='kX0Ii'></ins><ul id='kX0Ii'></ul><sub id='kX0Ii'></sub></form><legend id='kX0Ii'></legend><bdo id='kX0Ii'><pre id='kX0Ii'><center id='kX0Ii'></center></pre></bdo></b><th id='kX0Ii'></th></span></q></dt></tr></i><div id='kX0Ii'><tfoot id='kX0Ii'></tfoot><dl id='kX0Ii'><fieldset id='kX0Ii'></fieldset></dl></div>
  • <legend id='kX0Ii'><style id='kX0Ii'><dir id='kX0Ii'><q id='kX0Ii'></q></dir></style></legend>

    <tfoot id='kX0Ii'></tfoot>
    • <bdo id='kX0Ii'></bdo><ul id='kX0Ii'></ul>

      1. 如何使用 NSNotification

        时间:2023-10-23

        <small id='SADMO'></small><noframes id='SADMO'>

        • <bdo id='SADMO'></bdo><ul id='SADMO'></ul>

          <i id='SADMO'><tr id='SADMO'><dt id='SADMO'><q id='SADMO'><span id='SADMO'><b id='SADMO'><form id='SADMO'><ins id='SADMO'></ins><ul id='SADMO'></ul><sub id='SADMO'></sub></form><legend id='SADMO'></legend><bdo id='SADMO'><pre id='SADMO'><center id='SADMO'></center></pre></bdo></b><th id='SADMO'></th></span></q></dt></tr></i><div id='SADMO'><tfoot id='SADMO'></tfoot><dl id='SADMO'><fieldset id='SADMO'></fieldset></dl></div>

            1. <legend id='SADMO'><style id='SADMO'><dir id='SADMO'><q id='SADMO'></q></dir></style></legend>

                <tfoot id='SADMO'></tfoot>
                    <tbody id='SADMO'></tbody>
                  本文介绍了如何使用 NSNotification的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的应用程序中有两个 viewController,分别是 FirstViewControllerDetailViewController.当点击表格单元格时,它会导航到 DetailViewController.在 DetailViewController 中,我想编辑并重新加载 FirstViewController 的表格视图

                  In my application there is two viewControllers as FirstViewController and DetailViewController. When tap on a table cell, it navigate to DetailViewController. In DetailViewController, I want to edit and reload the FirstViewController's table view

                  如何使用 NSNotification 解决这个问题?

                  How can I use NSNotification for this problem?

                  这是我要实现的方法 NSNotification 东西

                  Here's the method I want to implement NSNotification stuff

                  -(IBAction) save{
                  strSelectedText=theTextField.text;
                  
                  [NSNotificationCenter defaultCenter];
                  NSNotification* notification = [NSNotification notificationWithName:@"MyNotification" object:self];
                  [[NSNotificationCenter defaultCenter] postNotification:notification];  
                  
                  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (objFirstViewController) name:@"MyNotification" object:nil];
                  
                  
                  
                  [self.navigationController popViewControllerAnimated:YES];
                  }
                  

                  推荐答案

                  -(void)viewDidLoad {
                  
                  [NSNotificationCenter defaultCenter];
                  NSNotification* notification = [NSNotification notificationWithName:@"MyNotification" object:self];
                  [[NSNotificationCenter defaultCenter] postNotification:notification];  
                  
                  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (objFirstViewController) name:@"MyNotification" object:nil];
                  
                  }
                  
                  
                  -(IBAction) save{
                  
                  [[NSNotificationCenter defaultCenter] postNotificationName:MyNotification object:sender];
                  
                  //this will go to where you implement your selector objFirstViewController.
                  
                  }
                  
                  -(void)objFirstViewController:(NSNotification *)notification {
                  
                  }
                  

                  这篇关于如何使用 NSNotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何正确在 UIWebView 中进行身份验证? 下一篇:移动 Safari 中的线条伪影

                  相关文章

                      <bdo id='V2dbT'></bdo><ul id='V2dbT'></ul>
                    <i id='V2dbT'><tr id='V2dbT'><dt id='V2dbT'><q id='V2dbT'><span id='V2dbT'><b id='V2dbT'><form id='V2dbT'><ins id='V2dbT'></ins><ul id='V2dbT'></ul><sub id='V2dbT'></sub></form><legend id='V2dbT'></legend><bdo id='V2dbT'><pre id='V2dbT'><center id='V2dbT'></center></pre></bdo></b><th id='V2dbT'></th></span></q></dt></tr></i><div id='V2dbT'><tfoot id='V2dbT'></tfoot><dl id='V2dbT'><fieldset id='V2dbT'></fieldset></dl></div>

                  1. <tfoot id='V2dbT'></tfoot>

                    <legend id='V2dbT'><style id='V2dbT'><dir id='V2dbT'><q id='V2dbT'></q></dir></style></legend>

                      <small id='V2dbT'></small><noframes id='V2dbT'>