escoz / QuickDialog

QuickDialog - Quick and easy dialog screens for iOS
http://escoz.com/open-source/quickdialog
Other
3.07k stars 637 forks source link

Get values from RadioSection instead of indexes when fetchValueIntoObject #728

Closed duribreux closed 12 months ago

duribreux commented 8 years ago

Hello,

I'm currently using this great lib but I'm facing a problem I couldn't find a solution. Long story short, this is my code.

QRadioSection* elt = [[QRadioSection alloc] initWithItems:[values toArray] selected:0 title:identifier];
elt.multipleAllowed = YES;
elt.title = label;
elt.key = identifier;

[_root addSection:elt];

Within my array @["value0", "value1", "value2", "value3"] and my identifier is @"identifier" . No problem with the form generation. Then, I do:

NSMutableDictionary* results = [[NSMutableDictionary alloc] init];
[_root fetchValueIntoObject:results];
DDLogInfo(@"%@", results);

Let's suppose I've checked "value1" and "value2" in the UI, this is the dictionary printed:

identifier =     (
    1,
    2
);

When I would like to have:

identifier =     (
    value1,
    value2
);

I successfully did this with a QRadioElement using radioElement.values = myArray but I can select only one value within this object and there is no such attribute for QRadioSection.

Is there any easy way to generate the dictionary I want ? (I don't really want to some custom mapping stuff...) - I probably missed something stupid but there is no documentation and digging into the class didn't helped me.

Regards,