To create an instance of NSMutableParagraphStyle having the default paragraph style, I tried
NSMutableParagraphStyle *mutableStyle = [NSMutableParagraphStyle defaultParagraphStyle]; [mutableStyle setAlignment:NSCenterTextAlignment];
The above snippet raises an exception: NSParagraphStyle does not have the selector -setAlignment:. WTH? It seems that +defaultParagraphStyle only returns an immutable version. The following
NSMutableParagraphStyle *mutableStyle = [[NSMutableParagraphStyle alloc] init]; [mutableStyle setStyle:[NSParagraphStyle defaultParagraphStyle]]; [mutableStyle setAlignment:NSCenterTextAlignment];
seems to work.