wordpress-mobile/WordPress-iOS — pull request #2845 by jleandroperez (2014-11-25 19:11:03+00:00)
Title: Issue/2587 fixes double separator line

Fixes #2587

This was a tricky bug to reproduce: i've noticed that i could trigger it after launching the app, and receiving a bunch of new notifications.

I've been digging all over, and this would seem to be an UITableView glitch, caused by row reload. In this PR, i've just implemented a simple mechanism to draw a custom cell bottom-separator (that won't be displayed for the last row of each section).

The original bug can be forced with the following snippet of code (*AKA violent and evil hack*):

```
NSString *sortKey = NSStringFromSelector(@selector(timestamp));
NSArray *descriptor = @[[NSSortDescriptor sortDescriptorWithKey:sortKey ascending:NO] ];
SPBucket *bucket = [self.simperium bucketForName:@"Notification"];
NSArray *sorted = [bucket.allObjects sortedArrayUsingDescriptors:descriptor];

NSInteger deletion = 20;
for (SPManagedObject *object in sorted) {
if (--deletion >= 0) {
[object.managedObjectContext deleteObject:object];
}
}

[self.simperium saveWithoutSyncing];
[bucket performSelector:@selector(setLastChangeSignature:) withObject:nil];
```

I'm pasting this, here, just in case it's needed, for whatever reason, in the future.