Я работаю над проектом с каркасной картой, и все это нормально, пока я не начну с push-уведомлений и не напишу @property bool push;
в своем AppDelegate.h. У меня есть это в моей AppDelegate.mОшибка Неопределенные символы для архитектуры x86_64:
(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
NSString *key =[[NSUserDefaults standardUserDefaults] stringForKey:@"token"];
if (key== nil || [key isEqual:@""])
{
_push=true;
NSString* token = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""] ;
NSLog(@"=== Device token: %@", token);
NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
[userdefault setObject:token forKey:@"token"];
NSString *jsonPostBody = [NSString stringWithFormat:@"{\"token\":"
"\"%@\""
",\"type\":"
"\"ios\""
"}",
[token stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSData *postData = [jsonPostBody dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
NSURL *url = [NSURL URLWithString:@"http://www.turismolapalmadelcondado.es/es/api/push_notifications"];
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:180.0];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:postData];
NSString* postDataLengthString = [[NSString alloc]initWithFormat: @"%d", [postData length]];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:postDataLengthString forHTTPHeaderField:@"Content-Length"];
NSURLResponse *response = nil;
NSError *error = nil;
NSData *data=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSHTTPURLResponse *httpResponse = response;
NSLog(@"response text: %@",[[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding]);
NSLog(@"response status code: %ld", (long)[httpResponse statusCode]);
}
}
Дело в том, что если я не определить толчок у меня есть ошибки в AppDelegate.m, но если я это делаю имеют 93 с той же ошибкой в рамках. У меня не было проблем раньше, и я почти пробовал все решения, которые я нашел здесь.
Undefined symbols for architecture x86_64: "BingMapsLayer::BingMapsLayer(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, TimeInterval const&, bool, int, int, float, LayerCondition const*, std::__1::vector >)", referenced from: G3MScenarioDEMDemoScene::rawActivate(G3MContext const) in G3MScenarioDEMDemoScene.o G3MVectorialDemoScene::rawActivate(G3MContext const*) in G3MVectorialDemoScene.o G3MPointCloudDemoScene::rawActivate(G3MContext const*) in G3MPointCloudDemoScene.o G3MAnimatedMarksDemoScene::rawActivate(G3MContext const*) in G3MAnimatedMarksDemoScene.o G3MStereoDemoScene::rawActivate(G3MContext const*) in G3MStereoDemoScene.o G3MVectorStreaming2DemoScene::rawActivate(G3MContext const*) in G3MVectorStreaming2DemoScene.o G3MStreamingPointCloud2DemoScene::rawActivate(G3MContext const*) in G3MStreamingPointCloud2DemoScene.o ... "GEOVectorLayer::GEOVectorLayer(int, int, int, int, float, LayerCondition const*, std::__1::vector >)", referenced from: G3MVectorialDemoScene::rawActivate(G3MContext const) in G3MVectorialDemoScene.o G3M3DSymbologyDemoScene::rawActivate(G3MContext const*) in G3M3DSymbologyDemoScene.o "Mark::Mark(std::__1::basic_string, std::__1::allocator > const&, URL const&, Geodetic3D const&, AltitudeMode, double, bool, float, Color const*, Color const*, int, MarkUserData*, bool, MarkTouchListener*, bool)", referenced from: G3MMarksDemoScene_BufferDownloadListener::onDownload(URL const&, IByteBuffer*, bool) in G3MMarksDemoScene.o "Layer::setTitle(std::__1::basic_string, std::__1::allocator > const&)", referenced from: -[ParkingViewController createLayerSet] in ParkingViewController.o G3MRasterLayersDemoScene::createLayerSet(LayerSet*) in G3MRasterLayersDemoScene.o "std::string::erase(__gnu_cxx::__normal_iterator, __gnu_cxx::__normal_iterator)", referenced from: StringUtils_iOS::ltrim(std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o) StringUtils_iOS::rtrim(std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o) "std::string::erase(unsigned long, unsigned long)", referenced from: StringUtils_iOS::replaceAll(std::string const&, std::string const&, std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o) "std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)", referenced from: StringBuilder_iOS::addBool(bool) in libG3MiOSSDK.a(G3MWidget_iOS.o) IntBuffer_iOS::description() const in libG3MiOSSDK.a(IntBuffer_iOS.o) FloatBuffer_iOS::description() const in libG3MiOSSDK.a(FloatBuffer_iOS.o) ShortBuffer_iOS::description() const in libG3MiOSSDK.a(ShortBuffer_iOS.o) "std::basic_ostream >& std::operator<<, std::allocator >(std::basic_ostream >&, std::basic_string, std::allocator > const&)", referenced from: StringBuilder_iOS::addString(std::string const&) in libG3MiOSSDK.a(G3MWidget_iOS.o) StringUtils_iOS::parseHexInt(std::string const&) const in libG3MiOSSDK.a(StringUtils_iOS.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Showing first 200 notices only
Если вам нужна дополнительная информация, сообщите мне.
Спасибо.
Я по-прежнему с проблемой попытаюсь решить эту проблему и с ошибкой изменить проблему с ARC, я добавил -fno-objc-arc к флагам компилятора для некоторых файлов и решает проблему, но снова вернусь с помощью Undefined символов для архитектура x86_64: но теперь у меня только 24 ... Может ли кто-нибудь мне помочь? – Melexia