i have a question about Keyboard Extension
.
Container app has many images.(ex > 100 images and total 100MB)
and container app has saved using NSUserDefaults
.
like this:
NSMutableArray* arr = [NSMutableArray new];
for(NSInteger i = 0; i < 100; i++)
{
UIImage* img = [UIImage imageNamed:[NSString stringWithFormat:@"img%ld",i]];
NSData* data = UIImagePNGRepresentation(image);
[arr addObject:data]
}
NSUserDefaults* ud = [[NSUserDefaults alloc] initWithSuiteName:@"<group identifier>"];
[ud setObject:arr forKey:@"image_data"];
[ud synchronize];
and keyboard app gets image data from NSUserDefaults
.
Is it right way that container app send heavy size data to keyboard app?
In special case, when NSUserDefaults
instance accesses method(objectForKey:) in keyboard app, keyboard app crashed.
The special case is :
if image data size in NSUserDefaults
is bigger than about 30MB(not sure), keyboard app crashed and if the size is smaller than about 30MB, it works well.
Is there max size limit of NSUserDefaults?
i just want like this app.
i want to know that i control heavy size data in keyboard app.