Cast integers as long

This commit is contained in:
Roman Efimov
2013-09-11 09:45:23 -05:00
parent 6e27b4dfa0
commit 5e95e40517
5 changed files with 12 additions and 12 deletions

View File

@@ -182,7 +182,7 @@ BOOL REDeviceIsUIKit7() {
if ([item isKindOfClass:[RETableViewItem class]])
cellStyle = ((RETableViewItem *)item).style;
NSString *cellIdentifier = [NSString stringWithFormat:@"RETableViewManager_%@_%li", [item class], cellStyle];
NSString *cellIdentifier = [NSString stringWithFormat:@"RETableViewManager_%@_%li", [item class], (long) cellStyle];
Class cellClass = [self classForCellAtIndexPath:indexPath];

View File

@@ -101,7 +101,7 @@
//
NSMutableArray *options = [[NSMutableArray alloc] init];
for (NSInteger i = 1; i < 40; i++)
[options addObject:[NSString stringWithFormat:@"Option %li", i]];
[options addObject:[NSString stringWithFormat:@"Option %li", (long) i]];
// Present options controller
//
@@ -132,7 +132,7 @@
//
NSMutableArray *options = [[NSMutableArray alloc] init];
for (NSInteger i = 1; i < 40; i++)
[options addObject:[NSString stringWithFormat:@"Option %li", i]];
[options addObject:[NSString stringWithFormat:@"Option %li", (long) i]];
// Present options controller
//

View File

@@ -42,7 +42,7 @@
[self.manager addSection:section];
for (NSInteger i = 1; i <= 5; i++) {
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 1, Item %li", i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 1, Item %li", (long) i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
item.editingStyle = UITableViewCellEditingStyleDelete;
item.deletionHandler = ^(RETableViewItem *item) {
NSLog(@"Item removed: %@", item.title);
@@ -56,7 +56,7 @@
[self.manager addSection:section];
for (NSInteger i = 1; i <= 5; i++) {
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 2, Item %li", i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 2, Item %li", (long) i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
item.editingStyle = UITableViewCellEditingStyleDelete;
item.deletionHandlerWithCompletion = ^(RETableViewItem *item, void (^completion)(void)) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Confirmation" message:[NSString stringWithFormat:@"Are you sure you want to delete %@", item.title] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Delete", nil];
@@ -76,12 +76,12 @@
[self.manager addSection:section];
for (NSInteger i = 1; i <= 5; i++) {
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 3, Item %li", i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 3, Item %li", (long) i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
item.moveHandler = ^BOOL(id item, NSIndexPath *sourceIndexPath, NSIndexPath *destinationIndexPath) {
return YES;
};
item.moveCompletionHandler = ^(RETableViewItem *item, NSIndexPath *sourceIndexPath, NSIndexPath *destinationIndexPath) {
NSLog(@"Moved item: %@ from [%li,%li] to [%li,%li]", item.title, sourceIndexPath.section, sourceIndexPath.row, destinationIndexPath.section, destinationIndexPath.row);
NSLog(@"Moved item: %@ from [%li,%li] to [%li,%li]", item.title, (long) sourceIndexPath.section, (long) sourceIndexPath.row, (long) destinationIndexPath.section, (long) destinationIndexPath.row);
};
[section addItem:item];
}
@@ -92,13 +92,13 @@
[self.manager addSection:section];
for (NSInteger i = 1; i <= 5; i++) {
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 4, Item %li", i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 4, Item %li", (long) i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
item.editingStyle = UITableViewCellEditingStyleDelete;
item.moveHandler = ^BOOL(id item, NSIndexPath *sourceIndexPath, NSIndexPath *destinationIndexPath) {
return YES;
};
item.moveCompletionHandler = ^(RETableViewItem *item, NSIndexPath *sourceIndexPath, NSIndexPath *destinationIndexPath) {
NSLog(@"Moved item: %@ from [%li,%li] to [%li,%li]", item.title, sourceIndexPath.section, sourceIndexPath.row, destinationIndexPath.section, destinationIndexPath.row);
NSLog(@"Moved item: %@ from [%li,%li] to [%li,%li]", item.title, (long) sourceIndexPath.section, (long) sourceIndexPath.row, (long) destinationIndexPath.section, (long) destinationIndexPath.row);
};
[section addItem:item];
}
@@ -109,7 +109,7 @@
[self.manager addSection:section];
for (NSInteger i = 1; i <= 5; i++) {
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 5, Item %li", i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
RETableViewItem *item = [RETableViewItem itemWithTitle:[NSString stringWithFormat:@"Section 5, Item %li", (long) i] accessoryType:UITableViewCellAccessoryNone selectionHandler:nil];
item.moveHandler = ^BOOL(id item, NSIndexPath *sourceIndexPath, NSIndexPath *destinationIndexPath) {
return (destinationIndexPath.section == section.index);
};

View File

@@ -37,7 +37,7 @@
// Add 5 items with name `section title + item index`
//
for (NSInteger i = 1; i <= 5; i++)
[section addItem:[NSString stringWithFormat:@"%@%li", sectionTitle, i]];
[section addItem:[NSString stringWithFormat:@"%@%li", sectionTitle, (long) i]];
[self.manager addSection:section];
}

View File

@@ -36,7 +36,7 @@
[self.manager addSection:section];
for (NSInteger i = 1; i < 100; i++) {
NSString *title = [NSString stringWithFormat:@"Item %li", i];
NSString *title = [NSString stringWithFormat:@"Item %li", (long) i];
XIBTestItem *item = [XIBTestItem itemWithTitle:title
accessoryType:UITableViewCellAccessoryNone
selectionHandler:^(RETableViewItem *item) {