Skip to content
This repository was archived by the owner on May 8, 2020. It is now read-only.

Commit 3197c74

Browse files
committed
Fix warnings found in DCTKit project
1 parent dc188ab commit 3197c74

11 files changed

+46
-46
lines changed

Categories/UIColor+DCTHex.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@implementation UIColor (DCTHex)
1212

1313
+ (UIColor *)dct_colorWithHexString:(NSString *)string {
14-
return [self dct_colorWithHexString:string alpha:1.0];
14+
return [self dct_colorWithHexString:string alpha:1.0f];
1515
}
1616

1717
+ (UIColor *)dct_colorWithHexString:(NSString *)string alpha:(CGFloat)alpha {
@@ -24,14 +24,14 @@ + (UIColor *)dct_colorWithHexString:(NSString *)string alpha:(CGFloat)alpha {
2424
}
2525

2626
+ (UIColor *)dct_colorWithHexValue:(NSInteger)value {
27-
return [UIColor dct_colorWithHexValue:value alpha:1.0];
27+
return [UIColor dct_colorWithHexValue:value alpha:1.0f];
2828
}
2929

3030
+ (UIColor *)dct_colorWithHexValue:(NSInteger)value alpha:(CGFloat)alpha {
3131

32-
CGFloat red = ((CGFloat)((value & 0xFF0000) >> 16))/255.0;
33-
CGFloat green = ((CGFloat)((value & 0xFF00) >> 8))/255.0;
34-
CGFloat blue = ((CGFloat)(value & 0xFF))/255.0;
32+
CGFloat red = ((CGFloat)((value & 0xFF0000) >> 16))/255.0f;
33+
CGFloat green = ((CGFloat)((value & 0xFF00) >> 8))/255.0f;
34+
CGFloat blue = ((CGFloat)(value & 0xFF))/255.0f;
3535

3636
return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
3737
}

Categories/UIDevice+DCTSystemVersion.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3737
#import "UIDevice+DCTSystemVersion.h"
3838

3939
@interface UIDevice ()
40-
- (NSInteger)dctInternal_systemVersionComponentAtIndex:(NSInteger)index;
40+
- (NSInteger)dctInternal_systemVersionComponentAtIndex:(NSUInteger)theIndex;
4141
@end
4242

4343
@implementation UIDevice (DCTSystemVersion)
@@ -57,13 +57,13 @@ - (NSInteger)dct_maintenanceSystemVersion {
5757
#pragma mark -
5858
#pragma mark Internal
5959

60-
- (NSInteger)dctInternal_systemVersionComponentAtIndex:(NSInteger)index {
60+
- (NSInteger)dctInternal_systemVersionComponentAtIndex:(NSUInteger)theIndex {
6161

6262
NSArray *components = [self.systemVersion componentsSeparatedByString:@"."];
6363

64-
if ([components count] <= index) return -1;
64+
if ([components count] <= theIndex) return -1;
6565

66-
return [[components objectAtIndex:index] integerValue];
66+
return [[components objectAtIndex:theIndex] integerValue];
6767
}
6868

6969
@end

Core Data Based/DCTFetchedResultsTableViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ - (NSIndexPath *)fetchedResultsControllerIndexPathForTableViewIndexPath:(NSIndex
9494
return indexPath;
9595
}
9696

97-
- (NSUInteger)tableViewSectionIndexForFetchedResultsControllerSectionIndex:(NSUInteger)index {
98-
return index;
97+
- (NSUInteger)tableViewSectionIndexForFetchedResultsControllerSectionIndex:(NSUInteger)theIndex {
98+
return theIndex;
9999
}
100100

101-
- (NSUInteger)fetchedResultsControllerSectionIndexForTableViewSectionIndex:(NSUInteger)index {
102-
return index;
101+
- (NSUInteger)fetchedResultsControllerSectionIndexForTableViewSectionIndex:(NSUInteger)theIndex {
102+
return theIndex;
103103
}
104104

105105
#pragma mark -

Core Data Based/UIViewController+DCTCoreDataViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848

4949
- (void)dct_presentModalCoreDataViewController:(UIViewController<DCTCoreDataViewControllerProtocol> *)vc animated:(BOOL)animated;
5050

51-
@end
51+
@end

DCTTabBarController/DCTTabBar.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ - (void)drawRect:(CGRect)rect {
7272
CGFloat width = self.frame.size.width / [self.items count];
7373

7474
NSMutableArray *tempHitAreas = [[NSMutableArray alloc] init];
75-
CGFloat position = 0.0;
75+
CGFloat position = 0.0f;
7676
for (UITabBarItem *i in self.items) {
7777

7878
NSInteger intWidth = (NSInteger)width;
7979
NSInteger intPosition = (NSInteger)position;
8080

81-
UILabel *l = [[UILabel alloc] initWithFrame:CGRectMake((CGFloat)intPosition, 0.0, (CGFloat)intWidth, self.frame.size.height)];
81+
UILabel *l = [[UILabel alloc] initWithFrame:CGRectMake((CGFloat)intPosition, 0.0f, (CGFloat)intWidth, self.frame.size.height)];
8282
l.text = i.title;
83-
l.font = [UIFont boldSystemFontOfSize:14.0];
83+
l.font = [UIFont boldSystemFontOfSize:14.0f];
8484
l.backgroundColor = self.backgroundColor;
8585

8686
if (i == self.selectedItem)
@@ -117,8 +117,8 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
117117
&& point.x <= (r.origin.x + r.size.width)
118118
&& point.y <= (r.origin.y + r.size.height)) {
119119

120-
NSInteger index = [self.itemHitAreas indexOfObject:v];
121-
self.selectedItem = [self.items objectAtIndex:index];
120+
NSInteger theIndex = [self.itemHitAreas indexOfObject:v];
121+
self.selectedItem = [self.items objectAtIndex:theIndex];
122122
[self.delegate dctTabBar:self didSelectItem:self.selectedItem];
123123
return;
124124
}

DCTTabBarController/DCTTabBarController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@
8686

8787
@interface UIViewController (DCTTabBarController)
8888
@property (nonatomic, readonly) DCTTabBarController *dctTabBarController;
89-
@end
89+
@end

DCTTabBarController/DCTTabBarController.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3838
#import "UIView+DCTSubviewExtensions.h"
3939
#import "UIResponder+DCTNextResponderExtensions.h"
4040

41-
NSInteger const DCTTabBarUnselectedIndex = -1;
41+
NSUInteger const DCTTabBarUnselectedIndex = -1;
4242

4343
@interface DCTTabBarController ()
4444
- (void)dctInternal_setUpTabBarItems;
@@ -189,7 +189,7 @@ - (void)setTabBar:(DCTTabBar *)aTabBar {
189189
}
190190

191191
- (DCTTabBar *)tabBar {
192-
if (!tabBar) self.tabBar = [[DCTTabBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)];
192+
if (!tabBar) self.tabBar = [[DCTTabBar alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 44.0f)];
193193
return tabBar;
194194
}
195195

@@ -213,7 +213,7 @@ - (void)dctInternal_setUpTabBarItems {
213213
}
214214

215215
- (void)dctInternal_sendDelegateMessageDidSelectViewController:(UIViewController *)vc {
216-
if ([self.delegate respondsToSelector:@selector(DCTTabBarController:didSelectViewController:)])
216+
if ([self.delegate respondsToSelector:@selector(dctTabBarController:didSelectViewController:)])
217217
[self.delegate dctTabBarController:self didSelectViewController:vc];
218218
}
219219

@@ -225,10 +225,10 @@ - (void)dctInternal_refreshNavigationControllerItems {
225225

226226
NSMutableArray *items = [nav.viewControllers mutableCopy];
227227

228-
NSInteger index = [items indexOfObject:self];
228+
NSInteger theIndex = [items indexOfObject:self];
229229

230-
[items removeObjectAtIndex:index];
231-
[items insertObject:self atIndex:index];
230+
[items removeObjectAtIndex:theIndex];
231+
[items insertObject:self atIndex:theIndex];
232232
nav.viewControllers = items;
233233
[items release];
234234
}

DCTTabBarController/DCTUITabBar.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ - (void)dealloc {
4949

5050
- (id)init {
5151

52-
if (!(self = [super initWithFrame:CGRectMake(0.0, 0.0, 320.0, 49.0)])) return nil;
52+
if (!(self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 49.0f)])) return nil;
5353

54-
UITabBar *tb = [[UITabBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 49.0)];
54+
UITabBar *tb = [[UITabBar alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 49.0f)];
5555
uiTabBar = [tb retain];
5656
uiTabBar.delegate = self;
5757

Section Controller/DCTTableViewSectionController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ - (void)checkButtonTapped:(UIButton *)sender event:(id)event {
104104
[UIView beginAnimations:@"some" context:nil];
105105
[UIView setAnimationDuration:0.33];
106106
CALayer *layer = sender.layer;
107-
layer.transform = CATransform3DMakeRotation(self.opened ? M_PI : 0.0, 0.0, 0.0, 1.0);
107+
layer.transform = CATransform3DMakeRotation(self.opened ? (CGFloat)M_PI : 0.0f, 0.0f, 0.0f, 1.0f);
108108
[UIView commitAnimations];
109109
}
110110

@@ -142,7 +142,7 @@ - (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexP
142142
cell.accessoryView = [self dctInternal_disclosureButton];
143143

144144
if (self.opened)
145-
cell.accessoryView.layer.transform = CATransform3DMakeRotation(self.opened ? M_PI : 0.0, 0.0, 0.0, 1.0);
145+
cell.accessoryView.layer.transform = CATransform3DMakeRotation(self.opened ? (CGFloat)M_PI : 0.0f, 0.0f, 0.0f, 1.0f);
146146
}
147147

148148
return cell;
@@ -155,7 +155,7 @@ - (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexP
155155
if (!cell) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
156156

157157
cell.indentationLevel = 1;
158-
cell.textLabel.font = [UIFont boldSystemFontOfSize:15.0];
158+
cell.textLabel.font = [UIFont boldSystemFontOfSize:15.0f];
159159

160160
NSManagedObject *mo = [self objectForTableViewIndexPath:indexPath];
161161

@@ -240,7 +240,7 @@ - (BOOL)dctInternal_indexPathIsTitleCell:(NSIndexPath *)indexPath {
240240
- (UIButton *)dctInternal_disclosureButton {
241241
UIImage *image = [UIImage imageNamed:@"DisclosureArrow.png"];
242242
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
243-
button.frame = CGRectMake(0.0, 0.0, image.size.width, image.size.height);
243+
button.frame = CGRectMake(0.0f, 0.0f, image.size.width, image.size.height);
244244
[button setBackgroundImage:image forState:UIControlStateNormal];
245245
[button addTarget:self action:@selector(checkButtonTapped:event:) forControlEvents:UIControlEventTouchUpInside];
246246
button.backgroundColor = [UIColor clearColor];

View Controllers/DCTContentViewController.m

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ - (UIView *)contentView {
206206

207207
- (UIView *)barView {
208208
if (!barView) [self loadBarView];
209-
if (!barView) barView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.bounds.size.width, 44.0)];
209+
if (!barView) barView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.view.bounds.size.width, 44.0f)];
210210
return barView;
211211
}
212212

@@ -226,10 +226,10 @@ - (void)setBarHidden:(BOOL)hidden animated:(BOOL)animated completion:(void (^)(B
226226

227227
if (self.position == DCTContentBarPositionNone) return;
228228

229-
NSTimeInterval time = 1.0 / 3.0;
230-
if (!animated) time = 0.0;
229+
NSTimeInterval timeInterval = 1.0 / 3.0;
230+
if (!animated) timeInterval = 0.0;
231231

232-
[UIView animateWithDuration:time animations:^{
232+
[UIView animateWithDuration:timeInterval animations:^{
233233

234234
self.barView.frame = [self dctInternal_barFrameForInterfaceOrientation:self.interfaceOrientation barHidden:hidden];
235235
self.contentView.frame = [self dctInternal_contentFrameForInterfaceOrientation:self.interfaceOrientation barHidden:hidden];
@@ -262,7 +262,7 @@ - (CGRect)dctInternal_barFrameForInterfaceOrientation:(UIInterfaceOrientation)or
262262
viewFrame.size.width = height;
263263
}
264264

265-
CGRect rect = CGRectMake(0.0, 0.0, barWidth, barHeight);
265+
CGRect rect = CGRectMake(0.0f, 0.0f, barWidth, barHeight);
266266

267267
if (self.position == DCTContentBarPositionBottom)
268268
rect.origin.y = viewFrame.size.height - barHeight;
@@ -276,13 +276,13 @@ - (CGRect)dctInternal_barFrameForInterfaceOrientation:(UIInterfaceOrientation)or
276276
rect.origin.y = viewFrame.size.height;
277277

278278
else if (self.position == DCTContentBarPositionTop)
279-
rect.origin.y = 0.0-barHeight;
279+
rect.origin.y = 0.0f - barHeight;
280280

281281
else if (self.position == DCTContentBarPositionRight)
282282
rect.origin.x = viewFrame.size.width;
283283

284284
else if (self.position == DCTContentBarPositionLeft)
285-
rect.origin.x = 0.0-barWidth;
285+
rect.origin.x = 0.0f - barWidth;
286286
}
287287

288288
return rect;
@@ -332,26 +332,26 @@ - (CGRect)contentFrame {
332332
if (!self.barView) return self.view.bounds;
333333

334334
if (self.position == DCTContentBarPositionBottom)
335-
return CGRectMake(0.0,
336-
0.0,
335+
return CGRectMake(0.0f,
336+
0.0f,
337337
self.view.frame.size.width,
338338
self.view.frame.size.height - self.barView.frame.size.height);
339339

340340
else if (self.position == DCTContentBarPositionTop)
341-
return CGRectMake(0.0,
341+
return CGRectMake(0.0f,
342342
self.barView.frame.size.height,
343343
self.view.frame.size.width,
344344
self.view.frame.size.height - self.barView.frame.size.height);
345345

346346
else if (self.position == DCTContentBarPositionRight)
347-
return CGRectMake(0.0,
348-
0.0,
347+
return CGRectMake(0.0f,
348+
0.0f,
349349
self.view.frame.size.width - self.barView.frame.size.width,
350350
self.view.frame.size.height);
351351

352352
else if (self.position == DCTContentBarPositionLeft)
353353
return CGRectMake(self.barView.frame.size.width,
354-
0.0,
354+
0.0f,
355355
self.view.frame.size.width - self.barView.frame.size.width,
356356
self.view.frame.size.height);
357357

View Controllers/DCTViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,4 @@ - (void)dctInternal_keyboardWillHide:(BOOL)hidden withNotification:(NSNotificati
200200

201201
}
202202

203-
@end
203+
@end

0 commit comments

Comments
 (0)