Why my app doesn't compile when my NSFetchedResultsController properties is named "fetchedResultsController" and I override the setter selector?

Hi everyone,
I'm struggling with a problem here. I cannot compile my app when I name a NSFetchedResultsController "fetchedResultController" and I override the setter selector.
How do you explain that? Is it a bug?
I'm using xCode Version 5.0.2 (5A3005) on OS X 10.9 (13A603).
Here is a sample of code showing the problem:
TestViewController.h
#import <UIKit/UIKit.h>
@interface TestViewController : UIViewController
@end
TestViewController.m
#import "TestViewController.h"
@interface TestViewController ()<NSFetchedResultsControllerDelegate>
@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@end
@implementation TestViewController
-(void)setFetchedResultsController:(NSFetchedResultsController *)fetchedResultsController
    if(_fetchedResultsController) _fetchedResultsController.delegate = nil;
    _fetchedResultsController = fetchedResultsController;
- (NSFetchedResultsController *)fetchedResultsController
    if (!_fetchedResultsController) // if no filter, no request
        static NSString *SomeCacheName = @"SomeCache";
        NSFetchRequest *request = [[NSFetchRequest alloc] init];
        [request setRelationshipKeyPathsForPrefetching:@[@"tags",@"tags.tagged_players"]];
        [NSFetchedResultsController deleteCacheWithName:SomeCacheName];
        _fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:[NSManagedObjectContext defaultContext] sectionNameKeyPath:nil cacheName:SomeCacheName];
        NSError *error;
        ZAssert([_fetchedResultsController performFetch:&error], @"Event list fetch error. %@. %@", error, error.userInfo);
        _fetchedResultsController.delegate = self;
    return _fetchedResultsController;
@end

You have custom accessor methods so need to explicitly declare the instance variable _fetchedResultsController. Read this note under You Can Implement Custom Accessor Methods in Programming with Objective-C.
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Programmi ngWithObjectiveC/EncapsulatingData/EncapsulatingData.html
Note: The compiler will automatically synthesize an instance variable in all situations where it’s also synthesizing at least one accessor method. If you implement both a getter and a setter for a readwrite property, or a getter for a readonlyproperty, the compiler will assume that you are taking control over the property implementation and won’t synthesize an instance variable automatically.

Similar Messages

  • I upgraded my new iPad (iPad 3) to IOS 6 and everything went well except Siri won't launch apps. When asked say "launch Facebook" Siri responds with "it doesn't look like you have an app named Facebook" and I get the same results when trying to launch any

    I upgraded my new iPad (iPad 3) to IOS 6 and everything went well except Siri won’t launch apps. When asked say “launch Facebook” Siri responds with “it doesn’t look like you have an app named Facebook” and I get the same results when trying to launch any app. Siri works for everything else it just won’t launch apps. Any ideas? Thanks.

    I have this same problem... Seems like nobody else does. Siri won't launch any apps for me, including native apps.

  • Why does App Store always crash when I try to open the appliction?

    Why does App Store always crash when I try to open the appliction?

    You don't have the typical symptoms that I associate the following issue with (normally the error kicks in just when folks visit the Store), but just in case try gn_id's suggestion from the following post:
    Re: iTunes 11 crashes when opening the store - no error message

  • Photo transfer App doesn't appear when SD card inserted with camera connection kit  to iPad 2

    Photo transfer app doesn't appear when the SD card is connected to iPad 2 using the camera connection kit. I also tried connecting the camera directly to iPad using that adaptor as well as no app appears.

    You should see something like this on your iPad screen

  • Purchased tab in "App Store" app doesn't work when AppleID is not an email address.

    After updated my iPhone and iPad to iOS 6 (both 6.0&amp;6.0.1), Purchased tab in "App Store" app doesn't work when AppleID is not an email address. This happened since 6.0 and I hope that it will be fixed in6.0.1 but it doesn't.
    When I tap at Purchased tab in iPad App Store or Purchased bar in Updates tab in iPhone App Store, it just hang on "Loading...", but when I changed to other AppleID, it works. Apparently, my AppleID is not an email address but the other AppleID is an email address.
    Not sure where to send my feedback to Apple about this issue.

    http://www.apple.com/contact/feedback.html

  • Why my MacBook pro with Maverick, when I'm connected with internet key and connect with usb cable my HTC One the Mac restat with error?

    Why my MacBook pro with Maverick, when I'm connected with internet key and connect with usb cable my HTC One the Mac restat with error?

    Solution may be found if you search in the "More Like This" section over in the right column. 

  • When I upload an app, it asks for my password, then says it's incorrect.  When I reset it (after 3 tries) and put in the new one, it still says it is incorrect.

    When I upload an app, it asks for my password, then says it's incorrect.  When I reset it (after 3 tries) and put in the new one, it still says it is incorrect.  What am I doing wrong?

    I assume that you meant that you reset the password three times. Did you receive any verification that the new password was accepted?
    Sign out of you account, restart the iPad and sign in again. Settings>Store>Apple ID - tap the ID and sign out.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>Store>Sign in again.

  • One of my apps does not transfer when I synch (I have tried several times): it is the Overdrive Media Console

    one of my apps does not transfer when I synch (I have tried several times): it is the Overdrive Media Console

    If you are a resident of the U.S, have iTunes 10.3, iOS 4.3.3, you can re download apps for free directly on the iPad.
    Tap the App Store icon, find the app: download
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • HT204266 Why does only one headphone work when i listen to music? I have to hold the base of the cord in a certain position for it to work, it does this with all headphones i try, what do i do?

    Why does only one headphone work when i listen to music? I have to hold the base of the cord in a certain position for it to work, it does this with all headphones i try, what do i have to do?

    You can try cleaning the headphone jack. However, I suspect that th headphone jack needs replacement.
    Apple will only exchange your iPod for a refurbished one for this price.
    Apple - Support - iPod - Repair pricing
    A third-party place like the following is less expensive. Google for more places.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • When I connect my ipod to computer and open itunes, the songs on my ipod do not show up on the itunes library...it is blank...songs are still on my ipod but don't seem to show up on computer..help??

    When I connect my ipod to computer and open itunes, the songs on my ipod do not show up on the itunes library...it is blank...songs are still on my ipod but don't seem to show up on computer..help??

               Download this for getting media off your ipod!http://www.macupdate.com/app/mac/19890/ipoddisk
    Hope this helped!

  • When I try to reset my iPad mini it keeps asking for  a passcode! have tried restoring, connecting to iTunes and looked for the 'set up as new iPad' notification, but nothing is working? can anyone help please?

    I know my passcode is correct but when I try to reset my iPad mini it keeps asking for  a passcode! have tried restoring, connecting to iTunes and looked for the 'set up as new iPad' notification, but nothing is working? can anyone help please?

    If the iPad was running iOS 7,  iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • When safari is in full screen mode and I move the mouse to the top of the screen to bring up the menu bar and the bookmark bar, it does nothing.  Is anyone else having this issue?

    When safari is in full screen mode and I move the mouse to the top of the screen to bring up the menu bar and the bookmark bar, it does nothing.  Is anyone else having this issue?
    Thanks

    I just tested that since I hardly ever use full screen mode, this was the first time since I upgraded to Mountain Lion, and it worked fine for me.
    Try shutting Safari down and see if that changes anything.
    If that doesn't change anything, try shutting down and then rebooting.
    Allan

  • What tool can I insert in tool box to undo last stroke and return to where I previously left off, e.g., when I am writing an e=mail and part of the message is deleted--so I don't have to re-write the whole message again?

    what tool can I insert in tool box to undo last stroke and return to where I previously left off, e.g., when I am writing an e=mail and part of the message is deleted--so I don't have to re-write the whole message again?

    Firefox doesn't do email, it's a web browser.
    If you are using Firefox to access web mail, you need to seek support from your service provider or a forum for that service.
    If your problem is with Thunderbird, see this forum for support.
    [http://www.mozillamessaging.com/en-US/support/]
    or this one
    [http://forums.mozillazine.org/viewforum.php?f=39]

  • Just bought $50 worth of credit to purchase apps its my first time purchasing apps so something comes up i have to answer security questions and i forgot the answer of it sends instructions to my email but i don't recieve anything

    just bought $50 worth of credit to purchase apps its my first time purchasing apps so something comes up i have to answer security questions and i forgot the answer of it sends instructions to my email but i don't receive anything i tried resending the instructions 15 times

    Unless they're in a spam filter, you need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (124845)

  • [svn] 3921: Fix for - @inheritDoc tag not working for get/ set overrides when you only override the setter of a base class

    Revision: 3921
    Author: [email protected]
    Date: 2008-10-28 06:23:00 -0700 (Tue, 28 Oct 2008)
    Log Message:
    Fix for - @inheritDoc tag not working for get/set overrides when you only override the setter of a base class
    QE Notes: Baselines for framework test will need to be updated.
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17304
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17304
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

    Revision: 3921
    Author: [email protected]
    Date: 2008-10-28 06:23:00 -0700 (Tue, 28 Oct 2008)
    Log Message:
    Fix for - @inheritDoc tag not working for get/set overrides when you only override the setter of a base class
    QE Notes: Baselines for framework test will need to be updated.
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17304
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17304
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

Maybe you are looking for