aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPExtendedTableInfo.m24
-rw-r--r--Source/TableContent.m4
2 files changed, 22 insertions, 6 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 9a84286e..b2d92a58 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -204,12 +204,19 @@
[tableTypePopUpButton addItemWithTitle:@"View"];
// Set create syntax
[tableCreateSyntaxTextView setEditable:YES];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCreateSyntaxTextView string] length]) replacementString:@""];
[tableCreateSyntaxTextView setString:@""];
- [tableCreateSyntaxTextView insertText:[[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier]];
+ NSString *createViewSyntax = [[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, 0) replacementString:createViewSyntax];
+ [tableCreateSyntaxTextView insertText:createViewSyntax];
+ [tableCreateSyntaxTextView didChangeText];
[tableCreateSyntaxTextView setEditable:NO];
} else {
- [tableCreateSyntaxTextView setEditable:NO];
+ [tableCreateSyntaxTextView setEditable:YES];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCreateSyntaxTextView string] length]) replacementString:@""];
[tableCreateSyntaxTextView setString:@""];
+ [tableCreateSyntaxTextView didChangeText];
+ [tableCreateSyntaxTextView setEditable:NO];
}
[tableCreatedAt setStringValue:@"Created at: "];
@@ -228,8 +235,10 @@
[tableSizeFree setStringValue:@"Free data size: "];
// Set comments
- [tableCommentsTextView setString:@""];
[tableCommentsTextView setEditable:NO];
+ [tableCommentsTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCommentsTextView string] length]) replacementString:@""];
+ [tableCommentsTextView setString:@""];
+ [tableCommentsTextView didChangeText];
return;
}
@@ -304,13 +313,20 @@
[tableSizeFree setStringValue:[self _formatValueWithKey:@"Data_free" inDictionary:statusFields withLabel:@"Free data size"]];
// Set comments
- [tableCommentsTextView setEditable:enableInteraction];
+ [tableCommentsTextView setEditable:YES];
+ [tableCommentsTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCommentsTextView string] length]) replacementString:[statusFields objectForKey:@"Comment"]];
[tableCommentsTextView setString:[statusFields objectForKey:@"Comment"]];
+ [tableCommentsTextView didChangeText];
+ [tableCommentsTextView setEditable:enableInteraction];
// Set create syntax
[tableCreateSyntaxTextView setEditable:YES];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCommentsTextView string] length]) replacementString:@""];
[tableCreateSyntaxTextView setString:@""];
+ [tableCreateSyntaxTextView didChangeText];
+ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, 0) replacementString:[tableDataInstance tableCreateSyntax]];
[tableCreateSyntaxTextView insertText:[tableDataInstance tableCreateSyntax]];
+ [tableCreateSyntaxTextView didChangeText];
[tableCreateSyntaxTextView setEditable:NO];
}
diff --git a/Source/TableContent.m b/Source/TableContent.m
index fbce4b33..26d2138e 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -2313,7 +2313,7 @@
[tableDataInstance setStatusValue:[NSString stringWithFormat:@"%d", maxNumRows] forKey:@"Rows"];
[tableDataInstance setStatusValue:@"y" forKey:@"RowsCountAccurate"];
[tableInfoInstance tableChanged:nil];
- [[tableDocumentInstance valueForKey:@"extendedTableInfoInstance"] loadTable:selectedTable];
+ [[tableDocumentInstance valueForKey:@"extendedTableInfoInstance"] performSelectorOnMainThread:@selector(loadTable:) withObject:selectedTable waitUntilDone:YES];
// Otherwise, if the table status value is accurate, use it
} else if ([[tableDataInstance statusValueForKey:@"RowsCountAccurate"] boolValue]) {
@@ -2328,7 +2328,7 @@
[tableDataInstance setStatusValue:[NSString stringWithFormat:@"%d", maxNumRows] forKey:@"Rows"];
[tableDataInstance setStatusValue:@"y" forKey:@"RowsCountAccurate"];
[tableInfoInstance tableChanged:nil];
- [[tableDocumentInstance valueForKey:@"extendedTableInfoInstance"] loadTable:selectedTable];
+ [[tableDocumentInstance valueForKey:@"extendedTableInfoInstance"] performSelectorOnMainThread:@selector(loadTable:) withObject:selectedTable waitUntilDone:YES];
// Use the estimate count
} else {