본문 바로가기
[ios] NSInteger, NSUInteger on 32bit / 64bit [ios] NSInteger, NSUInteger on 32bit / 64bit -32bit 에서.. NSInteger, NSUInteger 는 각각 int, unsigned int 에 mapping 된다.그래서 로그를 찍을 때 formmatting char 에는 %d 와 %u 에 각각 매핑된다. -64bit 에서는... NSInteger, NSUInteger 는 각각 long 과 unsinged long 에 mapping 된다.그래서 로그를 찍을 때 formmatting char 에는 %ld 와 %lu 에 각각 매핑된다. -bit 에 상관없이 formmatting char 를 가장 안전하게 사용하는 방법은NSInteger, NSUInteger 를 NSNumber 로 converting 해서 %@ 형태로.. 2018. 2. 17.
[ios] beginBackgroundTaskWithExpirationHandler: 에 대한 연구 [ios] beginBackgroundTaskWithExpirationHandler: 에 대한 연구 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/occ/instm/UIApplication/beginBackgroundTaskWithExpirationHandler: -- (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void (^)(void))handler -오래 진행될 새로운 background task 를 마크하는 작업을 한다.( 마크하는 것만으로 BG 상황에서 task .. 2018. 2. 16.
SIGABRT vs SIGSEGV SIGABRT vs SIGSEGV -SIGABRT abnormal termination conditionabort() 와 같은 것으로 시작된다.프로세스 중단신호이다. -SIGSEGV invalid memory access ( segmentation fault )잘못된 메모리 참조로 인해 발생한다. abnormal termination condition, abort, invalid memory access, process, segmentation fault, SIGABRT, SIGABRT vs SIGSEGV, SIGSEGV, 잘못된 메모리 참조, 프로세스 중단 신호 2018. 2. 14.
[ios] Memory Management Debugging. [ios] Memory Management Debugging. Enabling Guard Malloc -Guard Malloc 은 malloc library 의 스페셜 버전이다.Guard Malloc 을 enable 하면 debugging 도중에 표준 malloc library 를 Guard mallog library 로 변경한다. -Guard Malloc 은 여러 가지 기술을 이용해 메모리 에러가 발생하는 부분에서 crash 를 발생시킨다.여기서 여러 가지 기술이란 예를 들면 memoery allocation 을 Virtual memory page 에 기록하여 trace 하는 방식으로, 우연히 잘못된 메모리를 access 해도 작동하는 케이스를 방지해준다. -Guard Malloc 은 Simulator.. 2018. 2. 13.
[ios] NSCocoaErrorDomain Code=522 ( SQLite ) [ios] NSCocoaErrorDomain Code=522 ( SQLite ) 출처 : http://stackoverflow.com/questions/18277092/persistentstorecoordinator-sqlite-error-code522-not-an-error -SQLite 의 Error code 522 는 SQLITE_IOERR_SHORT_READ 를 의미한다. -SQLITE_IOERR_SHORT_READ 는 SQLITE_IOERR 중 하나로 VFS layer 를 통해 read 를 할 때,요청한 byte 만큼 읽지 못했을 경우 발생한다.이 현상이 발생한 이유는 db file 이 망가졌을 때(corrupted) 주로 발생한다.혹은 간헐적으로 read 도중 interrupt 가 발생했을 때.. 2018. 2. 12.
[ios] Application State 가져오는 방법 [ios] Application State 가져오는 방법 [UIApplication sharedApplication].applicationState UIApplicationStateActiveUIApplicationStateInactiveUIApplicationStateBackground Active, applicationState, background, Inactive, UIApplicationStateActive, UIApplicationStateBackground, UIApplicationStateInactive, [ios] Application State 가져오는 방법, 상태 2018. 2. 11.
[ios] NSManagedObjectContextDidSaveNotification sent in todayExtension? [ios] NSManagedObjectContextDidSaveNotification sent in todayExtension? 참조 : https://www.innoq.com/en/blog/ios-writing-core-data-in-today-extension/ -context 를 여러 개 사용하는 경우에 context 에 대한 commit 분의 sync 를 맞춰주기 위해CoreData 는 내부적으로 NSManagedObjectContextDidSaveNotification noti 를 보내고,이를 addObserver 해놓은 곳에서는 mergeChangesFromRemoteContextSave 함수를 통해 sync 를 맞춘다. -그러나 todayExtension 에서 context 에 변화를 주었다.. 2018. 2. 10.
[ios 10] CallDirectory  beginRequestWithExtensionContext 이야기 [ios 10] CallDirectory beginRequestWithExtensionContext 이야기 -beginRequestWithExtensionContext 함수에서 context 에 complete 혹은 cancel 을 날려야 제대로 해당 function 이 끝난다.만약 둘 중 하나를 불러주지 않으면 system setting 에서 해당 값이 켜지거나 꺼지지 않는다. -system setting 에서 값을 Off 할 때는 불리지 않고, On 할 때는 해당 함수가 불린다.Main Process 가 Kill 되어있어도 상관없다. -해당 함수에서는 complete 나 cancel 을 바로 불러줘야 하기 때문에async 로 무언가를 수행하기 어렵다. ( iPhone5 로 테스트 했을 때 5초 넘는 .. 2018. 2. 9.
[ios 10] CallDirectory debug 붙이기 [ios 10] CallDirectory debug 붙이기 [Debug] --> [Attach to process] --> process name 에 callExtension identifier 를 넣는다. attach to process, callextension identifier, debug, process name, [ios 10] CallDirectory debug 붙이기 2018. 2. 8.
반응형