3

I've created an app with the preview version of Xcode 5 that loads items from a Core Data file and shows the title of the items in a UITableView. The app worked fine on the simulator and my device! Here is a snippet from the cellForRowAtIndexPath method:

NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:item.title];

[attributeString addAttribute:NSStrikethroughStyleAttributeName
                        value:[NSNumber numberWithInt:1]
                        range:(NSRange){0,[attributeString length]}];

cell.titleLabel.attributedText = attributeString;

Now I use the official Xcode 5 version from the App Store and my UITableView doesn't show the texts of the items in the cells (on simulator). But the items are loaded and I didn't change any code! - Beside the app works on my device...

So I changed the attributed text of the cell label to plain text:

cell.titleLabel.text = item.title;

Now it works and the title of the items is shown in the table view/cell text label.

Why doesn't it work with an NSMutableAttributedString is this a simulator bug?

4

0 回答 0