336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
iPhone4에서 제대로 동작하던 소스가 iPhone5에서 가끔씩 메모리 오류를 발생시킨다.
(IPhone4, IPhone5 모두에서 발생하는 문제로 버전보다는 범용적인 메모리 문제 같음)

특히 메모리나 캐시 문제 등에 의해 아래와 같은 메시지가 나온다.

ADDRESPONSE - ADDING TO MEMORY ONLY

특정 URL을 호출하여 데이터를 반환받을 때 가끔 저 오류가 발생하는데, 메모리 혹은 캐시 문제로 판단하여 아래와 같이 수정했다.

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
int cacheSizeMemory = 4 * 1024 * 1024;
int cacheSizeDisk= 32 * 1024 * 1024;

NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory
  diskCapacity:cacheSizeDisk
  diskPath:@"nsurlcache"];

[NSURLCache setSharedURLCache:sharedCache];
}

- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
[[NSURLCache sharedURLCache] removeAllCachedResponses];
}

현재까지는 제대로 동작하고 에러발생이 없으나, 혹시 추후에라도 문제가 다시 발견되면 수정하도록 하겠다.


posted by 어린왕자악꿍