• <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

        How to use NSNotification(如何使用 NSNotification)

        <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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  EAAccessory/EASession teardown during background(EAAccessory/EASession 在后台拆除)
                  Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                  ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                  How to get indexPath.row of tableView which is currently being displayed?(如何获取当前正在显示的 tableView 的 indexPath.row?)
                  Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                  MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)

                      <bdo id='V2dbT'></bdo><ul id='V2dbT'></ul>
                        <tbody id='V2dbT'></tbody>
                      <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>

                      • <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'>