0

我在使用带有情节提要的 XCode4 的 iPad 应用程序上遇到此构建错误:

架构 i386 的未定义符号:“_OBJC_CLASS_$_SQLite”,引用自:EnterDataViewController.o 中的 objc-class-ref

我在应用程序中查看了我所知道的所有地方,进行了清理并重新构建了所有内容,但均无济于事。我看不出错误在说什么。

发生了什么,我该如何解决?

更新:这是来自 EnterDataVewController.m 的相关代码

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//--  set First Responder
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- (BOOL) textFieldShouldReturn:(UITextField *)textField  {

    //  for site data...
    if(textField == txtSiteID)  {
        [txtSTA becomeFirstResponder];
        return true;
    }

    if(textField == txtSTA)  {
        [txtElev becomeFirstResponder];
        return true;
    }

    if(textField == txtElev)  {
        [txtSiteDesc becomeFirstResponder];
        return true;
    }

    if(txtSiteDesc.isFirstResponder)  { 
        SQLite *db = [[SQLite alloc] init];
        [db saveSiteData:(UITextField *) txtSiteID sta:(UITextField *) txtSTA desc:(UITextField *) txtSiteDesc elev: (UITextField *) txtElev ];
        [txtSiteDesc resignFirstResponder];
        return true;
    }

    //  for readings
    if(textField == txtSTA1)  {
        [txtBS becomeFirstResponder];
        return true;
    }

    if(textField == txtBS) {
        [txtFS becomeFirstResponder];
        return true;
    }

    if(textField == txtFS)  {
        [txtDesc becomeFirstResponder];
        return true;
    }

    //    if(textField.isFirstResponder) {  
    if(textField == txtDesc) {  
        SQLite *db = [[SQLite alloc] init];
        [db saveReadings:txtSiteID sta:txtSTA1 bs:txtBS fs:txtFS desc:txtDesc];
        [txtDesc resignFirstResponder];
        return true;
    }

    return YES;
}

//    //--  is this for txtDesc 
//    if(txtDesc.isFirstResponder)  {
//        [txtDesc resignFirstResponder];
//    }
//

NSString *databasePath;
NSString *docsDir;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//--  save the site data
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- (BOOL) saveSiteData  {


    //  validate all fields
    if(txtSiteID.text.length == 0 || txtSiteDesc.text.length == 0)  {
        [self Alert:@"Missing Site ID and/or Description" andData:@"Reqired fields"];
        return NO;
    }

    if(txtSTA.text.length == 0 || txtElev.text.length == 0)  {
        [self Alert:@"Missing Initial STA and/or Elevation" andData:@"Reqired fields"];        
        return NO;
    }

    //    txtSiteDesc.text = txtSiteDesc.text.re  <----------  remove single quotes  TODO

    //  update d/b
    SQLite *dbCode = [[SQLite alloc] init];  //  instantiate slSQLite
    [dbCode saveSiteData:txtSiteID sta:txtSTA desc:txtSiteDesc elev:txtElev];  //  save site data

    return YES;
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//--  save the readings
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- (void) saveReadings  {

    //  update d/b
    SQLite *dbCode = [[SQLite alloc] init];  //  instantiate slSQLite
    [dbCode saveReadings:txtSiteID sta:txtSTA1 bs:txtBS fs:txtFS desc:txtDesc];

    return;
}
4

2 回答 2

1

我发现了问题...... EnterDataVewController.m 的两 (2) 个实例位于同一项目的不同目录中。我不知道为什么会导致问题,但是当我删除第二个实例时,它的构建没有任何问题(正常除外)。

谢谢大家的建议。我很感激你的时间。

于 2012-04-14T13:38:10.663 回答
0

SQLite 是您自己的单独类吗...如果是,请导入它...如果不是,请尝试在其中导入 CoreData 框架

于 2012-04-13T15:11:24.493 回答