The `self.typingAttributes` will crash app in iOS6

The `self.typingAttributes` will crash app in iOS6, it should be a bug of iOS6. Since typingAttributes only available in editing mode, checking editing mode previously will fix the bug.