我正在尝试完成一个 iPhone 应用程序。为此,我需要将数据库从 MySQL 获取到 SQLite。对于这种情况,我确实使用了如下代码-
MCPConnection *theConnec;
MCPResult *theRes;
//initialize connection string vars
NSString *dbURL = @"XXXXXX";
NSString *userName = @"XXXXXX";
NSString *pass = @"XXXXXX";
//open connection to database
theConnec = [theConnec initToHost:dbURL withLogin:userName password:pass usingPort:3306];
//NSLog(@"The connection to database was successfull");
[theConnec selectDB:@"XXXXXX"];
//{
// NSLog(@"Database found");
//}
//else
//{
// NSLog(@"Database not found");
//}
theRes = [theConnec queryString:@"select * from seahawk_tag"];
//get the number of rows
NSInteger numberOfRows = [theRes numofRows];
NSLog(@"Query of MySQL Database %@", numberOfRows);
return NSApplicationMain(argc, (const char **) argv);
[theConnec release];
但是这段代码不能正常工作。这里还提到我使用了一些框架,如 cocoa.framework、cocos2d、openGLES.framework、openAL.framework、APPKit.framework、MCPKit.framework、Quartzcore.framewrok。最后我收到一个错误消息,表明 CIColer.h 丢失。
朋友,如果您知道解决方案或者您有其他代码,请帮助我