wordpress-mobile/WordPress-iOS — pull request #1248 by astralbodies (2014-02-21 17:30:52+00:00)
Title: Corrected logic used to find a Blog based upon a stats notification

Fixes #1051

NSPredicate used to filter set of blogs was incorrect. The fact that Notes don't have an associated blog ID or something alike is making this logic very crappy. I'm not even sure this logic will work in other languages, especially ones that use different diacritics for quotations - «like these».

In any case, this matches the NSScanner logic used inside of `NewNotificationsTableViewCell` to find the blog name. The one downfall to this method is that Notes for stats for Jetpack blogs not set up on the device will still appear tappable but will not bring up the stats. An error message at some point would be useful but hopefully with the upcoming changes to Notes this will not be an issue. The query to find the blog by name is not cheap and would make the table stutter something fierce just to turn on & off the accessory.