ios - Objective-C: Potential leak of an object stored into NSDictionary -
ios - Objective-C: Potential leak of an object stored into NSDictionary - i newbie objective-c. xcode highlights next code issue. _mycookies private variable of class store received cookies. @implementation messagesender { nsarray *_mycookies; } ... // socket open callback - (void) gotdata:(mysocket *) socket { nsdictionary *responseheaders = (__bridge nsdictionary*)cfhttpmessagecopyallheaderfields(socket.httpheaders); _mycookies = [nshttpcookie cookieswithresponseheaderfields:responseheaders forurl:[nsurl urlwithstring:@""]]; } the highlighted issues are: call function 'cfhttpmessagecopyallheaderfields' returns core foundation object +1 retain count object leaked: object allocated , stored 'responseheaders' not referenced later in execution path , has retain count of +1 how resolve one? using arc. want store cookies in class can later utilize them while sending request, want ...