diff --git a/exportCookies/CookiesTXT.m b/exportCookies/CookiesTXT.m index da37d6a..22e2977 100644 --- a/exportCookies/CookiesTXT.m +++ b/exportCookies/CookiesTXT.m @@ -12,16 +12,7 @@ @implementation CookiesTXT @synthesize cookieArray; -- (NSString *) entryFromArray:(NSArray *)arr { - return [arr componentsJoinedByString:@"\t"]; -} - -- (void) appendEntry:(NSString *)entry toTxt:(NSString **)txt { - *txt = [*txt stringByAppendingString:[entry stringByAppendingString:@"\n"]]; -} - - (void) print { - NSString *txt = @""; for (NSHTTPCookie *cookie in self.cookieArray) { NSMutableArray *entry = [NSMutableArray arrayWithCapacity:8]; [entry addObject:[cookie domain]]; @@ -31,10 +22,8 @@ - (void) print { [entry addObject:[NSString stringWithFormat:@"%.0f", [[cookie expiresDate] timeIntervalSince1970]]]; [entry addObject:[cookie name]]; [entry addObject:[cookie value]]; - [self appendEntry:[self entryFromArray:entry] toTxt:&txt]; - } - if (txt) { - printf("%s", [txt UTF8String]); + NSString *str = [[entry componentsJoinedByString:@"\t"] stringByAppendingString:@"\n"]; + printf("%s", [str UTF8String]); } }