Tag: ios7

随机UISearchDisplayController崩溃(iOS 7)

我一直在试图解决大约50%的用户遇到的崩溃问题。 在我实现了一个UISearchDisplayController(也就是将一个search栏添加到一个表视图)后,崩溃开始了,但是我还没有能够重现崩溃,甚至没有一次。 根据我的用户,当他们打开具有UISearchDisplayController的表格视图时,他们立即崩溃(或冻结)。 根据Crashlytics,崩溃发生在: -[UISearchDisplayController _updateTableHeaderBackgroundViewInTableView:amountScrolledUnder:] 我以编程方式创build了UITableView,但我主要通过IB添加了UISearchBar / UISearchDisplayController。 关于崩溃似乎指的“表格背景视图”,我之前做了两件事情。 首先,我将表视图背景视图设置为零: [self.tableView setBackgroundView:nil]; 其次,我也是这样做的: – (NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section { if (aTableView != nil && self.searchDisplayController != nil) { if (self.searchDisplayController.isActive) { return nil; } else { return [super sectionAtIndex:section].headerTitle; } } else { return [super sectionAtIndex:section].headerTitle; } } 从那时起,我将背景视图更改为一个__strong UIView,框架大小为CGZero,这意味着我刚刚为背景添加了一个强大的空视图。 另外,在第二段代码中,不是返回nil,而是返回一个空string@“”。 我还没有把这些变化推给我的用户,因为在我这样做之前我想确定一下。 试图谷歌的UISearchDisplayControllerfunction,但没有真正find任何东西,所以我猜这是一个iOS 7的具体问题,这使得更难以追查,特别是因为我不能再现它。 […]

几秒钟后,ios7中的操作系统杀死了应用程序

我正在为iOS 7创build基于导航的应用程序,因为我正在使用用户位置数据,使用CoreLocation框架, 应用程序的要求是在特定的时间开始获取用户在后台的位置,为此,我已经使用didReceiveRemoteNotification fetchCompletionHandler:方法实现了无声Pushnotification, 我已经成功地实现了这个使用无声Pushnotification及其调用startUpdatingLocation ,我能够获取委托方法中的位置数据: 使用这个有效载荷: {"aps" : {"content-available" : 1},"SilentPush" : "4"} 我已启用背景模式的location和remote notification : – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler { __block UIBackgroundTaskIdentifier bgTask =0; UIApplication *app = [UIApplication sharedApplication]; bgTask = [app beginBackgroundTaskWithExpirationHandler:^{ [self.locationManager startUpdatingLocation]; }]; didUpdateLocations – (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { lastLoc=[locations lastObject]; [logFile addLocObject:[NSString stringWithFormat:@"Loc: %@",lastLoc]]; […]

boundingRectWithSize不复制UITextView

我在一个项目中的要求是UITextView的字体大小应该根据UITextView的内容减less。 所以我正在尝试使用boundingRectWithSize来估计文本的大小。 问题是,我得到的字体大小有点太大,文本的一部分不会被剪切。 我的function: -(BOOL)updateTextViewFontSizeForText:(NSString*)text{ float fontSize = self.maximumFontSizeInPoints; self.font = [self.font fontWithSize:fontSize]; CGSize tallerSize ; CGSize stringSize ; do { if (fontSize <= self.minimumFontSizeInPoints) // it just won't fit return NO; fontSize -= 1.0; self.font = [self.font fontWithSize:fontSize]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; [paragraphStyle setLineBreakMode:NSLineBreakByWordWrapping]; NSDictionary *attributes = @{ NSFontAttributeName: self.font, NSParagraphStyleAttributeName : […]

在iOS中将video文件与原始audio合并

我需要合并两个video文件以及相应的audio。 我尝试使用: http : //www.raywenderlich.com/13418/how-to-play-record-edit-videos-in-ios video合并,但audio丢失。 这就像一个静音的video。 我需要的audio也被合并。 我也google了这个,找不到有用的东西。 有人可以帮我在这个请…

ios6和ios7之间不同的垂直alignment字体

我有iOS6和iOS7之间的垂直alignment字体的一些问题,我有一个自定义的字体,在iOS6有点高一个UIButton垂直alignment的中心,所以我做了吗? 我已经设置了myButton.titleEdgeInsets = UIEdgeInsetsMake(6, 0, 0, 0) ,我已经解决了这个问题,但现在与iOS7有相反的问题,现在与iOS7字体有点低…我可以修复这个问题在两个iOS都有相同的结果吗? 提前致谢

在后台IOs7应用程序崩溃

我的应用程序有时在后台崩溃,并显示以下崩溃日志: Nov 7 12:33:31 iPad backboardd[29] <Warning>: MyApp[3096] has active assertions beyond permitted time: {( <BKProcessAssertion: 0x14680c60> identifier: Called by MyApp, from -[AppDelegate applicationDidEnterBackground:] process: MyApp[3096] permittedBackgroundDuration: 180.000000 reason: finishTask owner pid:3096 preventSuspend preventIdleSleep preventSuspendOnSleep )} 通过其他问题看,我发现崩溃消息表明,我没有正确地结束任务,所以当它的时间到期了操作系统结束它,并崩溃我的应用程序。 所以我加了一些NSLogs: – (void)applicationDidEnterBackground:(UIApplication *)application { [self saveContext]; [Settings setCallLock:YES]; [self saveStuff]; if ([self isBackgroundTaskNeeded]) { UIApplication* app = […]

iOS 7 UINavigationBar有隐藏的后退button

我有一个应用程序,它的UINavigationBars中有一个自定义图像的后退button。 在iOS 6中,一切都很好,但在iOS 7中,button在大多数情况下是“隐形”的。 当我将一个新的视图控制器推入UINavigationController时,后面的button不会出现在新的屏幕上,但是如果我触摸button的位置,它会淡入。 如果我在导航控制器上设置了两个没有animation的视图控制器,那么button显示正常,但不会出现以后的推送。 我敢肯定,在我的代码中没有什么是故意隐藏后退button,并改变UINavigationBar上提供的各种颜色没有任何区别。

如何确定GMSMarker是否位于GMSPolygon(iOS Google Map SDK)

我已经从这个链接中得到了苹果地图工具包的相同问题的答案,但不知道如何检查某个位置或注释(GMSMarker)是否位于Google Map SDK中的GMSPolygon内部。 所以请,如果有人有任何想法,帮助我。

iOS 7没有调用supportedInterfaceOrientations

我search了这个答案,但找不到解决我的问题的任何东西。 所以这里的问题是:我有一个自定义的UINavigationController,创build它时在rootViewController上调用supportedInterfaceOrientations方法(只支持肖像)。 但是当把另一个ViewController推入堆栈时,这个方法在被推送的ViewController上不会被调用(支持所有的倒置)。 我通过在viewDidLoad方法中调用[self supportedInterfaceOrientations]来解决它,但是我认为这不是解决问题的好方法。 我希望你能在这个问题上帮助我。 这是我在第二个viewController中实现的代码。 – (BOOL)shouldAutorotate { return YES; } – (NSUInteger)supportedInterfaceOrientations { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { [[[UIApplication sharedApplication] delegate] setGlobalOrientationMask:UIInterfaceOrientationMaskAllButUpsideDown]; return UIInterfaceOrientationMaskAllButUpsideDown; } else { [[[UIApplication sharedApplication] delegate] setGlobalOrientationMask:UIInterfaceOrientationMaskAll]; return UIInterfaceOrientationMaskAll; } } 我认为johnma的解决scheme应该可以适用于大多数应用程序,但在我的情况下,我认为有一个特殊的问题,但我现在自己解决(不知道它是否是一个好的,但它的工作原理)。 我实现了- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated在我的navigationController委托的- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated方法。 – (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController […]

iOS7到iOS8应用程序文件的迁移

我目前正在iOS8上testing我的应用程序。 一切都运行在纯粹的iOS8上,但我正在努力从iOS7的应用程序文件迁移,将发生在iOS8将被公开发布的用户。 由于我的应用程序使用了多个“标准目录”(文档,应用程序支持,…),我希望确保迁移顺利。 iOS8上的应用程序文件系统结构发生了变化(请阅读iOS beta 4发行说明和文件系统编程指南 )。 当iOS8将安装在设备上时,我想所有先前安装的应用程序和所有相关文件(在文档,应用程序支持等中)将被重新组织以匹配新的结构。 你们是否有任何关于iOS7到iOS8升级过程中发生的变化列表的线索? 我找不到有关此主题的任何文档。 有没有办法testing/模拟iOS7应用沙箱到新的iOS8沙箱结构的迁移? 谢谢 奖金问题:操作系统升级时应用程序GUID是否改变?