Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switching to ARC (automatic reference counting)

  • Loading branch information...
commit db4785329b58d9e146520041691f7085b08d0ad9 1 parent 8bf1951
Robbie Hanson robbiehanson authored
Showing with 3,899 additions and 2,211 deletions.
  1. +20 −23 Benchmarking/PerformanceTesting.m
  2. +0 −1  Lumberjack/DDASLLogger.m
  3. +62 −76 Lumberjack/DDAbstractDatabaseLogger.m
  4. +12 −12 Lumberjack/DDFileLogger.h
  5. +26 −83 Lumberjack/DDFileLogger.m
  6. +49 −95 Lumberjack/DDLog.m
  7. +0 −1  Lumberjack/DDTTYLogger.m
  8. +0 −15 Lumberjack/Extensions/ContextFilterLogFormatter.m
  9. +4 −10 Lumberjack/Extensions/DispatchQueueLogFormatter.m
  10. +4 −0 Xcode/BenchmarkIPhone/BenchmarkIPhone.xcodeproj/project.pbxproj
  11. +2 −2 Xcode/BenchmarkIPhone/Classes/BenchmarkIPhoneAppDelegate.h
  12. +0 −6 Xcode/BenchmarkIPhone/Classes/BenchmarkIPhoneAppDelegate.m
  13. +0 −3  Xcode/BenchmarkIPhone/Classes/BenchmarkIPhoneViewController.m
  14. +4 −4 Xcode/BenchmarkIPhone/main.m
  15. +61 −24 Xcode/BenchmarkMac/BenchmarkMac.xcodeproj/project.pbxproj
  16. +2 −2 Xcode/BenchmarkMac/BenchmarkMacAppDelegate.h
  17. +8 −2 Xcode/ContextFilter/ContextFilter.xcodeproj/project.pbxproj
  18. +2 −2 Xcode/ContextFilter/ContextFilterAppDelegate.h
  19. +1 −1  Xcode/ContextFilter/ContextFilterAppDelegate.m
  20. +6 −0 Xcode/CoreDataLogger/CoreDataLogger.xcodeproj/project.pbxproj
  21. +2 −2 Xcode/CoreDataLogger/CoreDataLogger/CoreDataLogger.h
  22. +32 −47 Xcode/CoreDataLogger/CoreDataLogger/CoreDataLogger.m
  23. +2 −2 Xcode/CoreDataLogger/CoreDataLogger/CoreDataLoggerAppDelegate.h
  24. +4 −4 Xcode/CoreDataLogger/CoreDataLogger/LogEntry.h
  25. +11 −7 Xcode/CustomFormatters/CustomFormatters.xcodeproj/project.pbxproj
  26. +2 −2 Xcode/CustomFormatters/CustomFormattersAppDelegate.h
  27. +1 −1  Xcode/CustomFormatters/CustomFormattersAppDelegate.m
  28. +11 −7 Xcode/CustomLogLevels/CustomLogLevels.xcodeproj/project.pbxproj
  29. +2 −2 Xcode/CustomLogLevels/CustomLogLevelsAppDelegate.h
  30. +8 −8 Xcode/CustomLogLevels/MYLog.h
  31. +3 −0  Xcode/DispatchQueueLogger/DispatchQueueLogger.xcodeproj/project.pbxproj
  32. +1 −1  Xcode/DispatchQueueLogger/DispatchQueueLogger/AppDelegate.h
  33. +1 −1  Xcode/DispatchQueueLogger/DispatchQueueLogger/AppDelegate.m
  34. +11 −7 Xcode/FineGrainedLogging/FineGrainedLogging.xcodeproj/project.pbxproj
  35. +2 −2 Xcode/FineGrainedLogging/FineGrainedLoggingAppDelegate.h
  36. +4 −7 Xcode/FineGrainedLogging/TimerOne.m
  37. +4 −7 Xcode/FineGrainedLogging/TimerTwo.m
  38. +11 −7 Xcode/GlobalLogLevel/GlobalLogLevel.xcodeproj/project.pbxproj
  39. +2 −2 Xcode/GlobalLogLevel/GlobalLogLevelAppDelegate.h
  40. +17 −27 Xcode/LogFileCompressor/CompressingLogFileManager.m
  41. +11 −7 Xcode/LogFileCompressor/LogFileCompressor.xcodeproj/project.pbxproj
  42. +2 −2 Xcode/LogFileCompressor/LogFileCompressorAppDelegate.h
  43. +1 −1  Xcode/LogFileCompressor/LogFileCompressorAppDelegate.m
  44. +11 −7 Xcode/OverflowTestMac/OverflowTestMac.xcodeproj/project.pbxproj
  45. +2 −2 Xcode/OverflowTestMac/OverflowTestMacAppDelegate.h
  46. +15 −15 Xcode/OverflowTestMac/OverflowTestMacAppDelegate.m
  47. +11 −7 Xcode/RollingTestMac/RollingTestMac.xcodeproj/project.pbxproj
  48. +2 −2 Xcode/RollingTestMac/RollingTestMacAppDelegate.h
  49. +2 −22 Xcode/SQLiteLogger/FMDBLogger.m
  50. +6 −3 Xcode/SQLiteLogger/SQLiteLogger.xcodeproj/project.pbxproj
  51. +2 −2 Xcode/SQLiteLogger/SQLiteLogger/SQLiteLoggerAppDelegate.h
  52. +64 −34 ...teredDynamicLogging/Desktop/{RegisteredLoggingTest → }/RegisteredLoggingTest.xcodeproj/project.pbxproj
  53. 0  ...esting/RegisteredDynamicLogging/{Mobile/RegisteredLoggingTest → Desktop}/RegisteredLoggingTest/Lions.h
  54. 0  ...esting/RegisteredDynamicLogging/{Mobile/RegisteredLoggingTest → Desktop}/RegisteredLoggingTest/Lions.m
  55. 0  ...namicLogging/Desktop/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTest-Info.plist
  56. 0  ...namicLogging/Desktop/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTest-Prefix.pch
  57. +0 −7 .../Desktop/RegisteredLoggingTest/RegisteredLoggingTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  58. +2 −2 ...micLogging/Desktop/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTestAppDelegate.h
  59. 0  ...micLogging/Desktop/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTestAppDelegate.m
  60. 0  ...sting/RegisteredDynamicLogging/{Mobile/RegisteredLoggingTest → Desktop}/RegisteredLoggingTest/Tigers.h
  61. 0  ...sting/RegisteredDynamicLogging/{Mobile/RegisteredLoggingTest → Desktop}/RegisteredLoggingTest/Tigers.m
  62. 0  ...RegisteredDynamicLogging/Desktop/RegisteredLoggingTest/{RegisteredLoggingTest → }/en.lproj/Credits.rtf
  63. 0  ...namicLogging/{Mobile/RegisteredLoggingTest → Desktop}/RegisteredLoggingTest/en.lproj/InfoPlist.strings
  64. 0  ...egisteredDynamicLogging/Desktop/RegisteredLoggingTest/{RegisteredLoggingTest → }/en.lproj/MainMenu.xib
  65. 0  Xcode/Testing/RegisteredDynamicLogging/Desktop/RegisteredLoggingTest/{RegisteredLoggingTest → }/main.m
  66. +63 −34 ...steredDynamicLogging/Mobile/{RegisteredLoggingTest → }/RegisteredLoggingTest.xcodeproj/project.pbxproj
  67. 0  ...esting/RegisteredDynamicLogging/{Desktop/RegisteredLoggingTest → Mobile}/RegisteredLoggingTest/Lions.h
  68. 0  ...esting/RegisteredDynamicLogging/{Desktop/RegisteredLoggingTest → Mobile}/RegisteredLoggingTest/Lions.m
  69. 0  ...ynamicLogging/Mobile/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTest-Info.plist
  70. 0  ...ynamicLogging/Mobile/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTest-Prefix.pch
  71. +0 −7 ...g/Mobile/RegisteredLoggingTest/RegisteredLoggingTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  72. +2 −2 ...amicLogging/Mobile/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTestAppDelegate.h
  73. 0  ...amicLogging/Mobile/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTestAppDelegate.m
  74. 0  ...cLogging/Mobile/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTestViewController.h
  75. 0  ...cLogging/Mobile/RegisteredLoggingTest/{RegisteredLoggingTest → }/RegisteredLoggingTestViewController.m
  76. 0  ...sting/RegisteredDynamicLogging/{Desktop/RegisteredLoggingTest → Mobile}/RegisteredLoggingTest/Tigers.h
  77. 0  ...sting/RegisteredDynamicLogging/{Desktop/RegisteredLoggingTest → Mobile}/RegisteredLoggingTest/Tigers.m
  78. 0  ...namicLogging/{Desktop/RegisteredLoggingTest → Mobile}/RegisteredLoggingTest/en.lproj/InfoPlist.strings
  79. 0  ...gisteredDynamicLogging/Mobile/RegisteredLoggingTest/{RegisteredLoggingTest → }/en.lproj/MainWindow.xib
  80. 0  ...bile/RegisteredLoggingTest/{RegisteredLoggingTest → }/en.lproj/RegisteredLoggingTestViewController.xib
  81. +4 −4 Xcode/Testing/RegisteredDynamicLogging/Mobile/RegisteredLoggingTest/{RegisteredLoggingTest → }/main.m
  82. +2 −2 Xcode/UniversalApp/Classes/UniversalAppAppDelegate.h
  83. +0 −5 Xcode/UniversalApp/Classes/UniversalAppAppDelegate.m
  84. +0 −3  Xcode/UniversalApp/Classes/UniversalAppViewController.m
  85. +6 −2 Xcode/UniversalApp/UniversalApp.xcodeproj/project.pbxproj
  86. +4 −4 Xcode/UniversalApp/main.m
  87. +8 −7 Xcode/WebServerIPhone/Classes/MyHTTPConnection.m
  88. +4 −5 Xcode/WebServerIPhone/Classes/WebServerIPhoneAppDelegate.h
  89. +0 −6 Xcode/WebServerIPhone/Classes/WebServerIPhoneAppDelegate.m
  90. +0 −4 Xcode/WebServerIPhone/Classes/WebServerIPhoneViewController.m
  91. +5 −12 Xcode/WebServerIPhone/Classes/WebSocketLogger.m
  92. +140 −59 Xcode/WebServerIPhone/Vendor/{CocoaHTTPServer → CocoaAsyncSocket}/GCDAsyncSocket.h
  93. +2,167 −929 Xcode/WebServerIPhone/Vendor/{CocoaHTTPServer → CocoaAsyncSocket}/GCDAsyncSocket.m
  94. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Categories}/DDData.h
  95. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Categories}/DDData.m
  96. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Categories}/DDNumber.h
  97. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Categories}/DDNumber.m
  98. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Categories}/DDRange.h
  99. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Categories}/DDRange.m
  100. +10 −2 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/HTTPConnection.h
  101. +558 −243 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/HTTPConnection.m
  102. +35 −22 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/HTTPLogging.h
  103. +52 −18 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/HTTPResponse.h
  104. +40 −1 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/HTTPServer.h
  105. +71 −39 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/HTTPServer.m
  106. +0 −18 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/LICENSE.txt
  107. +2 −2 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPAsyncFileResponse.h
  108. +3 −3 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPAsyncFileResponse.m
  109. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPDataResponse.h
  110. +1 −1  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPDataResponse.m
  111. +4 −0 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPDynamicFileResponse.h
  112. +8 −8 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPDynamicFileResponse.m
  113. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPFileResponse.h
  114. +2 −2 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPFileResponse.m
  115. 0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPRedirectResponse.h
  116. +1 −1  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/{ → Responses}/HTTPRedirectResponse.m
  117. +2 −0  Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/WebSocket.h
  118. +9 −6 Xcode/WebServerIPhone/Vendor/CocoaHTTPServer/WebSocket.m
  119. +167 −138 Xcode/WebServerIPhone/WebServerIPhone.xcodeproj/project.pbxproj
  120. +4 −4 Xcode/WebServerIPhone/main.m
43 Benchmarking/PerformanceTesting.m
View
@@ -122,16 +122,6 @@ + (void)executeTestsWithBase:(BOOL)exeBase framework:(BOOL)exeFramework framewor
for (j = 0; j < 5; j++)
{
- SEL selector;
- switch (j)
- {
- case 0 : selector = @selector(speedTest0); break;
- case 1 : selector = @selector(speedTest1); break;
- case 2 : selector = @selector(speedTest2); break;
- case 3 : selector = @selector(speedTest3); break;
- default : selector = @selector(speedTest4); break;
- }
-
NSTimeInterval min = DBL_MAX;
NSTimeInterval max = DBL_MIN;
@@ -139,20 +129,27 @@ + (void)executeTestsWithBase:(BOOL)exeBase framework:(BOOL)exeFramework framewor
for (k = 0; k < NUMBER_OF_RUNS; k++)
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- NSDate *start = [NSDate date];
-
- [class performSelector:selector];
-
- NSTimeInterval result = [start timeIntervalSinceNow] * -1.0;
-
- min = MIN(min, result);
- max = MAX(max, result);
+ @autoreleasepool {
- total += result;
+ NSDate *start = [NSDate date];
+
+ switch (j)
+ {
+ case 0 : [class performSelector:@selector(speedTest0)]; break;
+ case 1 : [class performSelector:@selector(speedTest1)]; break;
+ case 2 : [class performSelector:@selector(speedTest2)]; break;
+ case 3 : [class performSelector:@selector(speedTest3)]; break;
+ default : [class performSelector:@selector(speedTest4)]; break;
+ }
+
+ NSTimeInterval result = [start timeIntervalSinceNow] * -1.0;
+
+ min = MIN(min, result);
+ max = MAX(max, result);
+
+ total += result;
- [pool release];
+ }
[DDLog flushLog];
}
@@ -319,7 +316,7 @@ + (NSString *)csvResults
+ (void)startPerformanceTests
{
- BOOL runBase = YES;
+ BOOL runBase = NO;
BOOL runSuite1 = YES;
BOOL runSuite2 = YES;
BOOL runSuite3 = YES;
1  Lumberjack/DDASLLogger.m
View
@@ -35,7 +35,6 @@ - (id)init
{
if (sharedInstance != nil)
{
- [self release];
return nil;
}
138 Lumberjack/DDAbstractDatabaseLogger.m
View
@@ -26,7 +26,6 @@ - (void)dealloc
[self destroySaveTimer];
[self destroyDeleteTimer];
- [super dealloc];
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -129,13 +128,11 @@ - (void)createSuspendedSaveTimer
{
saveTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
- dispatch_source_set_event_handler(saveTimer, ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_source_set_event_handler(saveTimer, ^{ @autoreleasepool {
[self performSaveAndSuspendSaveTimer];
- [pool drain];
- });
+ }});
saveTimerSuspended = YES;
}
@@ -173,13 +170,11 @@ - (void)createAndStartDeleteTimer
{
deleteTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
- dispatch_source_set_event_handler(deleteTimer, ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_source_set_event_handler(deleteTimer, ^{ @autoreleasepool {
[self performDelete];
- [pool drain];
- });
+ }});
[self updateDeleteTimer];
@@ -224,11 +219,11 @@ - (void)setSaveThreshold:(NSUInteger)threshold
if ((unsavedCount >= saveThreshold) && (saveThreshold > 0))
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- [self performSaveAndSuspendSaveTimer];
+ @autoreleasepool {
+
+ [self performSaveAndSuspendSaveTimer];
- [pool drain];
+ }
}
}
};
@@ -280,30 +275,29 @@ - (void)setSaveInterval:(NSTimeInterval)interval
if (saveInterval > 0.0)
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- if (saveTimer == NULL)
- {
- // Handles #2
- //
- // Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
- // if a save is needed the timer will fire immediately.
-
- [self createSuspendedSaveTimer];
- [self updateAndResumeSaveTimer];
- }
- else
+ @autoreleasepool
{
- // Handles #3
- // Handles #4
- //
- // Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
- // if a save is needed the timer will fire immediately.
-
- [self updateAndResumeSaveTimer];
+ if (saveTimer == NULL)
+ {
+ // Handles #2
+ //
+ // Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
+ // if a save is needed the timer will fire immediately.
+
+ [self createSuspendedSaveTimer];
+ [self updateAndResumeSaveTimer];
+ }
+ else
+ {
+ // Handles #3
+ // Handles #4
+ //
+ // Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
+ // if a save is needed the timer will fire immediately.
+
+ [self updateAndResumeSaveTimer];
+ }
}
-
- [pool drain];
}
else if (saveTimer)
{
@@ -387,16 +381,15 @@ - (void)setMaxAge:(NSTimeInterval)interval
if (shouldDeleteNow)
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- [self performDelete];
-
- if (deleteTimer)
- [self updateDeleteTimer];
- else
- [self createAndStartDeleteTimer];
-
- [pool drain];
+ @autoreleasepool
+ {
+ [self performDelete];
+
+ if (deleteTimer)
+ [self updateDeleteTimer];
+ else
+ [self createAndStartDeleteTimer];
+ }
}
}
};
@@ -448,29 +441,28 @@ - (void)setDeleteInterval:(NSTimeInterval)interval
if (deleteInterval > 0.0)
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- if (deleteTimer == NULL)
- {
- // Handles #2
- //
- // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
- // if a delete is needed the timer will fire immediately.
-
- [self createAndStartDeleteTimer];
- }
- else
+ @autoreleasepool
{
- // Handles #3
- // Handles #4
- //
- // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
- // if a save is needed the timer will fire immediately.
-
- [self updateDeleteTimer];
+ if (deleteTimer == NULL)
+ {
+ // Handles #2
+ //
+ // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
+ // if a delete is needed the timer will fire immediately.
+
+ [self createAndStartDeleteTimer];
+ }
+ else
+ {
+ // Handles #3
+ // Handles #4
+ //
+ // Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
+ // if a save is needed the timer will fire immediately.
+
+ [self updateDeleteTimer];
+ }
}
-
- [pool drain];
}
else if (deleteTimer)
{
@@ -524,13 +516,10 @@ - (void)setDeleteOnEverySave:(BOOL)flag
- (void)savePendingLogEntries
{
- dispatch_block_t block = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t block = ^{ @autoreleasepool {
[self performSaveAndSuspendSaveTimer];
-
- [pool drain];
- };
+ }};
if (dispatch_get_current_queue() == loggerQueue)
block();
@@ -540,13 +529,10 @@ - (void)savePendingLogEntries
- (void)deleteOldLogEntries
{
- dispatch_block_t block = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t block = ^{ @autoreleasepool {
[self performDelete];
-
- [pool drain];
- };
+ }};
if (dispatch_get_current_queue() == loggerQueue)
block();
24 Lumberjack/DDFileLogger.h
View
@@ -141,7 +141,7 @@
@interface DDFileLogger : DDAbstractLogger <DDLogger>
{
- id <DDLogFileManager> logFileManager;
+ __strong id <DDLogFileManager> logFileManager;
DDLogFileInfo *currentLogFileInfo;
NSFileHandle *currentLogFileHandle;
@@ -184,7 +184,7 @@
@property (readwrite, assign) NSTimeInterval rollingFrequency;
-@property (nonatomic, readonly) id <DDLogFileManager> logFileManager;
+@property (strong, nonatomic, readonly) id <DDLogFileManager> logFileManager;
// You can optionally force the current log file to be rolled with this method.
@@ -217,24 +217,24 @@
@interface DDLogFileInfo : NSObject
{
- NSString *filePath;
- NSString *fileName;
+ __strong NSString *filePath;
+ __strong NSString *fileName;
- NSDictionary *fileAttributes;
+ __strong NSDictionary *fileAttributes;
- NSDate *creationDate;
- NSDate *modificationDate;
+ __strong NSDate *creationDate;
+ __strong NSDate *modificationDate;
unsigned long long fileSize;
}
-@property (nonatomic, readonly) NSString *filePath;
-@property (nonatomic, readonly) NSString *fileName;
+@property (strong, nonatomic, readonly) NSString *filePath;
+@property (strong, nonatomic, readonly) NSString *fileName;
-@property (nonatomic, readonly) NSDictionary *fileAttributes;
+@property (strong, nonatomic, readonly) NSDictionary *fileAttributes;
-@property (nonatomic, readonly) NSDate *creationDate;
-@property (nonatomic, readonly) NSDate *modificationDate;
+@property (strong, nonatomic, readonly) NSDate *creationDate;
+@property (strong, nonatomic, readonly) NSDate *modificationDate;
@property (nonatomic, readonly) unsigned long long fileSize;
109 Lumberjack/DDFileLogger.m
View
@@ -77,12 +77,6 @@ - (id)initWithLogsDirectory:(NSString *)aLogsDirectory
return self;
}
-- (void)dealloc
-{
- [_logsDirectory release];
- [super dealloc];
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Configuration
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -109,13 +103,11 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
{
#if GCD_MAYBE_AVAILABLE
- dispatch_async([DDLog loggingQueue], ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_async([DDLog loggingQueue], ^{ @autoreleasepool {
[self deleteOldLogFiles];
- [pool drain];
- });
+ }});
#endif
}
@@ -322,7 +314,6 @@ - (NSArray *)unsortedLogFileInfos
DDLogFileInfo *logFileInfo = [[DDLogFileInfo alloc] initWithFilePath:filePath];
[unsortedLogFileInfos addObject:logFileInfo];
- [logFileInfo release];
}
return unsortedLogFileInfos;
@@ -394,7 +385,7 @@ - (NSString *)generateShortUUID
CFRelease(fullStr);
CFRelease(uuid);
- return [NSMakeCollectable(shortStr) autorelease];
+ return (__bridge_transfer NSString *)shortStr;
}
/**
@@ -452,12 +443,6 @@ - (NSString *)formatLogMessage:(DDLogMessage *)logMessage
return [NSString stringWithFormat:@"%@ %@", dateAndTime, logMessage->logMsg];
}
-- (void)dealloc
-{
- [dateFormatter release];
- [super dealloc];
-}
-
@end
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -472,7 +457,7 @@ @implementation DDFileLogger
- (id)init
{
- DDLogFileManagerDefault *defaultLogFileManager = [[[DDLogFileManagerDefault alloc] init] autorelease];
+ DDLogFileManagerDefault *defaultLogFileManager = [[DDLogFileManagerDefault alloc] init];
return [self initWithLogFileManager:defaultLogFileManager];
}
@@ -484,7 +469,7 @@ - (id)initWithLogFileManager:(id <DDLogFileManager>)aLogFileManager
maximumFileSize = DEFAULT_LOG_MAX_FILE_SIZE;
rollingFrequency = DEFAULT_LOG_ROLLING_FREQUENCY;
- logFileManager = [aLogFileManager retain];
+ logFileManager = aLogFileManager;
formatter = [[DDLogFileFormatterDefault alloc] init];
}
@@ -493,19 +478,10 @@ - (id)initWithLogFileManager:(id <DDLogFileManager>)aLogFileManager
- (void)dealloc
{
- [formatter release];
- [logFileManager release];
-
- [currentLogFileInfo release];
-
[currentLogFileHandle synchronizeFile];
[currentLogFileHandle closeFile];
- [currentLogFileHandle release];
[rollingTimer invalidate];
- [rollingTimer release];
-
- [super dealloc];
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -562,7 +538,6 @@ - (unsigned long long)maximumFileSize
OSMemoryBarrier();
result = [[resultHolder objectAtIndex:0] unsignedLongLongValue];
- [resultHolder release];
return result;
@@ -579,14 +554,12 @@ - (void)setMaximumFileSize:(unsigned long long)newMaximumFileSize
{
#if GCD_MAYBE_AVAILABLE
- dispatch_block_t block = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t block = ^{ @autoreleasepool {
maximumFileSize = newMaximumFileSize;
[self maybeRollLogFileDueToSize];
- [pool drain];
- };
+ }};
if (dispatch_get_current_queue() == loggerQueue)
block();
@@ -668,7 +641,6 @@ - (NSTimeInterval)rollingFrequency
OSMemoryBarrier();
result = [[resultHolder objectAtIndex:0] doubleValue];
- [resultHolder release];
return result;
@@ -685,14 +657,12 @@ - (void)setRollingFrequency:(NSTimeInterval)newRollingFrequency
{
#if GCD_MAYBE_AVAILABLE
- dispatch_block_t block = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t block = ^{ @autoreleasepool {
rollingFrequency = newRollingFrequency;
[self maybeRollLogFileDueToAge:nil];
- [pool drain];
- };
+ }};
if (dispatch_get_current_queue() == loggerQueue)
block();
@@ -771,7 +741,6 @@ - (void)scheduleTimerToRollLogFileDueToAge
if (rollingTimer)
{
[rollingTimer invalidate];
- [rollingTimer release];
rollingTimer = nil;
}
@@ -792,11 +761,11 @@ - (void)scheduleTimerToRollLogFileDueToAge
NSLogVerbose(@"DDFileLogger: logFileCreationDate: %@", logFileCreationDate);
NSLogVerbose(@"DDFileLogger: logFileRollingDate : %@", logFileRollingDate);
- rollingTimer = [[NSTimer scheduledTimerWithTimeInterval:[logFileRollingDate timeIntervalSinceNow]
- target:self
- selector:@selector(maybeRollLogFileDueToAge:)
- userInfo:nil
- repeats:NO] retain];
+ rollingTimer = [NSTimer scheduledTimerWithTimeInterval:[logFileRollingDate timeIntervalSinceNow]
+ target:self
+ selector:@selector(maybeRollLogFileDueToAge:)
+ userInfo:nil
+ repeats:NO];
}
- (void)rollLogFile
@@ -808,12 +777,10 @@ - (void)rollLogFile
{
#if GCD_MAYBE_AVAILABLE
- dispatch_block_t block = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_async([DDLog loggingQueue], ^{ @autoreleasepool {
+
[self rollLogFileNow];
- [pool drain];
- };
- dispatch_async([DDLog loggingQueue], block);
+ }});
#endif
}
@@ -836,7 +803,6 @@ - (void)rollLogFileNow
[currentLogFileHandle synchronizeFile];
[currentLogFileHandle closeFile];
- [currentLogFileHandle release];
currentLogFileHandle = nil;
currentLogFileInfo.isArchived = YES;
@@ -846,7 +812,6 @@ - (void)rollLogFileNow
[logFileManager didRollAndArchiveLogFile:(currentLogFileInfo.filePath)];
}
- [currentLogFileInfo release];
currentLogFileInfo = nil;
}
@@ -926,7 +891,7 @@ - (DDLogFileInfo *)currentLogFileInfo
{
NSLogVerbose(@"DDFileLogger: Resuming logging with file %@", mostRecentLogFileInfo.fileName);
- currentLogFileInfo = [mostRecentLogFileInfo retain];
+ currentLogFileInfo = mostRecentLogFileInfo;
}
else
{
@@ -959,7 +924,7 @@ - (NSFileHandle *)currentLogFileHandle
{
NSString *logFilePath = [[self currentLogFileInfo] filePath];
- currentLogFileHandle = [[NSFileHandle fileHandleForWritingAtPath:logFilePath] retain];
+ currentLogFileHandle = [NSFileHandle fileHandleForWritingAtPath:logFilePath];
[currentLogFileHandle seekToEndOfFile];
if (currentLogFileHandle)
@@ -1034,7 +999,7 @@ @implementation DDLogFileInfo
+ (id)logFileWithPath:(NSString *)aFilePath
{
- return [[[DDLogFileInfo alloc] initWithFilePath:aFilePath] autorelease];
+ return [[DDLogFileInfo alloc] initWithFilePath:aFilePath];
}
- (id)initWithFilePath:(NSString *)aFilePath
@@ -1046,19 +1011,6 @@ - (id)initWithFilePath:(NSString *)aFilePath
return self;
}
-- (void)dealloc
-{
- [filePath release];
- [fileName release];
-
- [fileAttributes release];
-
- [creationDate release];
- [modificationDate release];
-
- [super dealloc];
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Standard Info
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1067,7 +1019,7 @@ - (NSDictionary *)fileAttributes
{
if (fileAttributes == nil)
{
- fileAttributes = [[[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil] retain];
+ fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
}
return fileAttributes;
}
@@ -1076,7 +1028,7 @@ - (NSString *)fileName
{
if (fileName == nil)
{
- fileName = [[filePath lastPathComponent] retain];
+ fileName = [filePath lastPathComponent];
}
return fileName;
}
@@ -1085,7 +1037,7 @@ - (NSDate *)modificationDate
{
if (modificationDate == nil)
{
- modificationDate = [[[self fileAttributes] objectForKey:NSFileModificationDate] retain];
+ modificationDate = [[self fileAttributes] objectForKey:NSFileModificationDate];
}
return modificationDate;
@@ -1118,7 +1070,7 @@ - (NSDate *)creationDate
NSTimeInterval ti = seconds + (nanos / 1000000000.0);
- creationDate = [[NSDate dateWithTimeIntervalSince1970:ti] retain];
+ creationDate = [NSDate dateWithTimeIntervalSince1970:ti];
}
else
{
@@ -1127,7 +1079,7 @@ - (NSDate *)creationDate
#else
- creationDate = [[[self fileAttributes] objectForKey:NSFileCreationDate] retain];
+ creationDate = [[self fileAttributes] objectForKey:NSFileCreationDate];
#endif
@@ -1216,16 +1168,9 @@ - (void)setIsArchived:(BOOL)flag
- (void)reset
{
- [fileName release];
fileName = nil;
-
- [fileAttributes release];
fileAttributes = nil;
-
- [creationDate release];
creationDate = nil;
-
- [modificationDate release];
modificationDate = nil;
}
@@ -1248,9 +1193,7 @@ - (void)renameFile:(NSString *)newFileName
NSLogError(@"DDLogFileInfo: Error renaming file (%@): %@", self.fileName, error);
}
- [filePath release];
- filePath = [newFilePath retain];
-
+ filePath = newFilePath;
[self reset];
}
}
144 Lumberjack/DDLog.m
View
@@ -228,13 +228,11 @@ + (void)addLogger:(id <DDLogger>)logger
{
#if GCD_MAYBE_AVAILABLE
- dispatch_block_t addLoggerBlock = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t addLoggerBlock = ^{ @autoreleasepool {
[self lt_addLogger:logger];
- [pool drain];
- };
+ }};
dispatch_async(loggingQueue, addLoggerBlock);
@@ -258,13 +256,10 @@ + (void)removeLogger:(id <DDLogger>)logger
{
#if GCD_MAYBE_AVAILABLE
- dispatch_block_t removeLoggerBlock = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t removeLoggerBlock = ^{ @autoreleasepool {
[self lt_removeLogger:logger];
-
- [pool drain];
- };
+ }};
dispatch_async(loggingQueue, removeLoggerBlock);
@@ -286,13 +281,10 @@ + (void)removeAllLoggers
{
#if GCD_MAYBE_AVAILABLE
- dispatch_block_t removeAllLoggersBlock = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t removeAllLoggersBlock = ^{ @autoreleasepool {
[self lt_removeAllLoggers];
-
- [pool drain];
- };
+ }};
dispatch_async(loggingQueue, removeAllLoggersBlock);
@@ -443,13 +435,10 @@ + (void)queueLogMessage:(DDLogMessage *)logMessage asynchronously:(BOOL)asyncFla
{
#if GCD_MAYBE_AVAILABLE
- dispatch_block_t logBlock = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t logBlock = ^{ @autoreleasepool {
[self lt_log:logMessage];
-
- [pool drain];
- };
+ }};
if (asyncFlag)
dispatch_async(loggingQueue, logBlock);
@@ -493,8 +482,6 @@ + (void)log:(BOOL)asynchronous
[self queueLogMessage:logMessage asynchronously:asynchronous];
- [logMessage release];
- [logMsg release];
va_end(args);
}
@@ -506,13 +493,10 @@ + (void)flushLog
{
#if GCD_MAYBE_AVAILABLE
- dispatch_block_t flushBlock = ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_block_t flushBlock = ^{ @autoreleasepool {
[self lt_flush];
-
- [pool drain];
- };
+ }};
dispatch_sync(loggingQueue, flushBlock);
@@ -614,7 +598,7 @@ + (NSArray *)registeredClasses
// The numClasses method now tells us how many classes we have.
// So we can allocate our buffer, and get pointers to all the class definitions.
- Class *classes = malloc(sizeof(Class) * numClasses);
+ Class *classes = (Class *)malloc(sizeof(Class) * numClasses);
numClasses = objc_getClassList(classes, numClasses);
@@ -693,15 +677,14 @@ + (void)setLogLevel:(int)logLevel forClassWithName:(NSString *)aClassName
**/
+ (void)lt_main:(id)ignore
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- // We can't run the run loop unless it has an associated input source or a timer.
- // So we'll just create a timer that will never fire - unless the server runs for 10,000 years.
- [NSTimer scheduledTimerWithTimeInterval:DBL_MAX target:self selector:@selector(ignore:) userInfo:nil repeats:NO];
-
- [[NSRunLoop currentRunLoop] run];
-
- [pool drain];
+ @autoreleasepool {
+
+ // We can't run the run loop unless it has an associated input source or a timer.
+ // So we'll just create a timer that will never fire - unless the server runs for 10,000 years.
+ [NSTimer scheduledTimerWithTimeInterval:DBL_MAX target:self selector:@selector(ignore:) userInfo:nil repeats:NO];
+
+ [[NSRunLoop currentRunLoop] run];
+ }
}
#endif
@@ -746,13 +729,10 @@ + (void)lt_addLogger:(id <DDLogger>)logger
if ([logger respondsToSelector:@selector(didAddLogger)])
{
- dispatch_async(loggerNode->loggerQueue, ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_async(loggerNode->loggerQueue, ^{ @autoreleasepool {
[logger didAddLogger];
-
- [pool drain];
- });
+ }});
}
#endif
@@ -806,13 +786,10 @@ + (void)lt_removeLogger:(id <DDLogger>)logger
if ([logger respondsToSelector:@selector(willRemoveLogger)])
{
- dispatch_async(loggerNode->loggerQueue, ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_async(loggerNode->loggerQueue, ^{ @autoreleasepool {
[logger willRemoveLogger];
-
- [pool drain];
- });
+ }});
}
// Remove from loggers array
@@ -855,13 +832,10 @@ + (void)lt_removeAllLoggers
{
if ([loggerNode->logger respondsToSelector:@selector(willRemoveLogger)])
{
- dispatch_async(loggerNode->loggerQueue, ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_async(loggerNode->loggerQueue, ^{ @autoreleasepool {
[loggerNode->logger willRemoveLogger];
-
- [pool drain];
- });
+ }});
}
}
@@ -909,14 +883,11 @@ + (void)lt_log:(DDLogMessage *)logMessage
for (DDLoggerNode *loggerNode in loggers)
{
- dispatch_group_async(loggingGroup, loggerNode->loggerQueue, ^{
-
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_group_async(loggingGroup, loggerNode->loggerQueue, ^{ @autoreleasepool {
[loggerNode->logger logMessage:logMessage];
-
- [pool drain];
- });
+
+ }});
}
dispatch_group_wait(loggingGroup, DISPATCH_TIME_FOREVER);
@@ -927,13 +898,11 @@ + (void)lt_log:(DDLogMessage *)logMessage
for (DDLoggerNode *loggerNode in loggers)
{
- dispatch_sync(loggerNode->loggerQueue, ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_sync(loggerNode->loggerQueue, ^{ @autoreleasepool {
[loggerNode->logger logMessage:logMessage];
- [pool drain];
- });
+ }});
}
}
@@ -1034,14 +1003,11 @@ + (void)lt_flush
{
if ([loggerNode->logger respondsToSelector:@selector(flush)])
{
- dispatch_group_async(loggingGroup, loggerNode->loggerQueue, ^{
-
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dispatch_group_async(loggingGroup, loggerNode->loggerQueue, ^{ @autoreleasepool {
[loggerNode->logger flush];
- [pool drain];
- });
+ }});
}
}
@@ -1124,9 +1090,9 @@ + (void)lt_flush
if (copy)
{
- return [[[NSString alloc] initWithBytes:subStr
- length:subLen
- encoding:NSUTF8StringEncoding] autorelease];
+ return [[NSString alloc] initWithBytes:subStr
+ length:subLen
+ encoding:NSUTF8StringEncoding];
}
else
{
@@ -1134,10 +1100,10 @@ + (void)lt_flush
// Specifically, we don't need to waste time copying the string.
// We can just tell NSString to point to a range within the string literal.
- return [[[NSString alloc] initWithBytesNoCopy:subStr
- length:subLen
- encoding:NSUTF8StringEncoding
- freeWhenDone:NO] autorelease];
+ return [[NSString alloc] initWithBytesNoCopy:subStr
+ length:subLen
+ encoding:NSUTF8StringEncoding
+ freeWhenDone:NO];
}
}
@@ -1155,7 +1121,7 @@ - (id)initWithLogger:(id <DDLogger>)aLogger loggerQueue:(dispatch_queue_t)aLogge
{
if ((self = [super init]))
{
- logger = [aLogger retain];
+ logger = aLogger;
if (aLoggerQueue) {
loggerQueue = aLoggerQueue;
@@ -1167,16 +1133,14 @@ - (id)initWithLogger:(id <DDLogger>)aLogger loggerQueue:(dispatch_queue_t)aLogge
+ (DDLoggerNode *)nodeWithLogger:(id <DDLogger>)logger loggerQueue:(dispatch_queue_t)loggerQueue
{
- return [[[DDLoggerNode alloc] initWithLogger:logger loggerQueue:loggerQueue] autorelease];
+ return [[DDLoggerNode alloc] initWithLogger:logger loggerQueue:loggerQueue];
}
- (void)dealloc
{
- [logger release];
if (loggerQueue) {
dispatch_release(loggerQueue);
}
- [super dealloc];
}
@end
@@ -1199,7 +1163,7 @@ - (id)initWithLogMsg:(NSString *)msg
{
if((self = [super init]))
{
- logMsg = [msg retain];
+ logMsg = msg;
logLevel = level;
logFlag = flag;
logContext = context;
@@ -1241,7 +1205,7 @@ - (NSString *)fileName
{
if (fileName == nil)
{
- fileName = [ExtractFileNameWithoutExtension(file, NO) retain];
+ fileName = ExtractFileNameWithoutExtension(file, NO);
}
return fileName;
@@ -1259,12 +1223,7 @@ - (NSString *)methodName
- (void)dealloc
{
- [logMsg release];
- [timestamp release];
- [threadID release];
- [fileName release];
- [methodName release];
if (IS_GCD_AVAILABLE) {
#if GCD_MAYBE_AVAILABLE
@@ -1274,7 +1233,6 @@ - (void)dealloc
#endif
}
- [super dealloc];
}
@end
@@ -1316,7 +1274,6 @@ - (void)dealloc
#endif
}
- [super dealloc];
}
- (void)logMessage:(DDLogMessage *)logMessage
@@ -1340,8 +1297,7 @@ - (void)lt_setLogFormatter:(id <DDLogFormatter>)logFormatter
if (formatter != logFormatter)
{
- [formatter release];
- formatter = [logFormatter retain];
+ formatter = logFormatter;
}
}
@@ -1414,10 +1370,10 @@ - (void)lt_setLogFormatter:(id <DDLogFormatter>)logFormatter
__block id <DDLogFormatter> result;
dispatch_sync([DDLog loggingQueue], ^{
- result = [formatter retain];
+ result = formatter;
});
- return [result autorelease];
+ return result;
#endif
}
@@ -1441,10 +1397,9 @@ - (void)lt_setLogFormatter:(id <DDLogFormatter>)logFormatter
OSMemoryBarrier();
- id <DDLogFormatter> result = [[resultHolder objectAtIndex:0] retain];
- [resultHolder release];
+ id <DDLogFormatter> result = [resultHolder objectAtIndex:0];
- return [result autorelease];
+ return result;
#endif
}
@@ -1512,8 +1467,7 @@ - (void)setLogFormatter:(id <DDLogFormatter>)logFormatter
dispatch_block_t block = ^{
if (formatter != logFormatter)
{
- [formatter release];
- formatter = [logFormatter retain];
+ formatter = logFormatter;
}
};
1  Lumberjack/DDTTYLogger.m
View
@@ -36,7 +36,6 @@ - (id)init
{
if (sharedInstance != nil)
{
- [self release];
return nil;
}
15 Lumberjack/Extensions/ContextFilterLogFormatter.m
View
@@ -31,11 +31,6 @@ - (id)init
return self;
}
-- (void)dealloc
-{
- [contextSet release];
- [super dealloc];
-}
- (void)addToWhitelist:(int)loggingContext
{
@@ -85,11 +80,6 @@ - (id)init
return self;
}
-- (void)dealloc
-{
- [contextSet release];
- [super dealloc];
-}
- (void)addToBlacklist:(int)loggingContext
{
@@ -140,11 +130,6 @@ - (id)init
return self;
}
-- (void)dealloc
-{
- [set release];
- [super dealloc];
-}
- (void)addToSet:(int)loggingContext
{
14 Lumberjack/Extensions/DispatchQueueLogFormatter.m
View
@@ -40,12 +40,6 @@ - (id)init
return self;
}
-- (void)dealloc
-{
- [dateFormatter release];
- [_replacements release];
- [super dealloc];
-}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Configuration
@@ -109,11 +103,11 @@ - (NSString *)replacementStringForQueueLabel:(NSString *)longLabel
OSSpinLockLock(&lock);
{
- result = [[_replacements objectForKey:longLabel] retain];
+ result = [_replacements objectForKey:longLabel];
}
OSSpinLockUnlock(&lock);
- return [result autorelease];
+ return result;
}
- (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel
@@ -153,12 +147,12 @@ - (NSString *)formatLogMessage:(DDLogMessage *)logMessage
queueLength = _queueLength;
rightAlign = _rightAlign;
- shortLabel = [[_replacements objectForKey:longLabel] retain];
+ shortLabel = [_replacements objectForKey:longLabel];
}
OSSpinLockUnlock(&lock);
if (shortLabel)
- label = [shortLabel autorelease];
+ label = shortLabel;
else
label = longLabel;
}
4 Xcode/BenchmarkIPhone/BenchmarkIPhone.xcodeproj/project.pbxproj
View
@@ -248,11 +248,13 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = BenchmarkIPhone_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "BenchmarkIPhone-Info.plist";
PRODUCT_NAME = BenchmarkIPhone;
};
@@ -262,9 +264,11 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = BenchmarkIPhone_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "BenchmarkIPhone-Info.plist";
PRODUCT_NAME = BenchmarkIPhone;
};
4 Xcode/BenchmarkIPhone/Classes/BenchmarkIPhoneAppDelegate.h
View
@@ -9,8 +9,8 @@
BenchmarkIPhoneViewController *viewController;
}
-@property (nonatomic, retain) IBOutlet UIWindow *window;
-@property (nonatomic, retain) IBOutlet BenchmarkIPhoneViewController *viewController;
+@property (nonatomic, strong) IBOutlet UIWindow *window;
+@property (nonatomic, strong) IBOutlet BenchmarkIPhoneViewController *viewController;
@end
6 Xcode/BenchmarkIPhone/Classes/BenchmarkIPhoneAppDelegate.m
View
@@ -17,11 +17,5 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application
[PerformanceTesting startPerformanceTests];
}
-- (void)dealloc
-{
- [viewController release];
- [window release];
- [super dealloc];
-}
@end
3  Xcode/BenchmarkIPhone/Classes/BenchmarkIPhoneViewController.m
View
@@ -49,8 +49,5 @@ - (void)viewDidUnload {
}
-- (void)dealloc {
- [super dealloc];
-}
@end
8 Xcode/BenchmarkIPhone/main.m
View
@@ -10,8 +10,8 @@
int main(int argc, char *argv[]) {
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
- int retVal = UIApplicationMain(argc, argv, nil, nil);
- [pool release];
- return retVal;
+ @autoreleasepool {
+ int retVal = UIApplicationMain(argc, argv, nil, nil);
+ return retVal;
+ }
}
85 Xcode/BenchmarkMac/BenchmarkMac.xcodeproj/project.pbxproj
View
@@ -12,10 +12,14 @@
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
- DC624CE1120112520011E58C /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DC624CE0120112520011E58C /* DDASLLogger.m */; };
- DC624D011201399A0011E58C /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DC624D001201399A0011E58C /* DDTTYLogger.m */; };
- DC987C24119292940020FF52 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DC987C1E119292940020FF52 /* DDFileLogger.m */; };
- DC987C25119292940020FF52 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = DC987C20119292940020FF52 /* DDLog.m */; };
+ DC25B7C8146B2E62000F32F4 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DC25B7B9146B2E62000F32F4 /* DDAbstractDatabaseLogger.m */; };
+ DC25B7C9146B2E62000F32F4 /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DC25B7BB146B2E62000F32F4 /* DDASLLogger.m */; };
+ DC25B7CA146B2E62000F32F4 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DC25B7BD146B2E62000F32F4 /* DDFileLogger.m */; };
+ DC25B7CB146B2E62000F32F4 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = DC25B7BF146B2E62000F32F4 /* DDLog.m */; };
+ DC25B7CC146B2E62000F32F4 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DC25B7C1146B2E62000F32F4 /* DDTTYLogger.m */; };
+ DC25B7CD146B2E62000F32F4 /* ContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DC25B7C4146B2E62000F32F4 /* ContextFilterLogFormatter.m */; };
+ DC25B7CE146B2E62000F32F4 /* DispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DC25B7C6146B2E62000F32F4 /* DispatchQueueLogFormatter.m */; };
+ DC25B7CF146B2E62000F32F4 /* README.txt in Resources */ = {isa = PBXBuildFile; fileRef = DC25B7C7146B2E62000F32F4 /* README.txt */; };
DC987C30119292B20020FF52 /* BaseNSLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = DC987C29119292B20020FF52 /* BaseNSLogging.m */; };
DC987C31119292B20020FF52 /* DynamicLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = DC987C2B119292B20020FF52 /* DynamicLogging.m */; };
DC987C32119292B20020FF52 /* PerformanceTesting.m in Sources */ = {isa = PBXBuildFile; fileRef = DC987C2D119292B20020FF52 /* PerformanceTesting.m */; };
@@ -35,14 +39,21 @@
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* BenchmarkMac-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "BenchmarkMac-Info.plist"; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* BenchmarkMac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BenchmarkMac.app; sourceTree = BUILT_PRODUCTS_DIR; };
- DC624CDF120112520011E58C /* DDASLLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDASLLogger.h; path = ../../Lumberjack/DDASLLogger.h; sourceTree = "<group>"; };
- DC624CE0120112520011E58C /* DDASLLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDASLLogger.m; path = ../../Lumberjack/DDASLLogger.m; sourceTree = "<group>"; };
- DC624CFF1201399A0011E58C /* DDTTYLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDTTYLogger.h; path = ../../Lumberjack/DDTTYLogger.h; sourceTree = "<group>"; };
- DC624D001201399A0011E58C /* DDTTYLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDTTYLogger.m; path = ../../Lumberjack/DDTTYLogger.m; sourceTree = "<group>"; };
- DC987C1D119292940020FF52 /* DDFileLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDFileLogger.h; path = ../../Lumberjack/DDFileLogger.h; sourceTree = SOURCE_ROOT; };
- DC987C1E119292940020FF52 /* DDFileLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDFileLogger.m; path = ../../Lumberjack/DDFileLogger.m; sourceTree = SOURCE_ROOT; };
- DC987C1F119292940020FF52 /* DDLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDLog.h; path = ../../Lumberjack/DDLog.h; sourceTree = SOURCE_ROOT; };
- DC987C20119292940020FF52 /* DDLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDLog.m; path = ../../Lumberjack/DDLog.m; sourceTree = SOURCE_ROOT; };
+ DC25B7B8146B2E62000F32F4 /* DDAbstractDatabaseLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDAbstractDatabaseLogger.h; path = ../../Lumberjack/DDAbstractDatabaseLogger.h; sourceTree = "<group>"; };
+ DC25B7B9146B2E62000F32F4 /* DDAbstractDatabaseLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDAbstractDatabaseLogger.m; path = ../../Lumberjack/DDAbstractDatabaseLogger.m; sourceTree = "<group>"; };
+ DC25B7BA146B2E62000F32F4 /* DDASLLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDASLLogger.h; path = ../../Lumberjack/DDASLLogger.h; sourceTree = "<group>"; };
+ DC25B7BB146B2E62000F32F4 /* DDASLLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDASLLogger.m; path = ../../Lumberjack/DDASLLogger.m; sourceTree = "<group>"; };
+ DC25B7BC146B2E62000F32F4 /* DDFileLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDFileLogger.h; path = ../../Lumberjack/DDFileLogger.h; sourceTree = "<group>"; };
+ DC25B7BD146B2E62000F32F4 /* DDFileLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDFileLogger.m; path = ../../Lumberjack/DDFileLogger.m; sourceTree = "<group>"; };
+ DC25B7BE146B2E62000F32F4 /* DDLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDLog.h; path = ../../Lumberjack/DDLog.h; sourceTree = "<group>"; };
+ DC25B7BF146B2E62000F32F4 /* DDLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDLog.m; path = ../../Lumberjack/DDLog.m; sourceTree = "<group>"; };
+ DC25B7C0146B2E62000F32F4 /* DDTTYLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDTTYLogger.h; path = ../../Lumberjack/DDTTYLogger.h; sourceTree = "<group>"; };
+ DC25B7C1146B2E62000F32F4 /* DDTTYLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDTTYLogger.m; path = ../../Lumberjack/DDTTYLogger.m; sourceTree = "<group>"; };
+ DC25B7C3146B2E62000F32F4 /* ContextFilterLogFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextFilterLogFormatter.h; sourceTree = "<group>"; };
+ DC25B7C4146B2E62000F32F4 /* ContextFilterLogFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContextFilterLogFormatter.m; sourceTree = "<group>"; };
+ DC25B7C5146B2E62000F32F4 /* DispatchQueueLogFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DispatchQueueLogFormatter.h; sourceTree = "<group>"; };
+ DC25B7C6146B2E62000F32F4 /* DispatchQueueLogFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DispatchQueueLogFormatter.m; sourceTree = "<group>"; };
+ DC25B7C7146B2E62000F32F4 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
DC987C28119292B20020FF52 /* BaseNSLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseNSLogging.h; path = ../../Benchmarking/BaseNSLogging.h; sourceTree = SOURCE_ROOT; };
DC987C29119292B20020FF52 /* BaseNSLogging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BaseNSLogging.m; path = ../../Benchmarking/BaseNSLogging.m; sourceTree = SOURCE_ROOT; };
DC987C2A119292B20020FF52 /* DynamicLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicLogging.h; path = ../../Benchmarking/DynamicLogging.h; sourceTree = SOURCE_ROOT; };
@@ -142,17 +153,33 @@
name = Frameworks;
sourceTree = "<group>";
};
+ DC25B7C2146B2E62000F32F4 /* Extensions */ = {
+ isa = PBXGroup;
+ children = (
+ DC25B7C3146B2E62000F32F4 /* ContextFilterLogFormatter.h */,
+ DC25B7C4146B2E62000F32F4 /* ContextFilterLogFormatter.m */,
+ DC25B7C5146B2E62000F32F4 /* DispatchQueueLogFormatter.h */,
+ DC25B7C6146B2E62000F32F4 /* DispatchQueueLogFormatter.m */,
+ DC25B7C7146B2E62000F32F4 /* README.txt */,
+ );
+ name = Extensions;
+ path = ../../Lumberjack/Extensions;
+ sourceTree = "<group>";
+ };
DC987C18119292740020FF52 /* Logging */ = {
isa = PBXGroup;
children = (
- DC987C1F119292940020FF52 /* DDLog.h */,
- DC987C20119292940020FF52 /* DDLog.m */,
- DC624CDF120112520011E58C /* DDASLLogger.h */,
- DC624CE0120112520011E58C /* DDASLLogger.m */,
- DC624CFF1201399A0011E58C /* DDTTYLogger.h */,
- DC624D001201399A0011E58C /* DDTTYLogger.m */,
- DC987C1D119292940020FF52 /* DDFileLogger.h */,
- DC987C1E119292940020FF52 /* DDFileLogger.m */,
+ DC25B7BE146B2E62000F32F4 /* DDLog.h */,
+ DC25B7BF146B2E62000F32F4 /* DDLog.m */,
+ DC25B7BA146B2E62000F32F4 /* DDASLLogger.h */,
+ DC25B7BB146B2E62000F32F4 /* DDASLLogger.m */,
+ DC25B7C0146B2E62000F32F4 /* DDTTYLogger.h */,
+ DC25B7C1146B2E62000F32F4 /* DDTTYLogger.m */,
+ DC25B7BC146B2E62000F32F4 /* DDFileLogger.h */,
+ DC25B7BD146B2E62000F32F4 /* DDFileLogger.m */,
+ DC25B7B8146B2E62000F32F4 /* DDAbstractDatabaseLogger.h */,
+ DC25B7B9146B2E62000F32F4 /* DDAbstractDatabaseLogger.m */,
+ DC25B7C2146B2E62000F32F4 /* Extensions */,
);
name = Logging;
sourceTree = "<group>";
@@ -227,6 +254,7 @@
files = (
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
+ DC25B7CF146B2E62000F32F4 /* README.txt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -239,14 +267,17 @@
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
256AC3DA0F4B6AC300CF3369 /* BenchmarkMacAppDelegate.m in Sources */,
- DC987C24119292940020FF52 /* DDFileLogger.m in Sources */,
- DC987C25119292940020FF52 /* DDLog.m in Sources */,
DC987C30119292B20020FF52 /* BaseNSLogging.m in Sources */,
DC987C31119292B20020FF52 /* DynamicLogging.m in Sources */,
DC987C32119292B20020FF52 /* PerformanceTesting.m in Sources */,
DC987C33119292B20020FF52 /* StaticLogging.m in Sources */,
- DC624CE1120112520011E58C /* DDASLLogger.m in Sources */,
- DC624D011201399A0011E58C /* DDTTYLogger.m in Sources */,
+ DC25B7C8146B2E62000F32F4 /* DDAbstractDatabaseLogger.m in Sources */,
+ DC25B7C9146B2E62000F32F4 /* DDASLLogger.m in Sources */,
+ DC25B7CA146B2E62000F32F4 /* DDFileLogger.m in Sources */,
+ DC25B7CB146B2E62000F32F4 /* DDLog.m in Sources */,
+ DC25B7CC146B2E62000F32F4 /* DDTTYLogger.m in Sources */,
+ DC25B7CD146B2E62000F32F4 /* ContextFilterLogFormatter.m in Sources */,
+ DC25B7CE146B2E62000F32F4 /* DispatchQueueLogFormatter.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -276,12 +307,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = BenchmarkMac_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "BenchmarkMac-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = BenchmarkMac;
@@ -292,10 +325,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = BenchmarkMac_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "BenchmarkMac-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = BenchmarkMac;
@@ -309,6 +344,7 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
@@ -321,6 +357,7 @@
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = macosx;
};
4 Xcode/BenchmarkMac/BenchmarkMacAppDelegate.h
View
@@ -2,9 +2,9 @@
@interface BenchmarkMacAppDelegate : NSObject <NSApplicationDelegate> {
- NSWindow *window;
+ NSWindow *__unsafe_unretained window;
}
-@property (assign) IBOutlet NSWindow *window;
+@property (unsafe_unretained) IBOutlet NSWindow *window;
@end
10 Xcode/ContextFilter/ContextFilter.xcodeproj/project.pbxproj
View
@@ -253,6 +253,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
@@ -260,6 +261,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ContextFilter_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "ContextFilter-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = ContextFilter;
@@ -270,10 +272,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ContextFilter_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "ContextFilter-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = ContextFilter;
@@ -284,13 +288,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CLANG_WARN_OBJCPP_ARC_ABI = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -298,11 +303,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CLANG_WARN_OBJCPP_ARC_ABI = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Release;
};
4 Xcode/ContextFilter/ContextFilterAppDelegate.h
View
@@ -9,9 +9,9 @@
#import <Cocoa/Cocoa.h>
@interface ContextFilterAppDelegate : NSObject <NSApplicationDelegate> {
- NSWindow *window;
+ NSWindow *__unsafe_unretained window;
}
-@property (assign) IBOutlet NSWindow *window;
+@property (unsafe_unretained) IBOutlet NSWindow *window;
@end
2  Xcode/ContextFilter/ContextFilterAppDelegate.m
View
@@ -44,7 +44,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
// If we want to filter log messages from the third party framework, we can do this:
- MyContextFilter *filter = [[[MyContextFilter alloc] init] autorelease];
+ MyContextFilter *filter = [[MyContextFilter alloc] init];
[[DDTTYLogger sharedInstance] setLogFormatter:filter];
6 Xcode/CoreDataLogger/CoreDataLogger.xcodeproj/project.pbxproj
View
@@ -171,6 +171,9 @@
/* Begin PBXProject section */
DCE86C001343C419004FD85F /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
buildConfigurationList = DCE86C031343C419004FD85F /* Build configuration list for PBXProject "CoreDataLogger" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
@@ -283,6 +286,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -298,6 +302,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -328,6 +333,7 @@
DCE86C2C1343C41A004FD85F /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
4 Xcode/CoreDataLogger/CoreDataLogger/CoreDataLogger.h
View
@@ -26,8 +26,8 @@
* The managedObjectContext in use by this instance is only to be used on it's private dispatch_queue.
* You must create your own managedObjectContext for your own use.
**/
-@property (readonly) NSManagedObjectModel *managedObjectModel;
-@property (readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
+@property (strong, readonly) NSManagedObjectModel *managedObjectModel;
+@property (strong, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
/**
* Clears the log by removing the persistentStore from the persistentStoreCoordinator,
79 Xcode/CoreDataLogger/CoreDataLogger/CoreDataLogger.m
View
@@ -24,17 +24,6 @@ - (id)initWithLogDirectory:(NSString *)aLogDirectory
return self;
}
-- (void)dealloc
-{
- [logDirectory release];
-
- [logEntryEntity release];
- [managedObjectContext release];
- [persistentStoreCoordinator release];
- [managedObjectModel release];
-
- [super dealloc];
-}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Private API
@@ -51,7 +40,6 @@ - (void)validateLogDirectory
{
NSLog(@"%@: %@ - logDirectory(%@) is a file!", [self class], THIS_METHOD, logDirectory);
- [logDirectory release];
logDirectory = nil;
}
}
@@ -68,7 +56,6 @@ - (void)validateLogDirectory
NSLog(@"%@: %@ - Unable to create logDirectory(%@) due to error: %@",
[self class], THIS_METHOD, logDirectory, error);
- [logDirectory release];
logDirectory = nil;
}
}
@@ -145,7 +132,6 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
NSLog(@"%@: %@ - Error creating persistent store: %@", [self class], THIS_FILE, error);
- [persistentStoreCoordinator release];
persistentStoreCoordinator = nil;
}
@@ -166,8 +152,8 @@ - (void)createManagedObjectContext
if (logEntryEntity == nil)
{
- logEntryEntity = [[NSEntityDescription entityForName:@"LogEntry"
- inManagedObjectContext:managedObjectContext] retain];
+ logEntryEntity = [NSEntityDescription entityForName:@"LogEntry"
+ inManagedObjectContext:managedObjectContext];
}
}
}
@@ -185,38 +171,38 @@ - (void)clearLog
return;
}
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- NSError *error = nil;
-
- [managedObjectContext reset];
- [persistentStoreCoordinator lock];
+ @autoreleasepool {
- NSPersistentStore *store = [[persistentStoreCoordinator persistentStores] lastObject];
-
- if (![persistentStoreCoordinator removePersistentStore:store error:&error])
- {
- NSLog(@"%@: %@ - Error removing persistent store: %@", [self class], THIS_METHOD, error);
- }
-
- NSString *logFilePath = [self logFilePath];
-
- if ([[NSFileManager defaultManager] fileExistsAtPath:logFilePath])
- {
- if (![[NSFileManager defaultManager] removeItemAtPath:logFilePath error:&error])
+ NSError *error = nil;
+
+ [managedObjectContext reset];
+ [persistentStoreCoordinator lock];
+
+ NSPersistentStore *store = [[persistentStoreCoordinator persistentStores] lastObject];
+
+ if (![persistentStoreCoordinator removePersistentStore:store error:&error])
{
- NSLog(@"%@: %@ - Error deleting log file: %@", [self class], THIS_METHOD, error);
+ NSLog(@"%@: %@ - Error removing persistent store: %@", [self class], THIS_METHOD, error);
+ }
+
+ NSString *logFilePath = [self logFilePath];
+
+ if ([[NSFileManager defaultManager] fileExistsAtPath:logFilePath])
+ {
+ if (![[NSFileManager defaultManager] removeItemAtPath:logFilePath error:&error])
+ {
+ NSLog(@"%@: %@ - Error deleting log file: %@", [self class], THIS_METHOD, error);
+ }
}
- }
+
+ if (![self addPersistentStore:&error])
+ {
+ NSLog(@"%@: %@ - Error creating persistent store: %@", [self class], THIS_FILE, error);
+ }
+
+ [persistentStoreCoordinator unlock];
- if (![self addPersistentStore:&error])
- {
- NSLog(@"%@: %@ - Error creating persistent store: %@", [self class], THIS_FILE, error);
}
-
- [persistentStoreCoordinator unlock];
-
- [pool drain];
};
if (dispatch_get_current_queue() == loggerQueue)
@@ -236,15 +222,14 @@ - (BOOL)db_log:(DDLogMessage *)logMessage
return NO;
}
- LogEntry *logEntry = [[NSManagedObject alloc] initWithEntity:logEntryEntity
- insertIntoManagedObjectContext:managedObjectContext];
+ LogEntry *logEntry = (LogEntry *)[[NSManagedObject alloc] initWithEntity:logEntryEntity
+ insertIntoManagedObjectContext:managedObjectContext];
logEntry.context = [NSNumber numberWithInt:logMessage->logContext];
logEntry.level = [NSNumber numberWithInt:logMessage->logFlag];
logEntry.message = logMessage->logMsg;
logEntry.timestamp = logMessage->timestamp;
- [logEntry release];
return YES;
}
@@ -285,7 +270,7 @@ - (void)deleteOldLogEntries:(BOOL)shouldSaveWhenDone
NSUInteger batchSize = (saveThreshold > 0) ? saveThreshold : 500;
NSUInteger count = 0;
- NSFetchRequest *fetchRequest = [[[NSFetchRequest alloc] init] autorelease];
+ NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:entity];
[fetchRequest setFetchBatchSize:batchSize];
[fetchRequest setPredicate:predicate];
4 Xcode/CoreDataLogger/CoreDataLogger/CoreDataLoggerAppDelegate.h
View
@@ -6,9 +6,9 @@
@interface CoreDataLoggerAppDelegate : NSObject <NSApplicationDelegate> {
@private
CoreDataLogger *coreDataLogger;
- NSWindow *window;
+ NSWindow *__unsafe_unretained window;
}
-@property (assign) IBOutlet NSWindow *window;
+@property (unsafe_unretained) IBOutlet NSWindow *window;
@end
8 Xcode/CoreDataLogger/CoreDataLogger/LogEntry.h
View
@@ -4,9 +4,9 @@
@interface LogEntry : NSManagedObject
-@property (nonatomic, retain) NSNumber * context;
-@property (nonatomic, retain) NSNumber * level;
-@property (nonatomic, retain) NSString * message;
-@property (nonatomic, retain) NSDate * timestamp;
+@property (nonatomic, strong) NSNumber * context;
+@property (nonatomic, strong) NSNumber * level;
+@property (nonatomic, strong) NSString * message;
+@property (nonatomic, strong) NSDate * timestamp;
@end
18 Xcode/CustomFormatters/CustomFormatters.xcodeproj/project.pbxproj
View
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -175,8 +175,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CustomFormatters" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -247,13 +250,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = CustomFormatters_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "CustomFormatters-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = CustomFormatters;
@@ -264,10 +268,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = CustomFormatters_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "CustomFormatters-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = CustomFormatters;
@@ -283,8 +289,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -295,8 +300,7 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Release;
};
4 Xcode/CustomFormatters/CustomFormattersAppDelegate.h
View
@@ -2,9 +2,9 @@
@interface CustomFormattersAppDelegate : NSObject <NSApplicationDelegate> {
- NSWindow *window;
+ NSWindow *__unsafe_unretained window;
}
-@property (assign) IBOutlet NSWindow *window;
+@property (unsafe_unretained) IBOutlet NSWindow *window;
@end
2  Xcode/CustomFormatters/CustomFormattersAppDelegate.m
View
@@ -17,7 +17,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Setup logging (with our custom formatter)
- TestFormatter *formatter = [[[TestFormatter alloc] init] autorelease];
+ TestFormatter *formatter = [[TestFormatter alloc] init];
[[DDASLLogger sharedInstance] setLogFormatter:formatter];
[[DDTTYLogger sharedInstance] setLogFormatter:formatter];
18 Xcode/CustomLogLevels/CustomLogLevels.xcodeproj/project.pbxproj
View
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -172,8 +172,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CustomLogLevels" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -243,13 +246,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = CustomLogLevels_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "CustomLogLevels-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = CustomLogLevels;
@@ -260,10 +264,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = CustomLogLevels_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "CustomLogLevels-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = CustomLogLevels;
@@ -279,8 +285,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -291,8 +296,7 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Release;
};
4 Xcode/CustomLogLevels/CustomLogLevelsAppDelegate.h
View
@@ -2,9 +2,9 @@
@interface CustomLogLevelsAppDelegate : NSObject <NSApplicationDelegate> {
- NSWindow *window;
+ NSWindow *__unsafe_unretained window;
}
-@property (assign) IBOutlet NSWindow *window;
+@property (unsafe_unretained) IBOutlet NSWindow *window;
@end
16 Xcode/CustomLogLevels/MYLog.h
View
@@ -29,15 +29,15 @@
#undef LOG_INFO
#undef LOG_VERBOSE
-#undef DDLogError(frmt, ...)
-#undef DDLogWarn(frmt, ...)
-#undef DDLogInfo(frmt, ...)
-#undef DDLogVerbose(frmt, ...)
+#undef DDLogError
+#undef DDLogWarn
+#undef DDLogInfo
+#undef DDLogVerbose
-#undef DDLogCError(frmt, ...)
-#undef DDLogCWarn(frmt, ...)
-#undef DDLogCInfo(frmt, ...)
-#undef DDLogCVerbose(frmt, ...)
+#undef DDLogCError
+#undef DDLogCWarn
+#undef DDLogCInfo
+#undef DDLogCVerbose
// Now define everything how we want it
3  Xcode/DispatchQueueLogger/DispatchQueueLogger.xcodeproj/project.pbxproj
View
@@ -311,6 +311,7 @@
DC25B785146A0295000F32F4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "DispatchQueueLogger/DispatchQueueLogger-Prefix.pch";
INFOPLIST_FILE = "DispatchQueueLogger/DispatchQueueLogger-Info.plist";
@@ -322,6 +323,7 @@
DC25B786146A0295000F32F4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "DispatchQueueLogger/DispatchQueueLogger-Prefix.pch";
INFOPLIST_FILE = "DispatchQueueLogger/DispatchQueueLogger-Info.plist";
@@ -349,6 +351,7 @@
DC25B786146A0295000F32F4 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
2  Xcode/DispatchQueueLogger/DispatchQueueLogger/AppDelegate.h
View
@@ -10,6 +10,6 @@
@interface AppDelegate : NSObject <NSApplicationDelegate>
-@property (assign) IBOutlet NSWindow *window;
+@property (unsafe_unretained) IBOutlet NSWindow *window;
@end
2  Xcode/DispatchQueueLogger/DispatchQueueLogger/AppDelegate.m
View
@@ -22,7 +22,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Log statements *AFTER* DispatchQueueLogFormatter
- DispatchQueueLogFormatter *formatter = [[[DispatchQueueLogFormatter alloc] init] autorelease];
+ DispatchQueueLogFormatter *formatter = [[DispatchQueueLogFormatter alloc] init];
formatter.queueLength = 17;
formatter.rightAlign = NO;
18 Xcode/FineGrainedLogging/FineGrainedLogging.xcodeproj/project.pbxproj
View
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -182,8 +182,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FineGrainedLogging" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -255,13 +258,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = FineGrainedLogging_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "FineGrainedLogging-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = FineGrainedLogging;
@@ -272,10 +276,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = FineGrainedLogging_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "FineGrainedLogging-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = FineGrainedLogging;
@@ -291,8 +297,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -303,8 +308,7 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
};
name = Release;
};