I have the following code:
UIFontDescriptor *fd = [UIFont fontWithDescriptor:[[UIFont systemFontOfSize:[UIFont systemFontSize]].fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold|UIFontDescriptorTraitItalic];
But it gives me the error "Expected expression". What does that mean?
Initially, I counted 4 open brackets and 3 close brackets, which will cause an error. Additionally, fontWithDescriptor:
should be fontWithDescriptor:size:
, which is probably the expected expression.
Finally, using fontWithDescriptor:size:
to define a font, then asking for its descriptor is redundant, so a cleaner version of the command is this:
UIFontDescriptor *fd = [[[UIFont systemFontOfSize:[UIFont systemFontSize]] fontDescriptor] fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold|UIFontDescriptorTraitItalic];