I have an iOS App which has a sqlite DB and I am trying to implement Share extension. Hence, I have this DB shared by the main App as well as the share extension.
Following is my implementation NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSString *AppGroupId = @"XXXX"; NSURL *groupContainerURL = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:AppGroupId]; NSString *sharedDirectory = [groupContainerURL path]; sqliteDb = [sharedDirectory stringByAppendingPathComponent:@"MYDB.sqlite"]; success = [fileManager fileExistsAtPath:sqliteDb]; NSLog(@"path : %@", sqliteDb);
If I put my DB in NSDocument directory (without implementing share extension), everything works fine . However, if I move it to shared directory and implement sharing extension, the app starts to crash when it goes in background. Following are the logs and unfortunately I have not been able to debug why this is happening. Any help would be truly appreciated
The Crash log differ very time like following libsystem_kernel.dylib`mach_msg_trap: 0x31ae8504 <+0>: mov r12, sp 0x31ae8508 <+4>: push {r4, r5, r6, r8} 0x31ae850c <+8>: ldm r12, {r4, r5, r6} 0x31ae8510 <+12>: mvn r12, #30 0x31ae8514 <+16>: svc #0x80 -> 0x31ae8518 <+20>: pop {r4, r5, r6, r8} 0x31ae851c <+24>: bx lr
Foundation`-[NSConcreteMapTable dealloc]: 0x245b6f68 <+0>: push {r4, r5, r6, r7, lr} 0x245b6f6a <+2>: add r7, sp, #0xc 0x245b6f6c <+4>: push.w {r8, r10} 0x245b6f70 <+8>: sub sp, #0x8 0x245b6f72 <+10>: mov r4, r0 0x245b6f74 <+12>: movw r0, #0xa10 0x245b6f78 <+16>: movt r0, #0xd9f 0x245b6f7c <+20>: movw r1, #0xa0e 0x245b6f80 <+24>: add r0, pc 0x245b6f82 <+26>: movt r1, #0xd9f 0x245b6f86 <+30>: add r1, pc 0x245b6f88 <+32>: ldr.w r8, [r0] 0x245b6f8c <+36>: ldr r5, [r1] 0x245b6f8e <+38>: ldr.w r10, [r4, r8] 0x245b6f92 <+42>: adds r6, r4, r5 0x245b6f94 <+44>: mov r0, r6 0x245b6f96 <+46>: mov r1, r10 0x245b6f98 <+48>: bl 0x24644e10 ; empty 0x245b6f9c <+52>: ldr r0, [r4, r5] 0x245b6f9e <+54>: mov r1, r10 0x245b6fa0 <+56>: ldr r2, [r6, #0x30] 0x245b6fa2 <+58>: blx r2 0x245b6fa4 <+60>: movw r0, #0x9e4 0x245b6fa8 <+64>: mov.w r10, #0x0 0x245b6fac <+68>: movt r0, #0xd9f 0x245b6fb0 <+72>: str.w r10, [r4, r5] 0x245b6fb4 <+76>: add r0, pc 0x245b6fb6 <+78>: ldr.w r8, [r4, r8] 0x245b6fba <+82>: ldr r5, [r0] 0x245b6fbc <+84>: adds r6, r4, r5 0x245b6fbe <+86>: mov r1, r8 0x245b6fc0 <+88>: mov r0, r6 0x245b6fc2 <+90>: bl 0x24644e10 ; empty -> 0x245b6fc6 <+94>: ldr r0, [r4, r5]
etc
Aucun commentaire:
Enregistrer un commentaire