我在使用带有故事板的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;
}
答案 0 :(得分:1)
我发现了问题...在同一个项目中的单独目录中有两(2)个EnterDataVewController.m实例。我不知道为什么会导致这个问题,但是当我删除第二个实例时,它构建时没有任何问题(除了正常情况)。
谢谢大家的建议。我很感激你的时间。
答案 1 :(得分:0)
SQLite是你自己独立的类......如果是这样导入它......如果没有尝试在
中导入CoreData框架