Tag: ios

如何从挖掘位置获取CGPoint?

我正在为iPaddevise一个graphics计算器应用程序,我想添加一个function,用户可以在graphics视图中点击一个区域,使文本框popup,显示它们所触摸的点的坐标。 我怎样才能从这个CGPoint?

2 UITableViews在一个UIView

我有一个UIView将需要显示两个UITableViews,但他们永远不会显示在一起,通过使用SegementedBar您可以切换一个或另一个。 什么是处理这个最好的方法? 只需创build一个Table View Controller并更改数据源,或者创build2个Table View Controllers并在另一个可见时隐藏一个。 2个表格将具有与不同的自定义单元格完全不同的布局。

如何编写Objective-C完成块

我在需要从我的视图控制器调用类方法的情况下,让它做的事情,但只有在类方法完成后才执行一些操作。 (我想我需要的是一个完成块,但如果我错了,请纠正我。) 情况如下: 我使用Parse.com为我的应用程序后端。 当用户注册一个帐户时,他们在popup框中input他们的姓名,公司和其他信息,然后点击提交。 提交button链接到一个类方法(如下所示),它接收PFUser对象和公司名称并创build一些数据库对象。 函数完成之后,popup窗口将使用委托来解除。 问题是我需要创build这些对象以特定的顺序发生,因为它们依赖eachothers objectId的存在。 问题是,点击提交之后立即调用closurespopup窗口的委托方法,因为它是堆栈中的下一个。 当保存一个Parse对象时,会调用一个类似下面的方法:(这是我希望写的东西,我认为可以解决我的问题) [someParseObject saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { // Code here runs AFTER the method completes. // This also happens on another thread which // i'd like to implement as well. }]; 所以,我需要弄清楚如何做下面的事情:(一切都与块是完全错误的,我敢肯定) SignUpViewController.m myUserOrg *userOrg = [myUserOrg object]; // myUserOrg = Custom PFObject Subclass // […]

“不止一次推送相同的视图控制器实例”不受支持“exception

我正在使用下面的代码来检索一些消息,并将其放入我的收件箱。 MyInboxVC *inboxVC=[MyInboxVC get ]; //upload all the pending messages UINavigationController *devNavController=[[MyappMgr get]getDeveloperNavigationController ]; [devNavController pushViewController:inboxVC animated:YES]; [devNavController setNavigationBarHidden:NO]; 我得到的例外 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported (<MyInboxVC: 0x1452a0>)' 这是什么意思? 我究竟做错了什么?

代码签名错误:捆绑格式无法识别,无效或不适用

我工作的iOS应用程序,Swift语言,iOS8,Xcode 6.1。 它在iPad上运行良好。 然后我添加了一个“资源”文件夹引用项目,之后我得到代码签名错误。 资源文件夹包含一些HTML文件。 我不知道这个文件夹引用是如何造成这个问题的。 请帮忙吗?

如何设置自适应多行UILabel文本?

我的故事板笔尖中有一个名为titleLabel的UILabel设置为其默认高度。 我希望它在编程上扩展高度以适应其内容。 这是我迄今为止所尝试的: // just setting content titleLabel.text = "You don't always know what you are getting with mass-market cloud computing services. But with SimpliCompute, the picture is clear. SimpliCompute gives you powerful virtual servers you can deploy using just your web browser. That's enterprise grade technology you can deploy and control on-the-fly." titleLabel.numberOfLines = […]

后台的StartUpdateLocations,didUpdatingToLocation只调用了10-20次

testing设备:iPhone 5(iOS 7) 我有一个使用RegionMonitoring和updateLocation的应用程序。 如果input区域, didEnterRegion预期调用didEnterRegion 。 然后我打电话给startUpdatingLocation 。 但是方法didUpdateToLocation只被调用10-20次,而它应该更新的位置,直到定时器触发。 相关代码: CLLocationManager *_locationManager; NSTimer *_timer; -(void)initLocationManager { _locationManager = [[CLLocationManager alloc] init]; _locationManager.delegate = self; [_locationManager setActivityType:CLActivityTypeOther]; [_locationManager setDesiredAccuracy:kCLLocationAccuracyBestForNavigation]; [_locationManager setPausesLocationUpdatesAutomatically:NO]; [_locationManager setDistanceFilter:kCLDistanceFilterNone]; } //Did Enter Region, called as expected: – (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { [_locationManager startUpdatingLocation]; _timer = [NSTimer scheduledTimerWithTimeInterval:300.0f target:self selector:@selector(scheduleMethod:) userInfo:nil […]

更改iPhone的初始屏幕时间

我如何让启动屏幕停留更长时间,例如5秒钟?

强迫景观ios 7

我试图用下面的方法来强制我的观点: – (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeLeft; } – (BOOL)shouldAutorotate{ return YES; } 也没有工作。 请注意,我正在模拟器上和iPad上进行testing。 谢谢

如何在iOS应用程序中使用客户端证书身份validation

我没有很多客户端证书authentication的经验。 任何人都可以告诉我如何在iOS应用程序中使用它? 谢谢 :)