0

I'm getting the error "passing address of non-local object to _autoreleasing parameter for write back" when i'm trying to access the particular method.

Code:

(void)resetProgressDelegate:(id __strong *)progressDelegate

{

#if !TARGET_OS_IPHONE

    // If the uploadProgressDelegate is an NSProgressIndicator, we set its MaxValue to 1.0 so we can treat it similarly to UIProgressViews
    SEL selector = @selector(setMaxValue:);

    if ([*progressDelegate respondsToSelector:selector]) {

        double max = 1.0;

        [ASIHTTPRequest performSelector:selector onTarget:progressDelegate withObject:nil amount:&max callerToRetain:nil];

    }

    selector = @selector(setDoubleValue:);

    if ([*progressDelegate respondsToSelector:selector]) {

        double value = 0.0;

        [ASIHTTPRequest performSelector:selector onTarget:progressDelegate withObject:nil amount:&value callerToRetain:nil];

    }
#else
    SEL selector = @selector(setProgress:);

    if ([*progressDelegate respondsToSelector:selector]) {

        float value = 0.0f;

        [ASIHTTPRequest performSelector:selector onTarget:progressDelegate withObject:nil amount:&value callerToRetain:nil];

    }
#endif
}

(void)setUploadProgressDelegate:(id)newDelegate

{

    uploadProgressDelegate = newDelegate;

    [self resetProgressDelegate: &uploadProgressDelegate];


}
    [self resetProgressDelegate: &uploadProgressDelegate];
Ranjith Kumar Nagiri
  • 865
  • 3
  • 18
  • 42
  • here im getting the error at "&" symbol kindly please help me to solve the issue...Thanks in advance – J.Chandrasekhar Reddy Jan 30 '14 at 07:42
  • 1
    Your question is not clear and the code contains unnecessary conditional sections - try reducing the code to show just what is causing the error and make it clear where it occurs. You can edit the question, for some reason part of your question is in a comment. Also read [this answer](http://stackoverflow.com/questions/8814718/handling-pointer-to-pointer-ownership-issues-in-arc/8829294#8829294) to another question - it explains in detail how pointer to pointer parameters work under ARC. – CRD Jan 30 '14 at 08:25
  • hello thanx for the reply @CRD im getting "passing address of non-local object to _autoreleasing parameter for write back" error at [self resetProgressDelegate: &uploadProgressDelegate]; "&" symbol.. – J.Chandrasekhar Reddy Jan 30 '14 at 08:38

0 Answers0