xCode "Property access results unused - getters should not be used for side effects"

Posted by David DelMonte on Stack Overflow See other posts from Stack Overflow or by David DelMonte
Published on 2011-03-17T23:55:05Z Indexed on 2011/03/18 0:10 UTC
Read the original article Hit count: 555

Filed under:
|
|

Hi all, I'm getting this warning when I'm calling a local routine.

My code is this:

-(void)nextLetter {
    // NSLog(@"%s", __FUNCTION__);
    currentLetter ++;
    if(currentLetter > (letters.count - 1))
    {
        currentLetter = 0;
    }
    self.fetchLetter;
}

I'm getting the warning on the self.fetchLetter statement.

That routine looks like this:

- (void)fetchLetter {
    // NSLog(@"%s", __FUNCTION__);
    NSString *wantedLetter = [[letters objectAtIndex: currentLetter] objectForKey: @"langLetter"];

    NSString *wantedUpperCase = [[letters objectAtIndex: currentLetter] objectForKey: @"upperCase"];    


.....   
}

I prefer to fix warning messages, is there a better way to write this?

Thanks!

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about xcode