2011-02-07 11 views
0

ログインウィンドウを表示し、ログインとパスワードを入力してクレデンシャルを入力するとアカウントが開きます。だから試しましたが、それは /81のようなエラーを表示します:エラー: 'didReceiveMemoryWarning'は宣言されていません * :81:エラー:予期した ';'前に '{' トークン * 100:エラー:入力iphone gmailのコード例

の最後に宣言または文が期待されると私は事前に

.hファイル

感謝を助けてくださいコードの下に投稿
#import <UIKit/UIKit.h> 

@interface Password1ViewController : UIViewController { 

UITextField *textfieldName; 
UITextField *textfieldPassword; 

} 
@property (nonatomic, retain) IBOutlet UITextField *textfieldName; 
@property (nonatomic, retain) IBOutlet UITextField *textfieldPassword; 

@end 

.mファイル

#import "Password1ViewController.h" 

@implementation Password1ViewController 

@synthesize textfieldName; 
@synthesize textfieldPassword; 

-(void)alertView:(UIAlertView *)alertview clickedButtonAtIndex:(NSInteger)buttonIndex 
{ 
    if (buttonIndex != [alertview cancelButtonIndex]) 
    { 

     NSLog(@"Name: %@", textfieldName.text); 
     NSlog(@"Name: %@", textfieldPassword.text); 
    } 
} 

-(void) someMethod 
{ 
    UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@"Please Login" message:@""           delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Submit",nil]; 

    [alert addTextFieldWithValue:@"" label:@"User Name"]; 
    [alert addTextFieldWithValue:@"" label:@"Password"]; 

    textfieldName = [alert textFieldAtIndex:0]; 
    textfieldName.keyboardType = UIKeyboardTypeAlphabet; 
    textfieldName.keyboardAppearance = UIKeyboardAppearanceAlert; 
    textfieldName.autocorrectionType = UITextAutocorrectionTypeNo; 

    textfieldPassword = [alert textFieldAtIndex:1]; 
    textfieldPassword.clearButtonMode = UITextFieldViewModeWhileEditing; 
    textfieldPassword.keyboardType = UIKeyboardTypeNumbersAndPunctuation; 
    textfieldPassword.keyboardAppearance = UIKeyboardAppearanceAlert; 
    textfieldPassword.autocorrectionType = UITextAutocorrectionTypeNo; 
    textfieldPassword.secureTextEntry = YES; 

    [alert show]; 
} 
/* 
// The designated initializer. Override to perform setup that is required before the view is loaded. 
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 
     // Custom initialization 
    } 
    return self; 
} 
*/ 

/* 
// Implement loadView to create a view hierarchy programmatically, without using a nib. 
- (void)loadView { 
} 
*/ 

/* 
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 
- (void)viewDidLoad { 
    [super viewDidLoad]; 
} 
*/ 

/* 
// Override to allow orientations other than the default portrait orientation. 
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationPortrait); 
} 
*/ 

- (void)didReceiveMemoryWarning { 
// Releases the view if it doesn't have a superview. 
    [super didReceiveMemoryWarning]; 

    // Release any cached data, images, etc that aren't in use. 
} 

- (void)viewDidUnload { 
    // Release any retained subviews of the main view. 
    // e.g. self.myOutlet = nil; 
} 

- (void)dealloc { 
    [textfieldName release]; 
    [textfieldPassword release]; 
    [super dealloc]; 
} 

@end 
+0

は、各コード行の前に4つのスペースを使用し、ループ内にコードを書き込む場合はさらに4つのスペースを使用します。下に書いている間は、いつでもコードのプレビューを見ることができます。 – Mahesh

答えて

1

編集で修正した閉じ括弧がありませんでした。ですから、編集したコードを試してみてください。

関連する問題