I'm currently writing a database app via storyboards, and I'm right now I am in the stage of making it look fancy. I've added the font, Gotham.ttf
, to the app with Info.plist. And yes, I did copy the font file into the project.
Within my ViewController.m
I have the following code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Cell Configuration
NSManagedObject *device = [self.devices objectAtIndex:indexPath.row];
[cell.textLabel setText:[NSString stringWithFormat:@"%@ %@", [device valueForKey:@"name"], [device valueForKey:@"version"]]];
[cell.detailTextLabel setText:[device valueForKey:@"company"]];
cell.textLabel.font = [UIFont fontWithName:@"Gotham" size:20];
return cell;
}
Everything works fine in the code. I know this because if I change Gotham to "Arial" or "Tahoma", the fonts come out fine when I launch the app. But when I try to change the font of the label to "Gotham", it just reverts to the default font used for a cell. I have definitely implemented the font wrong, I'm just not sure where I have gone wrong.