Fixing crash on notification style setting

pull/1/head
Frederic Jacobs 11 years ago
parent eb8c3e57ed
commit db74e17564

@ -76,6 +76,14 @@
#define _iOS_8_0 NSFoundationVersionNumber_iOS_8_0 #define _iOS_8_0 NSFoundationVersionNumber_iOS_8_0
#endif #endif
#ifndef NSFoundationVersionNumber_iOS_8_0_2
#define NSFoundationVersionNumber_iOS_8_0_2 1140.110000 //extracted with NSLog(@"%f", NSFoundationVersionNumber)
#endif
#ifdef NSFoundationVersionNumber_iOS_8_0_2
#define _iOS_8_0_2 NSFoundationVersionNumber_iOS_8_0_2
#endif
/** /**
Add a Singelton implementation to the .m File Add a Singelton implementation to the .m File

@ -294,7 +294,7 @@
return [NSString stringWithFormat:@"%@ : %@", name, message.body]; return [NSString stringWithFormat:@"%@ : %@", name, message.body];
break; break;
default: default:
DDLogWarn(@"Unexpected notification type %ld", setting); DDLogWarn(@"Unexpected notification type %u", setting);
break; break;
} }
} }

@ -18,14 +18,16 @@
@implementation NotificationPreviewViewController @implementation NotificationPreviewViewController
- (void)viewDidLoad { - (void)viewDidLoad
{
[super viewDidLoad]; [super viewDidLoad];
self.navigationItem.title = @"Notification Style"; self.navigationItem.title = @"Notification Style";
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
self.clearsSelectionOnViewWillAppear = NO; self.clearsSelectionOnViewWillAppear = NO;
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
} }
@ -39,11 +41,13 @@
#pragma mark - Table view data source #pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 4; return 4;
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1; return 1;
} }
@ -51,15 +55,14 @@
{ {
UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view; UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
[header.textLabel setTextColor:[UIColor blackColor]]; [header.textLabel setTextColor:[UIColor blackColor]];
if (SYSTEM_VERSION_GREATER_THAN(_iOS_8_0_2)) {
[header.textLabel setFont:[UIFont ows_thinFontWithSize:14.0f]]; [header.textLabel setFont:[UIFont ows_thinFontWithSize:14.0f]];
}
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if (_defaultSelectedIndexPath != nil && ![_defaultSelectedIndexPath isEqual:indexPath]) {
if (_defaultSelectedIndexPath != nil && ![_defaultSelectedIndexPath isEqual:indexPath])
{
[self deselectRowAtIndexPath:_defaultSelectedIndexPath]; [self deselectRowAtIndexPath:_defaultSelectedIndexPath];
_defaultSelectedIndexPath = nil; _defaultSelectedIndexPath = nil;
} }
@ -83,7 +86,6 @@
default: default:
break; break;
} }
} }
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
@ -113,6 +115,4 @@
[self.tableView.delegate tableView:self.tableView didDeselectRowAtIndexPath:indexPath]; [self.tableView.delegate tableView:self.tableView didDeselectRowAtIndexPath:indexPath];
} }
@end @end

Loading…
Cancel
Save