Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // self.array is an array with controllers of difrent classes.
  2. // self array is initialized from a plist of NSStrings which contain the name of classes.
  3. // if the class name is from 2 words i want to know how can i init the correct nib name?
  4. // in the classes and resouces if i chouce a name from 2 words it became: word1_word2.
  5. // how can i fix this?
  6.  
  7.  
  8. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  9. {
  10.     NSString *name = [self.array objectAtIndex: [indexPath row]];
  11.     id controller = [[NSClassFromString(name) alloc] initWithNibName: name bundle: nil];
  12.     [controller setTitle: name];
  13.     [self.navigationController pushViewController: controller animated:YES];
  14.     [controller release];
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement