Javier
Javier

Reputation: 2095

Passing address of non-local object to __autoreleasing parameter for write-back

I'm trying to make app with xcode 4.2 and i'm really confused whay happen this. Could someone help me an explain me why have error in lines when appear &error

Passing address of non-local object to __autoreleasing parameter for write-back

RootViewController.h

RootViewController.m

Upvotes: 2

Views: 6185

Answers (1)

JeremyP
JeremyP

Reputation: 86651

It would have been easier to diagnose the error without having to guess at the line number on which it occurs, but I think the issue is your use of the error instance variable to pass as the error here:

30    [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error: &error];

also here

49    [fm removeItemAtPath:[recordedTmpFile path] error:&error];

The reason is that, if an error occcurs, in setCategory:error: the existing value of error will be overwritten without being released and is thus a potential leak.

Upvotes: 4

Related Questions