草庐IT

iOS 8 CLLocationManager 输入区域 : not getting called if use requestWhenInUseAuthorization

我正在尝试在iOS8中为自定义区域调用委托(delegate)方法locationManager:didEnterRegion。这是代码:self.locationManager=[[CLLocationManageralloc]init];self.locationManager.delegate=self;if([self.locationManagerrespondsToSelector:@selector(requestWhenInUseAuthorization)]){[self.locationManagerrequestWhenInUseAuthorization];}C

ios - NSXMLParser 解析器 :parseErrorOccurred: not called on iOS 7

我在iOS7上遇到一个非常奇怪的问题。我使用标准的NSXMLParser。在iOS6上一切正常——当XML有效时以及当NSData为零字节或包含无效字节时。self.dataParser=[[[NSXMLParseralloc]initWithData:data]autorelease];[self.dataParsersetDelegate:self];[self.dataParserparse];在iOS7上,解析器仅在具有有效的XML数据时才按预期工作。如果数据为零字节,则不会调用任何委托(delegate)方法。请帮我找个方向。谢谢。更新。所有委托(delegate)方法都已实

ios - animationDidStop : finished: delegate method not getting called

我想在前一个动画例程完成后立即开始一个新的动画例程。然而,当前一个确实完成时,新的不会被触发,因为没有调用委托(delegate)方法。我已经委派了一个ViewController来处理按钮的CALayer的动画。“buttonSlide”是以前的动画,而“buttonFade”是新动画。这是代码片段:--(void)viewWillAppear:(BOOL)animated{NSLog(@"TimeViewappearing...");[superviewWillAppear:animated];[selfpressButton:nil];//Showscurrenttimeasso

ios - CallKit (Call Directory Extension) 可以识别和阻止蜂窝电话吗

首先,我是iOS开发的新手,我已经广泛阅读了AppleCallKit框架的一些小文档和教程,但我不知道这个框架是否真的可以阻止蜂窝电话或只是VoIP电话?问题就这么简单,我需要知道CallKit是否可以用来阻止蜂窝电话,当我预定义了一个电话推销员列表时,这些电话推销员使用他们的手机调用我所在国家/地区的人。我只是想知道是否有人可以给我一个明确的答案,然后我可以继续我的生活,而不必浪费更多时间来尝试让CallKit识别来电。谢谢! 最佳答案 是的,您可以使用CallKit扩展程序阻止来电

ios - CALayer.draw(in :) and CALayer. needsDisplay(forKey :) not called when expected, presentation layer unexpectedly nil

我正在尝试实现一个具有隐式动画属性的图层,但我看到了一些非常奇怪的行为。这是一个简单的层,它演示了我的意思:classCustomLayer:CALayer{overrideinit(){super.init()implcitlyAnimatedProperty=0.0000needsDisplayOnBoundsChange=true}overrideinit(layer:Any){super.init(layer:layer)implcitlyAnimatedProperty=(layeras!CustomLayer).implcitlyAnimatedProperty}requi

ios - 在 xcode 5 中隐藏 "*** First throw call stack"

在Xcode5中调试时,有没有办法隐藏调用堆栈并仅显示错误日志,或者手动打开和关闭它?我只想要这样的错误日志:TestProject[31643:70b]***Terminatingappduetouncaughtexception'NSGenericException',reason:'Couldnotfindanavigationcontrollerforsegue'SecondViewController'.PushseguescanonlybeusedwhenthesourcecontrollerismanagedbyaninstanceofUINavigationContro

ios - "The UIApplicationDelegate in the iPhone App never called reply() in -[UIApplicationDelegate application:handleWatchKitExtensionRequest:reply:]"

好的,我正在制作这个AppleWatch应用程序,在我的Watch应用程序中,我有一个按钮。当您触摸按钮时,它会执行以下操作:[WKInterfaceControlleropenParentApplication:[NSDictionarydictionary]reply:^(NSDictionary*replyInfo,NSError*error){if(error){NSLog(@"%@",error);}}];在我的AppDelegate文件中,我这样做:-(void)application:(UIApplication*)applicationhandleWatchKitExt

ios - GMSThreadException' 原因 : 'The API method must be called from the main thread'

我在使用googleAPI绘制折线时遇到此错误由于未捕获的异常GMSThreadException而终止应用程序-(void)drawRoute{dispatch_queue_tmyQueue=dispatch_queue_create("MyQueue",NULL);dispatch_async(myQueue,^{[selffetchPolylineWithOrigin:origindestination:destinationcompletionHandler:^(GMSPolyline*polyline){dispatch_async(dispatch_get_main_que

javascript - iOS 从 Javascript 调用 Objective-C : Some calls are ignored?

我已经使用UIWebView委托(delegate)shouldStartLoadWithRequest()方法在iOS上实现了似乎是从javascript到objective-c通信的唯一方法。起初似乎工作正常,但现在我注意到,如果我在短时间内多次从javascript调用objective-c,第二次调用通常会被忽略(该应用程序是钢琴键盘,每次按键触发对native代码的调用,当处理多个触摸时,native代码不会为每个手指都调用)。这是我响应javascript调用的objective-c代码。我知道这很愚蠢,但我只是想要一些暂时可用的东西。-(BOOL)webView:(UIW

ios - performSegueWithIdentifier :method called from didSelectRowAtIIndexPath slow to show view

我有一个静态的UITableview并且正在尝试切换到模态视图。我不能直接从Storyboard中的单元格进行segue,因为有时我希望根据某些应用程序逻辑不调用segue。所以我将segue连接到TableViewController并在Storyboard中为其指定了一个标识符。然后在TableViewController中我调用了下面的方法。-(void)tableView:(UITableView*)tableViewdidSelectRowAtIndexPath:(NSIndexPath*)indexPath{//Performseguewhenfirstrowinfirst