Fixes a bug editing a new monster.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="17192" systemVersion="19H2" minimumToolsVersion="Automatic" sourceLanguage="Objective-C" usedWithCloudKit="YES" userDefinedModelVersionIdentifier="">
|
||||
<entity name="Monster" representedClassName="Monster" syncable="YES" codeGenerationType="category">
|
||||
<attribute name="alignment" attributeType="String" defaultValueString=""/>
|
||||
<attribute name="armorType" attributeType="String" defaultValueString=""/>
|
||||
<attribute name="armorType" attributeType="String" defaultValueString="none"/>
|
||||
<attribute name="baseSpeed" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="burrowSpeed" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="canHover" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||
|
||||
@@ -38,9 +38,14 @@
|
||||
|
||||
-(void)updateView {
|
||||
self.textField.text = _selectedChoice.label;
|
||||
if (_choices && _choices.count > 0) {
|
||||
NSInteger selectedRow = [_choices indexOfObject:_selectedChoice];
|
||||
if (selectedRow != NSNotFound) {
|
||||
[self.pickerView selectRow:selectedRow inComponent:0 animated:YES];
|
||||
|
||||
} else {
|
||||
[self.pickerView selectRow:0 inComponent:0 animated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@synthesize choices = _choices;
|
||||
@@ -90,7 +95,8 @@
|
||||
if (!_choices) {
|
||||
newValue = value;
|
||||
} else if (!foundChoice) {
|
||||
newValue = nil;
|
||||
foundChoice = [_choices firstObject];
|
||||
newValue = foundChoice.value;
|
||||
} else {
|
||||
newValue = foundChoice.value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user