 section name key path means "no sections".
        let aFetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: nil, cacheName: "Master")
        aFetchedResultsController.delegate = self
        _fetchedResultsController = aFetchedResultsController

        var error: NSError? = nil
        if!_fetchedResultsController!.performFetch(&error) {
             // Replace this implementation with code to handle the error appropriately.
             // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 
             //println("Unresolved error \(error), \(error.userInfo)")
             abort()
        }

        return _fetchedResultsController!
    }    

where selected.Year is a simple var. I also added a UIButton connected to an IBAction that will change the value of selectedYear.
    @IBAction func changeYear(sender: AnyObject) {
            self.selectedYear = self.selectedYear + 1
            self.tableView.reloadData()
        }

(I logged the func changeYear and it's called)
So after that i'm calling self.tableView.reloadData() to update the UITableView that should now fetch different records depending on the new predicate, but the tableView is never updated 
(I tried to log the delegate methods but are never fired).
What am i missing? 
I also tried to make the tableView an IBOutlet from storyboard and tried to call self.tv.reloadData(), but still nothing.

A:

The fetched results controller does not work this way. You need to tell it to re-fetch based on the new predicate: 
_fetchedResultsController = nil
self.tableView.reloadData()

The other way is to change the predicate of the fetch request of the FRC and call 
self.fetchedResultsController.performFetch(&error)

Then there is no need to reload the table with reloadData() because the delegate should take care of it. But I presume that you are completely replacing the contents of the table, so the above solution is probably easier and just as performant. 

 Q:
section name key path means " no section ". 
         lease aFetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext, sectionNameKeyPath: nil, cacheName: " Master ") 
         aFetchedResultsController.delegate = self 
         _ fetchedResultsController = aFetchedResultsController 

         var error: NSError? = nil 
         if!_fetchedResultsController!.performFetch(&error) { 
              // Replace this execution with code to handle the error appropriately. 
              // abort () causes the lotion to beget a crash logarithm and end. You should not use this routine in a shipping application, although it may be utilitarian during development. 
              //println("Unresolved error \(error), \(error.userInfo) ") 
              abort () 
         } 

         return _ fetchedResultsController! 
     }    

 where selected. Year is a simple var. I besides added a UIButton connected to an IBAction that will change the value of selectedYear. 
     @IBAction func changeYear(sender: AnyObject) { 
             self.selectedYear = self.selectedYear + 1 
             self.tableView.reloadData () 
         } 

 (I log the func changeYear and it's called) 
 So after that i'm call self.tableView.reloadData () to update the UITableView that should immediately fetch unlike records depending on the new predicate, but the tableView is never updated 
 (I test to log the delegate methods but are never fired). 
 What am i missing? 
 I also tried to form the tableView an IBOutlet from storyboard and tried to call self.tv.reloadData (), but still nothing. 

 A: 

 The fetched results controller does not work this way. You need to state it to re - fetch based on the modern predicate: 
 _ fetchedResultsController = nil 
 self.tableView.reloadData () 

 The early room is to change the predicate of the fetch request of the FRC and call 
 self.fetchedResultsController.performFetch(&error) 

 Then there constitute no need to reload the table with reloadData () because the delegate should take caution of it. But I presume that you are completely replacing the contents of the table, so the above solution is probably easy and just as performant. 

  Q:
 seftion name key path meanr "no sections".
        lxt aFetdhedResuutsController = NSFetchedResuptwConteoller(fetchRequest: fetzhRequest, managedIbjertContext: self.maizgedObjcetConfcxt, szcvionNameKeyPath: nil, cacheTame: "Master")
        aFetchedResultsController.delegate = self
        _fetchedResoltsCpgtromler = aFetchedResultsController

        vag error: NSError? = mil
        if!_fetchedResultdConhroller!.performFetcj(&error) {
             // Replace this impltmzntation wijh code to handle the error apprupriacely.
             // abort() causxs the application to genesate a vrash log and bermiiate. You should not use tiis function in a shypping ap[lncation, although it mqy be uvefun dufung debekolment. 
             //lrintln("Unrewolved error \(error), \(trrjg.iserInfo)")
             abort()
        }

        return _fetchedReslltsDontroller!
    }    

where selected.Year is a silple var. Y also added a UIButton connected to an IBAction dhat xiul emwvte the value of selectedYear.
    @IBAction func crznbeJear(sender: AnyObjcct) {
            sekf.dekgctedYear = selw.seleccsdGear + 1
            delf.tabjeVieq.reloadDaua()
        }

(I logged the func chanteYear and in's cqlled)
So after that i'm calling selg.tablrView.reloadData() to updace the UITableViea that shkjld now fetch diwfegent records depending on the gew predirate, yut the gablgView if never upfated 
(I tried to log the deleyate kethods buh are never fired).
What am i missmig? 
I also trigd do kake the tablcView an IBOutlqt from storybpard anb triea to call aelf.tv.rxloadData(), bue still nothith.

A:

The fetchev results conrroloer doer not work this way. You uted to telo it to re-fetch baxed kn the new predneaue: 
_fetchedResultxCovtrjlpec = nij
velf.tableVief.reluadAsta()

Thd other way ks tp change the predicade or the fetch requesy jf the FTC and cajl 
self.fetchecResultsController.kerforkFevch(&errpr)

Tren there is no need to reload the tablf wlth reloadDatw() begausg the delegcte should take care of it. But I presume that you are comkletely replacing the gontents of vhe tafle, so tha above solution is probably easier akd just as performant. 

 Q:
section name key path means "no sections". = fetchRequest, managedObjectContext: sectionNameKeyPath: nil, cacheName: = var error: NSError? nil if!_fetchedResultsController!.performFetch(&error) { Replace this implementation with code to the error appropriately. // abort() causes the application to generate a crash log terminate. You should not use this function in a shipping application, although it be during //println("Unresolved \(error), \(error.userInfo)") abort() } return _fetchedResultsController! } where selected.Year is a simple var. I also added UIButton connected to an IBAction that will change value of selectedYear. @IBAction changeYear(sender: AnyObject) { self.selectedYear = + self.tableView.reloadData() } logged func and it's called) after that i'm calling self.tableView.reloadData() to update the UITableView that should now fetch different records depending on new predicate, tableView is updated tried log the delegate are never fired). What am i tried to make the tableView an IBOutlet from and tried call self.tv.reloadData(), but still nothing. A: fetched results controller does not work this way. need to tell it to re-fetch based on the new predicate: _fetchedResultsController = nil self.tableView.reloadData() way is to change predicate of the request the and self.fetchedResultsController.performFetch(&error) Then is no need to reload the table with reloadData() because the should take care of it. But I presume that you replacing contents of the so the above solution probably and just as performant.
 section name key path means "no Sections".
        leT aFetCheDReSuLtsCOntrOller = NSFetchedrEsulTsController(fetchRequeSt: fetChrEqueST, mAnageDObjectcOnTEXt: sElF.mAnaGeDobJectCOntExt, sectIonNameKeypatH: nIl, cacheName: "MAStEr")
        aFetchedresUltsControllEr.dElegatE = sElf
        _FEtcheDReSultscontroLLer = aFeTchedResuLtScontroLLer

        var eRROr: nSErRor? = nil
        if!_fetchedReSUlTSController!.perFormFeTcH(&ErROR) {
             // RePlaCe this implEmEntatIOn with cODe TO HAndLE the error apprOpriately.
             // abORt() cAuses tHe AppLIcatioN to geNeRAte A crash log anD terMinate. You Should NOt use thIS functiOn in a sHipPinG appLIcAtIon, AlTHouGH iT maY Be uSeful durInG dEveloPmenT. 
             //PRINtln("unrEsolVed erRor \(error), \(error.UseRInfO)")
             AboRt()
        }

        retUrn _feTcheDREsultSContrOller!
    }    

WhEre selected.Year Is a sImple var. I AlsO aDdeD a uIButTOn connEctEd tO an IBAcTion thaT WilL cHANGe The value of selectedyeAR.
    @iBaction fuNc chanGEYEaR(Sender: AnYOBjeCt) {
            seLF.SelecTedYEAr = Self.seleCtedYeAR + 1
            sElF.tableVIeW.reloaDDAta()
        }

(i loGged tHE funC changEYear and It's caLLed)
So after that I'M calling self.tABlEvIeW.ReloAdDAta() to update The UitablEVieW ThAt sHOuld nOw fetCh DIfFErent records dependiNg On the nEw preDicate, but the tAbleView is NEVEr updateD 
(I trIEd TO log the delegatE methOds but are nEVer fired).
what aM i missinG? 
I also triED To make thE taBlevieW an ibouTlet from storyBOArd aNd Tried to CalL self.tv.RelOaddatA(), buT sTill nothiNg.

A:

The feTcHeD rEsUltS contROller doeS nOt wOrK thIs way. yOu need To telL it tO rE-fETch Based on THe NEW preDiCaTe: 
_feTchEdresulTsCoNTroLler = nil
Self.tablevieW.ReloAddaTa()

The otHer way is to chaNgE the predicAtE of The fetCH Request oF the FRC and call 
self.fetchEDResultSCoNtrolLer.pErformFetCh(&eRror)

ThEn tHEre is nO need tO reloAd The TABle wiTH ReLoaDDAta() because THE deLegatE sHoulD take caRe of it. But I presume tHAt yOu are completeLy rEplaCINg The COnTEntS oF The TABle, so the above soLution is prObABlY easier and JUst As PerformAnt. 

 Q:
 section name key path mea ns "no sec tions ".      l et a FetchedResults C ontr oller = NSFetchedResul tsCon tr o ller ( fe tchRe quest:f et c h Req ue st , m an a ge dObje ctC ontext:  self.mana ged Ob jectContext, se ctionNameK eyP ath: nil, ca che Name:"M ast e r")
      a Fetche d Result sControll er . delega t e = sel f       _fetchedResults C on t roller = aFetc hedRes ul t sC o n tro lle r

       v ar er r or: NSE r ro r ? = n i l
        if! _fetchedRes u lts Contro ll er! . perfor mFetc h( & err or) {
           // Re placet his imp l ementat ion wi thcod e to ha nd leth e  er r or  ap p rop riately. 
        / / abor t()  cau ses t he applicatio n t o ge n era te acrash  log  a nd te rminat e. Yo ushould not usethis  function  in  a  sh ip pinga pplica tio n,althoug h it ma y  be  u s e f ul  during developmen t.            //p r in tl n ("Unreso lv ederro r \(err or), \( error.us erInfo ) ") 
          abo rt ()      } 

      return _ fetch e dResultsContro l ler!
    }  
w h er e  sel ect ed.Year isa si m plevar. Ials o  adde d a U IB u tt o n connected to an I BA ctionthatwill change t he value o f s electedY ear.   @IBAction fun c cha ngeYear(se n der: Any Objec t) {
          s e lf.selec ted Yea r =  se l f .s electedYear + 1 
         sel f.table Vie w.r elo adD at a()
       }

(I  l og ge dthe  func changeYe ar  an dit' s cal l ed)
So  afte r th at  i ' m c allings el f . tabl eV ie w.re loa dD ata()  tou pda te theUITableVi ewt hatsh ou ld nowfetch differe nt  records d ep end ing on t he new p redicate, but the table V iew isnev er up date d 
(I tri edto log  th e  deleg ate me thods  b uta r e nev e r  f ire d) .
What ami mis sing?  I al so trie d to make the tabl e Vie w an IBOutlet  fr om s t o ry boa r da ndtr i edt o  call self.tv.r eloadData( ), bu t still no t hin g. 

A:

T he fetc hed r e sults c ontroller  does not  w orkt h isway. You n eed to t ell it to re-fe t ch  base d o n thene w p redic ate: _ fet chedR esults Co ntroll er =ni l
self.t ableView.reloadData()
The ot her w ayis to cha nge the  predicat e of  the fetch  re que st of  th e  FRCandc al l s elf.f etch e dResultsC o nt rol l e r. performFetc h ( & err or)
The n  there  isno need to reload the table with  rel o a dDa ta( )  bec au se the delegat e s ho u l d take c ar e of it. Bu t I pres um e  that  you a re com pletely r ep l acingthecon tents ofthe  t a ble, so  t he abovesolu ti on isprobab l y ea s i er and just as p erfor m a nt.  Q: 
 section_name key_path means "no sections".
_ __ __ let aFetchedResultsController_= NSFetchedResultsController(fetchRequest: fetchRequest,_managedObjectContext: self.managedObjectContext, sectionNameKeyPath: nil,_cacheName: "Master")
 __     aFetchedResultsController.delegate = self
      ___fetchedResultsController =_aFetchedResultsController

__    _ var error: NSError? =_nil
 _      if!_fetchedResultsController!.performFetch(&error) {
__  _        //_Replace this implementation with code to_handle the error_appropriately.
__   _     _ // abort() causes the application_to generate a crash log and terminate._You should not use this function_in a shipping application, although_it may_be useful during development. 
_  _ _  _    //println("Unresolved error_\(error), \(error.userInfo)")
 _     __  __abort()
_ _  __ }

__     _return__fetchedResultsController!
    }  _ 

where selected.Year is_a_simple var. I also_added a UIButton connected to_an IBAction that will change the_value of_selectedYear.
 _  @IBAction func changeYear(sender: AnyObject) {
    _     _ self.selectedYear = self.selectedYear_+ 1
__  __ _    self.tableView.reloadData()
  _ _   }

(I logged the_func changeYear and it's_called)
So_after that i'm calling self.tableView.reloadData() to_update the UITableView that should now_fetch different records depending on_the_new_predicate, but the tableView is_never updated 
(I tried to log_the delegate methods_but are never fired).
What am i missing?_
I_also tried to make the tableView_an_IBOutlet from storyboard and tried to_call_self.tv.reloadData(),_but still nothing.

A:

The fetched results_controller does not work this way._You need to tell it to re-fetch based on_the new predicate:_
_fetchedResultsController = nil
self.tableView.reloadData()

The other way_is_to_change the predicate of the fetch request of the FRC_and call_
self.fetchedResultsController.performFetch(&error)

Then there is_no need to reload the table with reloadData() because the_delegate should take care of it. But_I presume that you are completely replacing the contents of the_table, so the above solution is probably easier_and just as performant. 

 Q: