草庐IT

enqueue_call

全部标签

ios - App Delegate的应用:didReceiveLocalNotification: not called

在我的应用程序中,永远不会调用方法-(void)application:(UIApplication*)applicationdidReceiveLocalNotification:(UILocalNotification*)notification。这是我创建通知的方式:UILocalNotification*notification=[[UILocalNotificationalloc]init];//setUUID,whichwewillstoreinuserDefaultsforlaterNSMutableDictionary*myUserInfo=[[NSMutableDic

ios - 无法识别的选择器 isPitched called

在我的应用程序中,我正在显示带有注释的map,用户可以在TableView(在模态视图Controller中)中浏览注释列表。我遇到了一个奇怪的错误,我可以在设备和模拟器(iOS7和8)中重现该错误。在倾斜模式下,如果我尝试在我的POITableView中选择一个项目,它会执行以下操作之一:将map中心更改为map上的随机点,而不是所选注释。因我放入的消息(启用NSZombies)而崩溃。-[__NSCFStringisPitched]:unrecognizedselectorsenttoinstance0x7f24e6e0我尝试了几种方法来解决这个错误,但都没有成功。令我困惑的是我找

ios - scrollViewWillBeginDragging : Not getting called in UICollectionview

我有一个UIView,其中有一个UICollectionview。为了了解UICollectionview的滚动距离,我使用了scrollViewWillBeginDragging:,但它没有被调用。示例代码是-(void)scrollViewWillBeginDragging:(UIScrollView*)scrollView{CGPointtranslation=[scrollView.panGestureRecognizertranslationInView:scrollView.superview];if(translation.y>0){//draggingdown_reus

ios - 代码 141(错误 : success/error was not called) on Parse Cloud Code nested queries

背景:我有一个Parse图像数据库。简单地说,我的代码是这样做的:用户通过ParseCloud调用请求图像(“getNewPicture”)。嵌套在我检查他之前是否看过任何图片(以及其他要求),如果是,则提供一张特定图片(getSpecifiedPicture)。如果他还没有,那么我提供一张新图片(getNewPicture)。问题:通过ParseCloudCode函数调用“getNewPicture”我得到一个错误代码141。奇怪的是它在Android而不是iOS上运行。我的代码:Parse.Cloud.define("getNewPicture",function(request,

ios - UIButton 执行选择器 :withObject:withObject: not making call

这是我的代码。UIButton*button=[UIButtonbuttonWithType:UIButtonTypeCustom];button.frame=CGRectMake(110,270,100,40);button.backgroundColor=[UIColorgrayColor];[buttonsetTitle:@"next"forState:UIControlStateNormal];[self.viewaddSubview:button];我想通过这个方法设置按钮标题颜色但它不起作用![buttonperformSelector:@selector(setTitle

ios - Swift 3.0 迁移后的 Alamofire 错误 : “Extra argument in Call' ” (request method)

我目前正在将我的代码库更新到Swift3.0,并且我正在使用Alamofire。因此,我必须将Alamofire更新到4.0(Alamofiregitrepo)。我有一个请求从服务器获取数据的方法,在迁移之前,它工作得非常好。在使用Xcode的迁移工具之后,我得到了这个错误:“ExtraargumentinCall”。我不太确定为什么此方法不再有效。任何帮助都会很棒!classfuncmakeRequest(_method:RequestMethod,authorization:String?,uri:String,params:JSONDictionary?,retry:Bool=t

ios - `willPresent notification` 是 't called & local notifications aren' t 当应用程序在 iOS 10 中处于前台时不显示

当我第一次运行我的应用程序时,模拟器能够在应用程序处于前台时显示通知。当我重新启动应用程序时didReceivenotification:(即来自iOS9的通知方法)被调用而不是willPresentnotification(即来自iOS10的通知方法)并且没有通知当应用程序在前台时显示。但是,如果应用程序在后台,则会显示通知。这都不是question或者这个question提供了解决这个问题的方法。我使用此代码获得通知授权:funcapplication(_application:UIApplication,willFinishLaunchingWithOptionslaunchOp

ios - iMessage 扩展 : Root Navigation Controller results in all delegate methods to not get called in my MSMessagesAppViewController

我有一个新的iMessage扩展项目,我在其中尝试了2种构建导航堆栈的方法:在我的Storyboard中,我将入口点设置为UINavigationController,它以我的MSMessagesAppViewController作为根Controller。或者我将MSMessagesAppViewController直接设置为Storyboard中的入口点。(没有拥有它的UINavigationController)。对于上面的场景#1,导航Controller工作正常,我可以将新屏幕推送到堆栈中。(除了整个导航栏被隐藏在扩展View中,这是一个我仍然需要弄清楚的单独问题)。但是,使

ios - 圆弧 : Dealloc not being called

我不明白为什么我需要在某些block中有一个弱的self,而其他的似乎工作正常。如果我在Notificationblock中没有对self的弱引用,dealloc将不会被释放。不过,它与第二个效果很好。//Whenusingthis,deallocisNOTbeingcalled[[NSNotificationCenterdefaultCenter]addObserverForName:PROD_DONEobject:nilqueue:[NSOperationQueuemainQueue]usingBlock:^(NSNotification*note){[selfhideAds];}

ios - Sphero 连接 : Should I call setupRobotConnection and handleRobotOnline in each UIViewController or only once per app?

我创建了一个iOS应用程序,其中包含3个启用了Sphero的流程。我最终在每个viewDidLoad中在线重写了setupRobotConnection和handleRobot,然后在每个prepareForSegue方法中关闭了连接。它在大多数情况下都有效,但NavigationController的后退按钮可能会把事情搞砸。我认为这不是连接到Sphero并保持连接的最佳方式。对于我的应用程序,每个流程对handleRobotOnline的需求略有不同流程1:无驱动,需要dataStreaming和AsyncData流程2:用于发送命令的多人游戏类。流程3:使用需要数据流和异步数据的