我正在一个带有地图框架的项目中工作,所有这一切都很好,直到我开始推送通知并在AppDelegate.h中编写@property bool push;
。我在AppDelegate.m
(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同样的错误。 我之前没有遇到任何问题,我几乎尝试了我在这里找到的所有解决方案。
架构x86_64的未定义符号: &#34; BingMapsLayer :: BingMapsLayer(std :: __ 1 :: basic_string,std :: __ 1 :: allocator&gt; const&amp;,std :: __ 1 :: basic_string,std :: __ 1 :: allocator&gt; const&amp;,TimeInterval const&amp;,bool,int,int,float,LayerCondition const *,std :: __ 1 :: vector&gt; )&#34;,引自: G3MScenarioDEMDemoScene.o中的G3MScenarioDEMDemoScene :: rawActivate(G3MContext const ) G3MVectorialDemoScene.o中的G3MVectorialDemoScene :: rawActivate(G3MContext const *) G3MPointCloudDemoScene.o中的G3MPointCloudDemoScene :: rawActivate(G3MContext const *) G3MAnimatedMarksDemoScene.o中的G3MAnimatedMarksDemoScene :: rawActivate(G3MContext const *) G3MStereoDemoScene.o中的G3MStereoDemoScene :: rawActivate(G3MContext const *) G3MVectorStreaming2DemoScene.o中的G3MVectorStreaming2DemoScene :: rawActivate(G3MContext const *) G3MStreamingPointCloud2DemoScene.o中的G3MStreamingPointCloud2DemoScene :: rawActivate(G3MContext const *) ... &#34; GEOVectorLayer :: GEOVectorLayer(int,int,int,int,float,LayerCondition const *,std :: __ 1 :: vector&gt; )&#34;,引自: G3MVectorialDemoScene.o中的G3MVectorialDemoScene :: rawActivate(G3MContext const ) G3M3DSymbologyDemoScene.o中的G3M3DSymbologyDemoScene :: rawActivate(G3MContext const *) &#34; Mark :: Mark(std :: __ 1 :: basic_string,std :: __ 1 :: allocator&gt; const&amp;,URL const&amp;,Geodetic3D const&amp;,AltitudeMode,double,bool,float,Color const *,Color const *,int,MarkUserData *,bool,MarkTouchListener *,bool)&#34;,引自: G3MMarksDemoScene.o中的G3MMarksDemoScene_BufferDownloadListener :: onDownload(URL const&amp;,IByteBuffer *,bool) &#34; Layer :: setTitle(std :: __ 1 :: basic_string,std :: __ 1 :: allocator&gt; const&amp;)&#34;,引自: - ParkingViewController.o中的[ParkingViewController createLayerSet] G3MRasterLayersDemoScene.o中的G3MRasterLayersDemoScene :: createLayerSet(LayerSet *) &#34; std :: string :: erase(__ gnu_cxx :: __ normal_iterator,__ gn_cxx :: __ normal_iterator)&#34;,引自: libG3MiOSSDK.a中的StringUtils_iOS :: ltrim(std :: string const&amp;)const(StringUtils_iOS.o) libG3MiOSSDK.a中的StringUtils_iOS :: rtrim(std :: string const&amp;)const(StringUtils_iOS.o) &#34; std :: string :: erase(unsigned long,unsigned long)&#34;,引自: StringUtils_iOS :: replaceAll(std :: string const&amp;,std :: string const&amp;,std :: string const&amp;)const in libG3MiOSSDK.a(StringUtils_iOS.o) &#34; std :: basic_ostream&gt;&amp;的std ::运营商LT;&LT; &gt;(std :: basic_ostream&gt;&amp;,char const *)&#34;,引自: libG3MiOSSDK.a中的StringBuilder_iOS :: addBool(bool)(G3MWidget_iOS.o) libG3MiOSSDK.a中的IntBuffer_iOS :: description()const(IntBuffer_iOS.o) libG3MiOSSDK.a中的FloatBuffer_iOS :: description()const(FloatBuffer_iOS.o) libG3MiOSSDK.a中的ShortBuffer_iOS :: description()const(ShortBuffer_iOS.o) &#34; std :: basic_ostream&gt;&amp; std :: operator&lt;&lt;,lt;,std :: allocator&gt;(std :: basic_ostream&gt;&amp;,std :: basic_string,std :: allocator&gt; const&amp;)&#34;,引自: libG3MiOSSDK.a中的StringBuilder_iOS :: addString(std :: string const&amp;)(G3MWidget_iOS.o) libG3MiOSSDK.a中的StringUtils_iOS :: parseHexInt(std :: string const&amp;)const(StringUtils_iOS.o) ld:找不到架构x86_64的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) 仅显示前200条通知
如果您需要更多信息,请告诉我。
感谢。
答案 0 :(得分:0)
最后我能够修复错误。我在特定框架中遇到了错误,但也许我可以帮助某人。这真的是一个配置错误项目,如果你使用我的开源框架仔细阅读文档的要求,在我的情况下,我需要做的两件事,我找不到,我不知道谁在看直到我看到一些需要和没有的文件。除此之外,框架或ios的版本,如启用或不启用Bitcode或arc,在我的情况下,我必须在调试中启用Bitcode但不在发布中启用。要知道这只是看框架的设置和patiente。我希望mi经验可以帮助某人。