Question

My question pertains to share kit's code. Sharekit was created a while back and i guess they can't keep up with bugs or something. i haven't gotten it working yet but i think it would be a great thing if it worked as anticipated. I'm just going through the code fixing errors, hoping i can get it running. This is in the files SHKRequest.h and SHKRequest.m. There are two instances of the same variable, result, and when the variable is synthesized in the .m file, it gives me the following error:

synthesized properties 'result' and 'result' both claim instance variable 'result'

I'm kind of a little bit new to Objective-C (I've been doing it professionally for about 5 months now) and i have no idea what this error means or how to fix it. I understand there are two variables with the same name but i don't know WHY the developers put two in the code and i don't want to remove one unless i know it's not actually needed. So, can anybody give me some advice on this? here's the code that's causing the error:

.h file

@interface SHKRequest : NSObject  {
    NSURL *url;
    NSString *params;
    NSString *method;
    NSDictionary *headerFields;

    id delegate;
    SEL isFinishedSelector;

    NSURLConnection *connection;

    NSHTTPURLResponse *response;
    NSDictionary *headers;

    NSMutableData *data;
    NSString *result;                 // This is the first instance of result
    BOOL success;
}

@property (retain, getter=getResult, setter=setResult:) NSString *result;
        // Second instance of result

.m file

@implementation SHKRequest

@synthesize url, params, method, headerFields;
@synthesize delegate, isFinishedSelector;
@synthesize data, result, headers, response, connection;
@synthesize success;
@synthesize result;                                        // result synthesized
Was it helpful?

Solution

Look at these two lines:

@synthesize data, result, headers, response, connection;
@synthesize result;

Remove the 2nd line since there is no need to synthesize result twice.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top