我有4個Xcode項目(GPS,加速計,指南針和MySQL)。Xcode需要幫助合併GPS項目,加速度計項目,指南針項目和MySQL項目
他們每個人都單獨編譯好,工作正常。
我想將它們全部合併到一個項目中,以便我可以將GPS,加速度計和指南針信息發送到mySQL數據庫。
我試圖將.h
和.m
以及項目所需的框架複製到另一個。
主要問題出現在這裏:
- (IBAction)insert:(id)sender
{
// create string contains url address for php file, the file name is phpFile.php, it receives parameter :name
//NSString *strURL = [NSString stringWithFormat:@"http://localhost/phpFile.php?name=%@",txtName.text];
NSString *strURL = [NSString stringWithFormat:@"http://localhost/phpFile.php?name=%@",speedLabel.text]; ************< use of undefined identifier 'speedLabel'****
// to execute php code
NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
// to receive the returend value
NSString *strResult = [[[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding]autorelease];
NSLog(@"%@", strResult);
}
這裏是一個speedLabel包含結構:
@interface CoreLocationDemoViewController : UIViewController <CoreLocationControllerDelegate> {
CoreLocationController *CLController;
IBOutlet UILabel *speedLabel;
IBOutlet UILabel *latitudeLabel;
IBOutlet UILabel *longitudeLabel;
IBOutlet UILabel *altitudeLabel;
IBOutlet UILabel *timeLabel;
}
感謝您的幫助
請告訴我這個問題?或者你想讓我們爲你複製所有的MySQL代碼? – MCKapur
嗨,沒有我有的問題是我無法訪問speedLabel變量:NSString * strURL = [NSString stringWithFormat:@「http://localhost/phpFile.php?speedLabel =%@」,speedLabel.text];當我嘗試在我的代碼中,我有一個錯誤,說使用未定義的標識speedLabel。謝謝Regisma – user1961175