4

I found one solution related with Addresponse - adding to memory only on Stackoverflow, but my App still reporting it even doing the recommended.

Addresponse - adding to memory only (XCode)


AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    ...
    // Enable Cache System
    NSURLCache *cache = [[NSURLCache alloc] initWithMemoryCapacity:4*1024*1024 diskCapacity:32*1024*1024 diskPath:nil];
    [NSURLCache setSharedURLCache:cache];
    ...
}

Log:

2013-05-22 19:44:21.648 Setparty[12912:380f] ADDRESPONSE - ADDING TO MEMORY ONLY: http://SERVER/api/1.0/appimages/?view=1
2013-05-22 19:44:21.667 Setparty[12912:380f] ADDRESPONSE - ADDING TO MEMORY ONLY: http://SERVER/api/1.0/appimages/?view=2
2013-05-22 19:44:21.689 Setparty[12912:380f] ADDRESPONSE - ADDING TO MEMORY ONLY: http://itunes.apple.com/lookup/?id=634476579

Does anyone have any idea what may be related with these logs?

Community
  • 1
  • 1
Luciano Nascimento
  • 2,600
  • 2
  • 44
  • 80

1 Answers1

4

It is an error message coming from the framework. Best guess, your path on disk is nil and, thus, that error message is telling you that nothing will be written to disk.

bbum
  • 162,346
  • 23
  • 271
  • 359
  • I'll test on my App if `diskPath` is set it fix the problem, but I guess it do not have any relation: http://stackoverflow.com/questions/11300044/on-ios-where-is-the-nsurlcache-cache-stored-if-diskpathnil?lq=1 – Luciano Nascimento May 22 '13 at 23:45
  • UPDATE: Even with `diskPath` set it still reporting `ADDRESPONSE - ADDING TO MEMORY ONLY`. – Luciano Nascimento May 22 '13 at 23:49
  • What did you set the disk path to? Somewhere writable? – bbum May 23 '13 at 02:31
  • 2
    I saw this when using `[[NSString alloc] initWithBytes:(const void *)bytes length:(NSUInteger)length encoding:(NSStringEncoding)encoding` … Length was `length:outputLength` when it should have been `length:&outputLength` So, another possible clue for future readers. – Michael J. Aug 27 '13 at 14:26