From c1580fb4e585a16348b59641ba0e1ebe19b99062 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 19 Jul 2015 04:57:49 +0200 Subject: Replace a setter with @property --- Source/SPTableData.h | 2 +- Source/SPTableData.m | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Source/SPTableData.h b/Source/SPTableData.h index 1b457ca7..05783256 100644 --- a/Source/SPTableData.h +++ b/Source/SPTableData.h @@ -55,8 +55,8 @@ } @property (readonly, assign) BOOL tableHasAutoIncrementField; +@property (nonatomic, retain) SPMySQLConnection *connection; -- (void) setConnection:(SPMySQLConnection *)theConnection; - (NSString *) tableEncoding; - (NSString *) tableCreateSyntax; - (NSArray *) columns; diff --git a/Source/SPTableData.m b/Source/SPTableData.m index cb98183e..27dd4ea1 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -48,6 +48,7 @@ @implementation SPTableData @synthesize tableHasAutoIncrementField; +@synthesize connection = mySQLConnection; - (id) init { @@ -61,7 +62,6 @@ triggers = nil; tableEncoding = nil; tableCreateSyntax = nil; - mySQLConnection = nil; tableHasAutoIncrementField = NO; pthread_mutex_init(&dataProcessingLock, NULL); @@ -70,18 +70,6 @@ return self; } -/** - * Set the connection for use. - * Called by the connect sheet methods. - * - * @param theConnection The used connection for the SPDatabaseDocument - */ -- (void) setConnection:(SPMySQLConnection *)theConnection -{ - mySQLConnection = theConnection; - [mySQLConnection retain]; -} - /** * Retrieve the encoding for the current table, using or refreshing the cache as appropriate. */ @@ -1415,7 +1403,7 @@ if (triggers) SPClear(triggers); if (tableEncoding) SPClear(tableEncoding); if (tableCreateSyntax) SPClear(tableCreateSyntax); - if (mySQLConnection) SPClear(mySQLConnection); + [self setConnection:nil]; pthread_mutex_destroy(&dataProcessingLock); -- cgit v1.2.3