I don't think there is any 'magic' to do this. My intention would be to iterate through the controls in the parent view of your checkboxes, like this:
repeat with aSubview in theParentView's subviews()
if aSubview's title()'s isEqualToString_("Check") is not 0 then
aSubview's setState_(false)
end if
end repeat
Here, theParentView
is an outlet to the view in which the checkboxes reside.
There are basically two options to this:
- For each identifier, you loop through the subviews
- You loop through the subviews once and add them to a dictionary, with the identifiers as keys. Later, you can access the checkbox via an access to the dictionary.
In the second case, the code could look like this:
set aDict to NSMutableDictionary's alloc()'s init()
repeat with aSubview in theWindow's subviews()
aDict's setObject_forKey_(aSubview, aSubview's title())
end repeat
aDict's objectForKey_("Check 1")'s setState_(false)