Note that there are some explanatory texts on larger screens.

plurals
  1. USisaac
    primarykey
    data
    text
    plurals
    1. CONice approach using blocks. Another approach that would maintain the instantiation logic separately (which may or may not be desirable depending on existing architecture) would be to store the appropriate method name as a string in the dictionary. You can then dynamically generate a selector from the string. This is less efficient than using blocks or static selectors, but it is a possibility.
      singulars
    2. COThere's a few ways to approach this but you might try delegation. Define a simple protocol on whatever class is managing your tableView, give it a method like 'modelObjectInserted:'. Conform any classes that could potentially insert objects to the protocol you've defined. Whenever a conforming class will insert an object, it should also then call this delegate method. When the method is invoked on your table view controller, you can take then take appropriate action, for example calling reload or insertCellForRowAtIndexPath...
      singulars
    3. COSo it sounds like you're instantiating your tableView later than you need to be. Is there a motivation for not simply creating the table earlier in your code? I'm also not clear on how adding new objects to the array bears on the RVCs viewDidLoad... Assuming you've got the table on screen, if a new model object is added to the array, you should tell the tableView to reload at that time (or use a [tableView insertRowsAtIndexPaths])... again I can't see your architecture, but by the time something's added to the array, viewDidLoad is long gone...
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload