What I am trying to do is click a button (that was created in code) and have it call up a different view controller then have it run a function in the new view controller.>
You can access the delegate like this:
MainClass *appDelegate = (MainClass *)[[UIApplication sharedApplication] delegate];
Replace MainClass with the name of your application class.
Then, provided you have a property for the other view controller, you can call something like:
[appDelegate.viewController someMethod];