Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Aug 6, 2013
2 parents 7a64aed + c8b7bd6 commit 5024a21
Show file tree
Hide file tree
Showing 27 changed files with 75 additions and 86 deletions.
3 changes: 2 additions & 1 deletion Core/DTFoundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@
#endif

// Utility Functions
#import "DTUtils.h"
#import "DTUtils.h"
#import "DTLog.h"
2 changes: 1 addition & 1 deletion Core/Source/DTASN1/DTASN1Parser.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ - (BOOL)_parseValueWithTag:(NSUInteger)tag dataRange:(NSRange)dataRange
{
if (!dataRange.length && tag != DTASN1TypeNull)
{
NSLog(@"Encountered zero length data for tag %ld", (unsigned long)tag);
DTLogError(@"Encountered zero length data for tag %ld", (unsigned long)tag);

// only NULL can have zero length
return NO;
Expand Down
3 changes: 0 additions & 3 deletions Core/Source/DTASN1/DTASN1Serialization.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ - (id)initWithData:(NSData *)data
{
self = [super init];

NSString *bas = [DTBase64Coding stringByEncodingData:data];
NSLog(@"%@", bas);

if (self)
{
DTASN1Parser *parser = [[DTASN1Parser alloc] initWithData:data];
Expand Down
6 changes: 3 additions & 3 deletions Core/Source/DTReachability/DTReachability.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ + (id)addReachabilityObserverWithBlock:(void(^)(SCNetworkConnectionFlags connect
{
if(!SCNetworkReachabilityScheduleWithRunLoop(_reachability, CFRunLoopGetMain(), kCFRunLoopCommonModes))
{
NSLog(@"Error: Could not schedule reachability");
DTLogError(@"Error: Could not schedule reachability");
SCNetworkReachabilitySetCallback(_reachability, NULL, NULL);
return nil;
}
Expand Down Expand Up @@ -76,11 +76,11 @@ + (void)removeReachabilityObserver:(id)observer

if (SCNetworkReachabilityUnscheduleFromRunLoop(_reachability, CFRunLoopGetMain(), kCFRunLoopCommonModes))
{
NSLog(@"Unscheduled reachability");
DTLogInfo(@"Unscheduled reachability");
}
else
{
NSLog(@"Error: Could not unschedule reachability");
DTLogError(@"Error: Could not unschedule reachability");
}

_reachability = nil;
Expand Down
2 changes: 1 addition & 1 deletion Core/Source/DTSQLite/DTSQLiteDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ - (NSArray *)fetchRowsForQuery:(NSString *)query error:(NSError **)error
return [tmpArray copy];
}

NSLog(@"ignored result");
DTLogError(@"ignored result");

return nil;
}
Expand Down
2 changes: 1 addition & 1 deletion Core/Source/DTSQLite/DTSQLiteFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void DTSQLiteEnumerateSQLStatementColumns(sqlite3_stmt *statement, DTSQLiteEnume

default:
{
NSLog(@"Type %d not implemented", columnType);
DTLogError(@"Type %d not implemented", columnType);
break;
}
}
Expand Down
15 changes: 8 additions & 7 deletions Core/Source/DTScripting/DTScriptExpression.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "DTScriptExpression.h"
#import "DTScriptVariable.h"
#import "NSScanner+DTScripting.h"
#import "DTLog.h"


@implementation DTScriptExpression
Expand Down Expand Up @@ -110,15 +111,15 @@ - (BOOL)_parseString:(NSString *)string

if (![scanner scanString:@"[" intoString:nil])
{
NSLog(@"No [ at position %d in string '%@'", (int)[scanner scanLocation], string);
DTLogError(@"No [ at position %d in string '%@'", (int)[scanner scanLocation], string);
return NO;
}

DTScriptVariable *receiver = nil;

if (![scanner scanScriptVariable:&receiver])
{
NSLog(@"No receiver at position %d in string '%@'", (int)[scanner scanLocation], string);
DTLogError(@"No receiver at position %d in string '%@'", (int)[scanner scanLocation], string);
return NO;
}

Expand All @@ -128,7 +129,7 @@ - (BOOL)_parseString:(NSString *)string
NSString *method = nil;
if (![scanner scanCharactersFromSet:[NSCharacterSet alphanumericCharacterSet] intoString:&method])
{
NSLog(@"No method name at position %d in string '%@'", (int)[scanner scanLocation], string);
DTLogError(@"No method name at position %d in string '%@'", (int)[scanner scanLocation], string);
return NO;
}

Expand All @@ -141,7 +142,7 @@ - (BOOL)_parseString:(NSString *)string
NSString *decider = nil;
if (![scanner scanCharactersFromSet:[NSCharacterSet characterSetWithCharactersInString:@":]"] intoString:&decider])
{
NSLog(@"No ] or : at position %d in string '%@'", (int)[scanner scanLocation], string);
DTLogError(@"No ] or : at position %d in string '%@'", (int)[scanner scanLocation], string);
return NO;
}

Expand Down Expand Up @@ -178,7 +179,7 @@ - (BOOL)_parseString:(NSString *)string

if (![scanner scanString:@":" intoString:nil])
{
NSLog(@"No : at position %d in string '%@'", (int)[scanner scanLocation], self);
DTLogError(@"No : at position %d in string '%@'", (int)[scanner scanLocation], self);
return NO;
}

Expand All @@ -192,13 +193,13 @@ - (BOOL)_parseString:(NSString *)string
}
else
{
NSLog(@"Illegal character in parameter at position %d in string '%@'", (int)[scanner scanLocation], string);
DTLogError(@"Illegal character in parameter at position %d in string '%@'", (int)[scanner scanLocation], string);
return NO;
}
}
else
{
NSLog(@"Illegal character in parameter at position %d in string '%@'", (int)[scanner scanLocation], string);
DTLogError(@"Illegal character in parameter at position %d in string '%@'", (int)[scanner scanLocation], string);
return NO;
}
}
Expand Down
5 changes: 3 additions & 2 deletions Core/Source/DTScripting/NSScanner+DTScripting.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "NSScanner+DTScripting.h"
#import "DTScriptVariable.h"
#import "DTLog.h"

@implementation NSScanner (DTScripting)

Expand Down Expand Up @@ -45,7 +46,7 @@ - (BOOL)scanScriptVariable:(DTScriptVariable **)variable
if (!part && !stringIsTerminated)
{
self.scanLocation = previousScanLocation;
NSLog(@"Unterminated string at position %d in string '%@'", (int)[self scanLocation], self.string);
DTLogError(@"Unterminated string at position %d in string '%@'", (int)[self scanLocation], self.string);
return NO;
}
}
Expand Down Expand Up @@ -82,7 +83,7 @@ - (BOOL)scanScriptVariable:(DTScriptVariable **)variable
else
{
self.scanLocation = previousScanLocation;
NSLog(@"Illegal character in parameter at position %d in string '%@'", (int)[self scanLocation], self.string);
DTLogError(@"Illegal character in parameter at position %d in string '%@'", (int)[self scanLocation], self.string);
return NO;
}
}
Expand Down
1 change: 0 additions & 1 deletion Core/Source/DTVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ + (DTVersion *)versionWithString:(NSString*)versionString
default:
break;
}
//NSLog(@"value for %d: %d", i, value);
}

if (major >= 0 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (void)presentModalPanelController:(NSWindowController *)panelController

if (windowController)
{
NSLog(@"Already presenting %@, cannot modally present another panel", NSStringFromClass([windowController class]));
DTLogError(@"Already presenting %@, cannot modally present another panel", NSStringFromClass([windowController class]));
return;
}

Expand All @@ -50,7 +50,7 @@ - (void)dismissModalPanelController

if (!windowController)
{
NSLog(@"%s called, but nothing to dismiss", (const char *)__PRETTY_FUNCTION__);
DTLogError(@"%s called, but nothing to dismiss", (const char *)__PRETTY_FUNCTION__);
return;
}

Expand Down
3 changes: 2 additions & 1 deletion Core/Source/iOS/DTSidePanel/DTSidePanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import "DTSidePanelController.h"
#import "UIView+DTFoundation.h"
#import "UIViewController+DTSidePanelController.h"
#import "DTLog.h"

@interface UIViewController () // private setter
- (void)setSidePanelController:(DTSidePanelController *)sidePanelController;
Expand Down Expand Up @@ -967,7 +968,7 @@ - (void)setWidth:(CGFloat)width forPanel:(DTSidePanelControllerPanel)panel anima

case DTSidePanelControllerPanelCenter:
{
NSLog(@"Setting width for center panel not supported");
DTLogError(@"Setting width for center panel not supported");
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion Core/Source/iOS/Debug/UIView+DTDebug.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

#import "UIView+DTDebug.h"
#import "NSObject+DTRuntime.h"
#import "DTLog.h"

@implementation UIView (DTDebug)

- (void)methodCalledNotFromMainThread:(NSString *)methodName
{
NSLog(@"-[%@ %@] being called on background queue. Break on -[UIView methodCalledNotFromMainThread:] to find out where", NSStringFromClass([self class]), methodName);
DTLogError(@"-[%@ %@] being called on background queue. Break on -[UIView methodCalledNotFromMainThread:] to find out where", NSStringFromClass([self class]), methodName);
}

- (void)_setNeedsLayout_MainThreadCheck
Expand Down
12 changes: 5 additions & 7 deletions Core/Source/iOS/Experimental/DTStripedLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ - (void)setBounds:(CGRect)bounds

[super setBounds:bounds];

NSLog(@"setbounds: %@ %@", NSStringFromCGRect(bounds), _tileDelegate);
DTLogDebug(@"setbounds: %@ %@", NSStringFromCGRect(bounds), _tileDelegate);

// store for frequent use
_contentSize = bounds.size;
Expand All @@ -77,7 +77,7 @@ - (void)setFrame:(CGRect)frame

[super setFrame:frame];

NSLog(@"setFrame: %@ %@", NSStringFromCGRect(frame), _tileDelegate);
DTLogDebug(@"setFrame: %@ %@", NSStringFromCGRect(frame), _tileDelegate);

// store for frequent use
_contentSize = frame.size;
Expand Down Expand Up @@ -197,7 +197,7 @@ - (void)layoutSublayers
}
else
{
NSLog(@"layer frame differs! %@ <-> %@", NSStringFromCGRect(oneSubLayer.frame), NSStringFromCGRect(tileFrame));
DTLogError(@"layer frame differs! %@ <-> %@", NSStringFromCGRect(oneSubLayer.frame), NSStringFromCGRect(tileFrame));

oneSubLayer.anchorPoint = CGPointZero;
oneSubLayer.bounds = tileFrame;
Expand Down Expand Up @@ -241,7 +241,7 @@ - (void)layoutSublayers
[self _enqueueDrawingForTile:cachedTile];
}

NSLog(@"cached %@", cachedTile);
DTLogDebug(@"cached %@", cachedTile);
}
else
{
Expand All @@ -266,7 +266,7 @@ - (void)layoutSublayers
newTile.borderColor = [UIColor redColor].CGColor;
newTile.borderWidth = 3;

NSLog(@"new %@", newTile);
DTLogDebug(@"new %@", newTile);

// cost in cache is number of pixels
[self.tileCache setObject:newTile forKey:tileKey cost:tileFrame.size.width * tileFrame.size.height];
Expand Down Expand Up @@ -367,8 +367,6 @@ - (void)setNeedsDisplayInRect:(CGRect)rect

- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
{
// NSLog(@"draw %@", layer);

[_tileDelegate drawLayer:layer inContext:ctx];

CGRect clipRect = CGContextGetClipBoundingBox(ctx);
Expand Down
11 changes: 6 additions & 5 deletions Core/Source/iOS/UIImage+DTFoundation.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "UIImage+DTFoundation.h"
#import "DTLog.h"

@implementation UIImage (DTFoundation)

Expand Down Expand Up @@ -43,12 +44,12 @@ + (UIImage *)imageWithContentsOfURL:(NSURL *)URL cachePolicy:(NSURLRequestCacheP
if (cacheResponse)
{
data = [cacheResponse data];
NSLog(@"cache hit");
DTLogDebug(@"cache hit for %@", [URL absoluteString]);
}
else {
NSLog(@"cache fail");
else
{
DTLogDebug(@"cache fail for %@", [URL absoluteString]);
}


NSURLResponse *response;
data = [NSURLConnection sendSynchronousRequest:request
Expand All @@ -57,7 +58,7 @@ + (UIImage *)imageWithContentsOfURL:(NSURL *)URL cachePolicy:(NSURLRequestCacheP

if (!data)
{
NSLog(@"Error loading image at %@", URL);
DTLogError(@"Error loading image at %@", URL);
return nil;
}

Expand Down
1 change: 1 addition & 0 deletions Demo/DTReachability/DTReachability-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "DTLog.h"
#endif
1 change: 1 addition & 0 deletions Demo/DTSidePanels/DTSidePanels-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "DTLog.h"
#endif
12 changes: 6 additions & 6 deletions Demo/DTSidePanels/Source/DemoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,38 @@ - (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

NSLog(@"%@ %s animated:%d", self, __PRETTY_FUNCTION__, animated);
DTLogInfo(@"%@ %s animated:%d", self, __PRETTY_FUNCTION__, animated);
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSLog(@"%@ %s animated:%d", self, __PRETTY_FUNCTION__, animated);
DTLogInfo(@"%@ %s animated:%d", self, __PRETTY_FUNCTION__, animated);
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];

NSLog(@"%@ %s animated:%d", self, __PRETTY_FUNCTION__, animated);
DTLogInfo(@"%@ %s animated:%d", self, __PRETTY_FUNCTION__, animated);
}

- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
NSLog(@"%@ %s animated:%d", self, __PRETTY_FUNCTION__, animated);
DTLogInfo(@"%@ %s animated:%d", self, __PRETTY_FUNCTION__, animated);
}

- (void)willMoveToParentViewController:(UIViewController *)parent
{
[super willMoveToParentViewController:parent];
NSLog(@"%@ %s", self, __PRETTY_FUNCTION__);
DTLogInfo(@"%@ %s", self, __PRETTY_FUNCTION__);
}

- (void)didMoveToParentViewController:(UIViewController *)parent
{
[super didMoveToParentViewController:parent];
NSLog(@"%@ %s", self, __PRETTY_FUNCTION__);
DTLogInfo(@"%@ %s", self, __PRETTY_FUNCTION__);
}

@end
Loading

0 comments on commit 5024a21

Please sign in to comment.