Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
UIAlertView in AppDelegate have to call Method in ViewController
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="poke" data-source="post: 1406475" data-attributes="member: 253282"><p>Hi, </p><p></p><p>i have a method called perform4 in the ViewController.m</p><p></p><p>[CODE]-(void) perform4</p><p>{</p><p> NSLog(@"perform4");</p><p> UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];</p><p>ViewController4 *view4 = (ViewController4 *) [mainStoryBoard instantiateViewControllerWithIdentifier:@"ViewController4"];</p><p></p><p>[self.view removeFromSuperview];</p><p>[self release];</p><p></p><p>self.view = view4.view;</p><p>[self release];</p><p>}[/CODE]</p><p></p><p>this Method has to be called from my AppDelegate.m with this AlertView Button</p><p></p><p>[code]</p><p>-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex</p><p>{</p><p> if(buttonIndex==0)</p><p>{</p><p> NSLog(@"Button 0");</p><p></p><p> </p><p> //EVERYTHING I WILL PUT HERE DO NOT WORK OR MAKE A CRASH :/</p><p> //like</p><p> // ViewController *view1 = [[ViewController alloc]init];</p><p> // [view1 perform4];</p><p> // WHY DO THIS DONT WORK? </p><p></p><p>}</p><p>[/code]</p><p></p><p>Thanks</p></blockquote><p></p>
[QUOTE="poke, post: 1406475, member: 253282"] Hi, i have a method called perform4 in the ViewController.m [CODE]-(void) perform4 { NSLog(@"perform4"); UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; ViewController4 *view4 = (ViewController4 *) [mainStoryBoard instantiateViewControllerWithIdentifier:@"ViewController4"]; [self.view removeFromSuperview]; [self release]; self.view = view4.view; [self release]; }[/CODE] this Method has to be called from my AppDelegate.m with this AlertView Button [code] -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex==0) { NSLog(@"Button 0"); //EVERYTHING I WILL PUT HERE DO NOT WORK OR MAKE A CRASH :/ //like // ViewController *view1 = [[ViewController alloc]init]; // [view1 perform4]; // WHY DO THIS DONT WORK? } [/code] Thanks [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
UIAlertView in AppDelegate have to call Method in ViewController
Top