Leaks in passing the request using URL at NSString, Objective-C -
I am getting a leak in this method, even the assigned NS string is also issued.
Now I have received the string format, but still it is showing leakage on the line "NSDT * returndata = ...."
- (BOOL) getTicket: (NSString *) Username Password: (NSString *) aPassword isLogin: (BOOL) isLogin {NSString * str = @ ""; If (isLogin == YES) {str = [NSString stringWithFormat: @ "AGNT = true & LOGIN_ID =% @ & PASSWORD =% @", [auto_encodeString: userName], [auto_encodeString: aPassword]]; } Else if (isLogin == NO) {str = [NSString stringWithFormat: @ "AGNT = true & LOGIN_ID =% @" and PASSWORD =% @ ", [auto_encodeString: userName], [auto_encodeString: aPassword] ]; } NSMutableURLRequest * Request = [NSMutableURL request request with url: [NSURL URLWithString: str] Cash Policy: NSURLRequestReloadIgnoringCacheData Timeout Interval: 25.0]; [Set http system: @ "post"]; NSDT * return data = [synchronous request sending NSRR connection: Request return response: zero error: zero]; NSString * return string = [[NSString alloc] initWithData: returndata encoding: NSUTF8StringEncoding]; Printf ("getticket string \ nback:% s", [return string UTF 8 string]); NSRange Text Range; TextRange = [return string range offstring: @ "ticket"]; If (textRange.location! = NSNotFound) {NSArray * splitValues = [determined by returnstring components: @ "ticket" =]; NSString * str1 = [Split value object indices: 1]; NSArray * splitValues1 = [separation from str1 components: @ "RESULT"]; NSString * Ticket 1 = [Split Value 1 Object Index: 0]; Self.ticket = ticket 1; Self.isCorrectLogin = Yes; [Return string release]; Yes come back } And {self.isCorrectLogin = NO; [Return string release]; no return; } no return;
}
Please help me with this problem.
is correct in MacBurdie, which is a stringByAppendingString:
using a Let's make the string. I recommend using + stringWithFormat:
instead.
For leakage, if there is a leak where you say that it is, then this can be a leak in the underlying structure (and it can be a false positive). Post a backtrace of leak object (which can be from the allocations instrument).
Comments
Post a Comment