wordpress-mobile/WordPress-iOS — pull request #2848 by jleandroperez (2014-11-26 12:06:57+00:00)
Title: Issue/2587 fixes double separator line

Fixes #2587

#### Description:

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).

#### Reproducing the Bug:

The original bug can be reproduced pretty consistently, by means of 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];
```

In this snippet, we simply nuke the latest 20 notifications, and force Simperium to reindex the notifications bucket. I'm pasting this, here, just in case it's needed, for whatever reason, in the future.

Note: This should be executed before the Simperium authentication call.

/cc @sendhil (Thanks in advance!)