傢伙真的很感激,如果有人在這裏可以幫助我很快,我有一個問題,我需要登錄到我的應用程序,然後自動重定向到下一個頁面,這就是真正意義是。重定向從登錄
預先感謝您
#import "ViewController.h"
@interface ViewController()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
credentialsDictionary = [[NSDictionary alloc] initWithObjects:[NSArray arrayWithObjects:@"password", @"1234", nil] forKeys:[NSArray arrayWithObjects:@"username",@"amit", nil]];
// Do any additional setup after loading the view, typically from a nib.
[_webview1 loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:@"http://nutriments.info/test1/test3.php"]]];
}
- (IBAction)dismiss:(id)sender {
[sender resignFirstResponder];
}
- (IBAction)dismiss1:(id)sender {
[sender resignFirstResponder];
}
- (IBAction)dismiss2:(id)sender {
[sender resignFirstResponder];
}
- (IBAction)dismiss3:(id)sender {
[sender resignFirstResponder];
}
- (IBAction)dismiss4:(id)sender {
[sender resignFirstResponder];
}
- (IBAction)enterCredentials {
if ([[credentialsDictionary objectForKey:usernameField.text]isEqualToString:passwordField.text]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Correct Password" message:@"This password is correct." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]
[alert show];
}
else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Incorrect Password" message:@"This password is incorrect." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[alert show];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)sendtoadmin:(id)sender {
MFMailComposeViewController *mailContoller = [[MFMailComposeViewController alloc]init];
[mailContoller setMailComposeDelegate:self];
NSString *email = @"******@hotmail.com";
NSArray *emailArray = [[NSArray alloc]initWithObjects:email, nil];
NSString *message = [@[_textview.text, _textview1.text, _textview2.text]componentsJoinedByString: @"\n"];
[mailContoller setMessageBody:message isHTML:NO];
[mailContoller setToRecipients:emailArray];
[mailContoller setSubject:@"Query"];
[self presentViewController:mailContoller animated:YES completion:nil];
}
-(void)touchesBegan4:(NSSet *)touches withEvent:(UIEvent *)event {
[[self textview] resignFirstResponder];
}
@end
我不明白的地方要被重定向? – user2277872
爲此,您需要從您的登錄服務/ API進行回調。我的代碼中看不到任何內容。 – AncAinu
爲什麼你有5個IBActions做同樣的事情?... – JMarsh