Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSDictionary* freToDictionary(FREObject object)
- {
- NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];
- //
- FREObject _freKeysList = nil;
- FREResult res = FREGetObjectProperty(object, (const uint8_t*)"freKeysList", &_freKeysList, nil);
- if (res != FRE_OK) return dictionary;
- if (!_freKeysList) return dictionary;
- NSArray* freKeysList = freToMArray(_freKeysList, 0);
- //
- NSInteger count = freKeysList.count;
- NSString* key;
- //
- FREObject _value;
- id value;
- for (NSInteger i=0; i<count; i++) {
- key = [freKeysList objectAtIndex:i];
- //
- res = FREGetObjectProperty(object, (const uint8_t*)[key UTF8String], &_value, nil);
- if (res == FRE_OK) {
- value = freToId(_value);
- if (value) {
- [dictionary setValue:value forKey:key];
- }
- }
- }
- //
- return dictionary;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement