我在使用带有情节提要的 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;
}