0

こんにちは、テーブル内の名前が名前テキスト フィールドと等しいテーブルからパスワードを選択したいのですが、「UIView タイプのオブジェクトにプロパティ テキストが見つかりません」というエラーが表示されます。

NSString *queryUser = [NSString stringWithFormat:@"SELECT Password from Customer_tbl WHERE name=\"%@\"",txtEmail.text];

.h

   #import <UIKit/UIKit.h>
#import "/usr/include/sqlite3.h"


@interface LoginViewController : UIViewController

{
  NSString *databasePath;


  sqlite3 *customerDB;

}




@property (weak, nonatomic) IBOutlet UIView *txtEmail;
@property (weak, nonatomic) IBOutlet UIView *txtPassword;
@property (weak, nonatomic) IBOutlet UIButton  *btnLogin;
@property (weak, nonatomic) IBOutlet UILabel *lblStatus;
@property (weak, nonatomic) IBOutlet UITextView *txtView;


- (IBAction)backGroundTouched:(id)sender;
- (IBAction)textFieldReturn:(id)sender;

-(IBAction)findUser;

    //.m

#import "LoginViewController.h"

@implementation LoginViewController
@synthesize txtEmail;
@synthesize txtPassword;
@synthesize btnLogin;
@synthesize lblStatus;
@synthesize txtView;

-(void) findUser
{

  const char *dbPath = [databasePath UTF8String];
  sqlite3_stmt *statement;

  if(sqlite3_open(dbPath, &customerDB)== SQLITE_OK)
  {
    NSString *queryUser = [NSString stringWithFormat:@"SELECT Password from Customer_tbl WHERE name=\"%@\"",txtEmail];

    const char *query_stmt = [queryUser UTF8String];

    if (sqlite3_prepare_v2(customerDB, query_stmt, -1, &statement, NULL)== SQLITE_OK) {
      if (sqlite3_step(statement)== SQLITE_ROW) {
        NSString *name = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statement,0)];
        txtView.text = name;
      }
    }
  }


}
4

1 に答える 1

0

あなたが定義した

@property (weak, nonatomic) IBOutlet UIView *txtEmail;
@property (weak, nonatomic) IBOutlet UIView *txtPassword;

私が(あなたの説明から)そうあるべきだと思うとき

@property (weak, nonatomic) IBOutlet UITextField *txtEmail;
@property (weak, nonatomic) IBOutlet UITextField *txtPassword;
于 2012-11-25T17:12:42.127 に答える