【问题标题】:ADDRESPONSE - ADDING TO MEMORY ONLY地址 - 仅添加到内存中
【发布时间】:2013-09-27 00:14:18
【问题描述】:

我在 Stackoverflow 上找到了一个与 Addresponse - adding to memory only 相关的解决方案,但我的应用程序仍然报告它,即使执行了推荐。

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];
    ...
}

日志:

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

有人知道这些日志可能与什么有关吗?

【问题讨论】:

    标签: objective-c


    【解决方案1】:

    这是来自框架的错误消息。最好的猜测是,您在磁盘上的路径是 nil,因此,该错误消息告诉您不会将任何内容写入磁盘。

    【讨论】:

    • 如果设置了diskPath,我会在我的应用程序上测试它可以解决问题,但我想它没有任何关系:stackoverflow.com/questions/11300044/…
    • 更新:即使使用diskPath 设置它仍然报告ADDRESPONSE - ADDING TO MEMORY ONLY
    • 你设置的磁盘路径是什么?某处可写?
    • 我在使用 [[NSString alloc] initWithBytes:(const void *)bytes length:(NSUInteger)length encoding:(NSStringEncoding)encoding 时看到了这一点……长度应该是 length:outputLength 而应该是 length:&outputLength 所以,对于未来的读者来说,另一个可能的线索。
    猜你喜欢
    • 1970-01-01
    • 2013-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-15
    • 1970-01-01
    • 2020-08-28
    • 1970-01-01
    相关资源
    最近更新 更多