0

I have a storyboard with tableview. I have 4 cells in table. They have their identifiers. Problem is that I can't change font of cells programmatically. I've already add font to the project and added a new key in the array named "Fonts Provided by application" in the plist file. Maybe I need to reloadData but where I can do it? Under viewWillAppear it's useless

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *CellIdentifier = [self.menuItems objectAtIndex:indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

[cell.textLabel setFont:[UIFont fontWithName:@"Xiomara" size:30]];

return cell;
} 
lhawks
  • 43
  • 10

1 Answers1

0

Make sure that you're using right font name.

You can use this method.

- (void)logFontNamesOfAllFonts
{
    NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];

    NSArray *fontNames;
    NSInteger indFamily, indFont;
    for (indFamily=0; indFamily<[familyNames count]; ++indFamily) {
        NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
        fontNames = [[NSArray alloc] initWithArray:
                     [UIFont fontNamesForFamilyName:
                      [familyNames objectAtIndex:indFamily]]];
        for (indFont=0; indFont<[fontNames count]; ++indFont) {
            NSLog(@"    Font name: %@", [fontNames objectAtIndex:indFont]);
        }
    }
}

Just call in your AppDelegate.m's applicationDidFinishLaunching: method, and see in concole the right name of your font.
If there isn't font with name that you installed, then your font not installed correctly.

arturdev
  • 10,884
  • 2
  • 39
  • 67