From a2d64457e1c52d2d72863407537e950c80595231 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 1 Jun 2010 00:10:02 +0000 Subject: - Ensure start/end query notifications are sent on the main thread to avoid the interface being updated from the wrong thread on listeners - Add a "Support Files" folder to MCPKit, containing NSNotificationAdditions to support main thread notifications from within MCPKit --- Source/SPTableStructure.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/SPTableStructure.m') diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index e14e76a1..74cae1c3 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -67,7 +67,7 @@ } // Send the query started/working notification - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryWillBePerformed" object:tableDocumentInstance]; // Retrieve the column information for this table. // TODO: update this and indexes to use TableData at some point - tiny bit more parsing required... @@ -75,7 +75,7 @@ // If an error occurred, reset the interface and abort if ([mySQLConnection queryErrored]) { - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; [[self onMainThread] setTableDetails:nil]; if ([mySQLConnection isConnected]) { @@ -97,7 +97,7 @@ // If an error occurred, reset the interface and abort if ([mySQLConnection queryErrored]) { - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; [[self onMainThread] setTableDetails:nil]; if ([mySQLConnection isConnected]) { @@ -192,7 +192,7 @@ [[self onMainThread] setTableDetails:tableDetails]; // Send the query finished/work complete notification - [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance]; } -- cgit v1.2.3