Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>UPOATE - I have figured out.</p> <p>AlertViews.h</p> <pre><code>#import"ViewController.h" @interface AlertViews: NSobject { UIAlertView *addSomethingAlertView; UITextField *addSomethingTF; } @property (nonatomic, retain) UIAlertView *addSomethingAlertView; @property (nonatomic, strong) UITextField *addSomethingTF; -(void)InitializeAddSomethingAlertView; </code></pre> <p>AlertViews.m</p> <pre><code>@implementation @synthesize addSomethingAlertView = _addSomethingAlertView; @synthesize showSomethingAV = _showSomethingAV; @synthesize addSomething; -(void)initializeAddSomethingAlertView { addSomethingAlertView = [[UIAlertView alloc] initWithTitle:@"Something" message:@"something" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitle:@"OK", nil]; addsomethingAlertViewStyle = UIAlertViewStylePlainTextInput; [[addSomethingAlertView textFieldAtIndex:0] setDelegate: self]; [[addSomethingAlertView textFieldAtIndex:0] setKeyboardType: UIKeyboardTypeDecimalPad]; [[addSomethingAlertView textFieldAtIndex:0] becomeFirstResponder]; [addSomethingAlertView show]; } </code></pre> <p>ViewController.h</p> <pre><code>#import"AlertViews.h" @interface ViewController: UIViewController &lt;UIAlertViewDelegate&gt; { AlertViews *newAlert; UILabel *testLabel; } @property (nonatomic, retain) AlertViews *newAlert; @property (nonatomic, strong) UILabel *testLabel; @property (nonatomic, strong) NSString *passString; -(IBAction)adding:(id)sender; </code></pre> <p>ViewController.m</p> <pre><code>@implementation @synthesize newAlert = _newAlert; @synthesize showAlert = _showAlert; @synthesize testLabel; @synthesize passString; -(IBAction)adding:(id)sender { [self.newAlert = [[AlertViews alloc] init]; [self.newAlert initializeAddSomethingAlertView]; } -(IBAction)showing:(id)sender { [self.showAlert = [[AlertViews alloc] init]; [self.showAlert initializeshowSomethingAV]; @end </code></pre> <p>in AlertViews.m I added following code:</p> <pre><code> -(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex: (NSInteger)buttonIndex { if(addSomethingAlertView) { if(buttonIndex == 1) NSLog(@"testing success"); addSomething = [addSomethingAlertView textFieldAtIndex:0]; addSomething.text =[addSomethingAlertView textFieldAtIndex:0].text; ViewController * vc = [[MainScreenViewController alloc] init]; vc.passString = addSomething.text; NSLog(@"%@", grab); } </code></pre> <p>Then in ViewController.m add this:</p> <pre><code>-(void)viewWillAppear:(BOOL)animated { testLabel.text = passString; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload