You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
In _FBTweakTableViewCell the mode is sometimes not set correctly, leading to wrong step values.
Problem:
[value objCType] is only checked for NSInteger and NSUInteger, but not for short, int, long (to name other popular types).
Fix:
(void)setTweak:(FBTweak *)tweak
{
if (_tweak != tweak) {
_tweak = tweak;
self.textLabel.text = tweak.name;
FBTweakValue value = (_tweak.currentValue ?: _tweak.defaultValue);
_FBTweakTableViewCellMode mode = _FBTweakTableViewCellModeNone;
if ([value isKindOfClass:[NSString class]]) {
mode = _FBTweakTableViewCellModeString;
} else if ([value isKindOfClass:[NSNumber class]]) {
// In the 64-bit runtime, BOOL is a real boolean.
// NSNumber doesn't always agree; compare both.
const char *objCType=[value objCType];
if (strcmp(objCType, @encode(char)) == 0 ||
strcmp(objCType, @encode(_Bool)) == 0) {
mode = _FBTweakTableViewCellModeBoolean;
} else if (strcmp(objCType, @encode(NSInteger)) == 0 ||
strcmp(objCType, @encode(NSUInteger)) == 0 ||
strcmp(objCType, @encode(short)) == 0 ||
strcmp(objCType, @encode(unsigned short)) == 0 ||
strcmp(objCType, @encode(int)) == 0 ||
strcmp(objCType, @encode(unsigned int)) == 0 ||
strcmp(objCType, @encode(long)) == 0 ||
strcmp(objCType, @encode(unsigned long)) == 0
) { // jg added int, unsigned int
mode = _FBTweakTableViewCellModeInteger;
} else {
mode = _FBTweakTableViewCellModeReal;
}
} else if ([_tweak isAction]) {
mode = _FBTweakTableViewCellModeAction;
}
[self _updateMode:mode];
[self _updateValue:value primary:YES write:NO];
}
}
The text was updated successfully, but these errors were encountered: