Permalink
Browse files

Removing some minor build warnings.

  • Loading branch information...
devinross committed Mar 6, 2013
1 parent 61a4706 commit 5eeb23ee1dda2ce3b517b45e91a45d1f2f334e10
@@ -359,7 +359,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0420;
+ LastUpgradeCheck = 0460;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Demo" */;
compatibilityVersion = "Xcode 3.2";
@@ -478,7 +478,6 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_OBJCPP_ARC_ABI = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -502,7 +501,6 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_OBJCPP_ARC_ABI = YES;
COPY_PHASE_STRIP = YES;
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -525,7 +523,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- CLANG_WARN_OBJCPP_ARC_ABI = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_VERSION = "";
@@ -545,7 +542,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- CLANG_WARN_OBJCPP_ARC_ABI = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_SYMBOL_SEPARATION = YES;
@@ -31,6 +31,7 @@
#import <Foundation/Foundation.h>
+/** Additional functionality for `NSObject`. */
@interface NSObject (TKCategory)
/** For subclassing, this method should return the item's properties mapped to the data dictionary keys.
@@ -49,7 +50,14 @@
*/
+ (NSDictionary*) dataKeys;
-+ (id) createObject:(NSDictionary*)data;
+
+/** Creates object and imports data from an `NSDictionary` objects using the map provided by the dataKeys dictionary.
+
+ @param dictionary The data that will be imported.
+ @returns The newly allocated object.
+
+ */
++ (id) createObject:(NSDictionary*)dictionary;
/** Imports data from an `NSDictionary` objects using the map provided by the dataKeys dictionary.
@@ -138,11 +138,12 @@ - (void) processJSONDataInBackground:(NSData *)data
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:data forKey:@"data"];
- [dict setObject:[NSNumber numberWithUnsignedInt:options] forKey:@"flags"];
+ dict[@"data"] = data;
+ dict[@"flags"] = @(options);
- if(callback) [dict setObject:NSStringFromSelector(callback) forKey:@"callback"];
- if(backgroundProcessor) [dict setObject:NSStringFromSelector(backgroundProcessor) forKey:@"backgroundProcessor"];
+
+ if(callback) dict[@"callback"] = NSStringFromSelector(callback);
+ if(backgroundProcessor) dict[@"backgroundProcessor"] = NSStringFromSelector(backgroundProcessor);
if(errroSelector) [dict setObject:NSStringFromSelector(errroSelector) forKey:@"errroSelector"];
@@ -156,20 +157,20 @@ - (void) _processJSONData:(NSDictionary*)dict{
@autoreleasepool {
NSError *error = nil;
- NSData *data = [dict objectForKey:@"data"];
- NSUInteger options = [[dict objectForKey:@"flags"] unsignedIntValue];
+ NSData *data = dict[@"data"];
+ NSUInteger options = [dict[@"flags"] unsignedIntValue];
- NSString *callback = [dict objectForKey:@"callback"];
- NSString *background = [dict objectForKey:@"backgroundProcessor"];
- NSString *eSelector = [dict objectForKey:@"errroSelector"];
+ NSString *callback = dict[@"callback"];
+ NSString *background = dict[@"backgroundProcessor"];
+ NSString *eSelector = dict[@"errroSelector"];
id object = [NSJSONSerialization JSONObjectWithData:data options:options error:&error];
- if(error){
- if(eSelector) [self performSelector:NSSelectorFromString(eSelector) withObject:error];
- }else{
+ if(error && eSelector){
+ [self performSelector:NSSelectorFromString(eSelector) withObject:error];
+ }else if(!error){
if(background) object = [self performSelector:NSSelectorFromString(background) withObject:object];
[self performSelectorOnMainThread:NSSelectorFromString(callback) withObject:object waitUntilDone:NO];
}
@@ -285,17 +285,17 @@ - (void) drawTileInRect:(CGRect)r day:(int)day mark:(BOOL)mark font:(UIFont*)f1
r.size.height -= 2;
[str drawInRect: r
withFont: f1
- lineBreakMode: UILineBreakModeWordWrap
- alignment: UITextAlignmentCenter];
+ lineBreakMode: NSLineBreakByWordWrapping
+ alignment: NSTextAlignmentCenter];
if(mark){
r.size.height = 10;
r.origin.y += 18;
[@"" drawInRect: r
withFont: f2
- lineBreakMode: UILineBreakModeWordWrap
- alignment: UITextAlignmentCenter];
+ lineBreakMode: NSLineBreakByWordWrapping
+ alignment: NSTextAlignmentCenter];
}
@@ -547,7 +547,7 @@ - (UILabel *) currentDay{
_currentDay.textColor = [UIColor whiteColor];
_currentDay.backgroundColor = [UIColor clearColor];
_currentDay.font = [UIFont boldSystemFontOfSize:dateFontSize];
- _currentDay.textAlignment = UITextAlignmentCenter;
+ _currentDay.textAlignment = NSTextAlignmentCenter;
_currentDay.shadowColor = [UIColor darkGrayColor];
_currentDay.shadowOffset = CGSizeMake(0, -1);
}
@@ -563,7 +563,7 @@ - (UILabel *) dot{
_dot.textColor = [UIColor whiteColor];
_dot.backgroundColor = [UIColor clearColor];
_dot.font = [UIFont boldSystemFontOfSize:dotFontSize];
- _dot.textAlignment = UITextAlignmentCenter;
+ _dot.textAlignment = NSTextAlignmentCenter;
_dot.shadowColor = [UIColor darkGrayColor];
_dot.shadowOffset = CGSizeMake(0, -1);
}
@@ -691,7 +691,7 @@ - (id) initWithSundayAsFirst:(BOOL)s{
}
label.text = s;
- label.textAlignment = UITextAlignmentCenter;
+ label.textAlignment = NSTextAlignmentCenter;
label.shadowColor = [UIColor whiteColor];
label.shadowOffset = CGSizeMake(0, 1);
label.font = [UIFont systemFontOfSize:11];
@@ -934,7 +934,7 @@ - (UIImageView *) topBackground{
- (UILabel *) monthYear{
if(_monthYear==nil){
_monthYear = [[UILabel alloc] initWithFrame:CGRectInset(CGRectMake(0, 0, self.tileBox.frame.size.width, 38), 40, 6)];
- _monthYear.textAlignment = UITextAlignmentCenter;
+ _monthYear.textAlignment = NSTextAlignmentCenter;
_monthYear.backgroundColor = [UIColor clearColor];
_monthYear.font = [UIFont boldSystemFontOfSize:22];
_monthYear.textColor = [UIColor colorWithRed:59/255. green:73/255. blue:88/255. alpha:1];
@@ -224,7 +224,7 @@ - (void) clearCachedImages{
for( NSString *file in files ) {
- if( file != @"." && file != @".." ) {
+ if( ![file isEqual:@"."] && ![file isEqual:@".."] ) {
NSString *path = [[self cacheDirectoryPath] stringByAppendingPathComponent:file];
[[NSFileManager defaultManager] removeItemAtPath:path error:&error];
@@ -248,7 +248,7 @@ - (void) removeCachedImagesFromDiskOlderThanTime:(NSTimeInterval)time{
NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:&error];
for( NSString *file in files ) {
- if( file != @"." && file != @".." ) {
+ if( ![file isEqual:@"."] && ![file isEqual:@".."] ) {
NSString *path = [path stringByAppendingPathComponent:file];
NSDate *created = [[[NSFileManager defaultManager] attributesOfItemAtPath:path error:NULL] fileCreationDate];
@@ -52,7 +52,7 @@ - (void) motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
- (void) motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event {
[[NSNotificationCenter defaultCenter] postNotificationName:TKWindowShakeCancelled object:self];
}
-- (void) motionEnded:withEvent:(UIEventSubtype)motion withEvent:(UIEvent *)event {
+- (void) motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
[[NSNotificationCenter defaultCenter] postNotificationName:TKWindowShakeEnded object:self];
}

0 comments on commit 5eeb23e

Please sign in to comment.