In a class I have class variables, simulated by a struct with static members like this:
internal class DEAccountCheck : AccountCheck {
private struct Static {
static var methodParameters: [String: (UInt16, [UInt16])] = [ // Modulus + weights indexed by method id.
"00": (10, [2, 1, 2, 1, 2, 1, 2, 1, 2]),
"01": (10, [3, 7, 1, 3, 7, 1, 3, 7, 1]),
"02": (11, [2, 3, 4, 5, 6, 7, 8, 9, 2]),
"03": (10, [2, 1, 2, 1, 2, 1, 2, 1, 2]),
...
]
}
There are more than 200 lines (entries) for the methodParameter dictionary. If I run my app I get an EXC_BAD_INSTRUCTION exception with the debugger stopping in the middle of my static initializer. I checked thereon when this starts to happen and found that I can have up to 172 values. One more and: puff.
As I can successfully add all entries by normal code the question arises if there's some known limit for static intializers.