Tag: ios7

NSCalendarUnitWeekOfYear和NSCalendarUnitWeekOfMonth之间的区别

我想在UILocalNotification之前每周做一个UILocalNotification重复我会使用localNotification.repeatInterval = NSWeekCalendarUnit – 除了NSWeekCalendarUnit已被弃用。 文档说: “使用NSCalendarUnitWeekOfMonth或NSCalendarUnitWeekOfYear,取决于你的意思是” 但我不知道有什么不同,所以我不知道我是哪一个。

一次绘制多个skshapenode?

您好我已经绘制skhapenodes连接我的graphics中的节点为我的视觉a *表示。 for(int x=0; x<64; x++) { for(int y=0; y<48; y++) { PathFindingNode *node = [[gridToDraw objectAtIndex:x] objectAtIndex:y]; for(int i=0; i< node.connections.count; i++) { PathFindingNode *neighbor = [node.connections objectAtIndex:i]; SKShapeNode *line = [SKShapeNode node]; CGMutablePathRef pathToDraw = CGPathCreateMutable(); CGPathMoveToPoint(pathToDraw, NULL, node.position.x, node.position.y); CGPathAddLineToPoint(pathToDraw, NULL, neighbor.position.x, neighbor.position.y); line.path = pathToDraw; line.lineWidth = 0.1f; [line setStrokeColor:[UIColor blueColor]]; […]

无法下载并打开PDF文件,错误未能在ios中findPDF头

我有一个应用程序,我从一个URL打开PDF文件。 我成功地能够在webView中打开它。 现在我想下载该PDF文件并将其保存在我的文档文件夹中,并且希望将该PDF文件发送到我的邮件中。 我search了很多,发现下面的最佳解决scheme。 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *documentsPath = [paths objectAtIndex:0]; NSString *filePath = [documentsPath stringByAppendingPathComponent:@"myfile.pdf"]; if(![[NSFileManager defaultManager] fileExistsAtPath:filePath]){ NSData *pdfData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/UIWebView_Class.pdf"]]; //Store the downloaded file in documents directory as a NSData format [pdfData writeToFile:filePath atomically:YES]; } NSURL *url = [NSURL fileURLWithPath:filePath]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView […]

在模拟器中的iOS6和iOS7的显示屏幕是不同的

我的应用程序我会给部署目标6.1所以在7.0显示和6.1显示屏幕不同所以如何调整6.1和7.0的大小

如何从iPhone以编程方式获取iPhone应用程序崩溃日志文件

有没有办法通过编程访问iphone崩溃日志文件。 我试图编写一个崩溃报告function,当您在崩溃后启动应用程序时,它会提供将崩溃报告发送到服务器。 我无法find如何获取应用程序内的崩溃日志。

UITextView文本select和高亮在iOS 8中跳跃

我正在使用UIMenuItem和UIMenuController向我的UITextView添加高亮function,因此用户可以更改所选文本的背景颜色 ,如下图所示: 在UITextView使用高亮function在用户中检测到文本: UITextView突出显示的文本具有新的背景色,用户在点击突出显示的特征后select: 在iOS 7中 ,以下代码正在完美地完成此任务: – (void)viewDidLoad { [super viewDidLoad]; UIMenuItem *highlightMenuItem = [[UIMenuItem alloc] initWithTitle:@"Highlight" action:@selector(highlight)]; [[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObject:highlightMenuItem]]; } – (void)highlight { NSRange selectedTextRange = self.textView.selectedRange; [attributedString addAttribute:NSBackgroundColorAttributeName value:[UIColor redColor] range:selectedTextRange]; // iOS 7 fix, NOT working in iOS 8 self.textView.scrollEnabled = NO; self.textView.attributedText = attributedString; self.textView.scrollEnabled = YES; } […]

closuresios 7中的UIAlertView无法正常工作?

我想解雇一个UIAlertView之前显示另一个,我在这里find答案: iOS解雇UIAlertView显示另一个 问题是,这不适用于iOS7,但适用于iOS6。 这是在iOS6中工作 -(void)closePreviousAlert{ for (UIWindow* w in [UIApplication sharedApplication].windows) for (NSObject* o in w.subviews) if ([o isKindOfClass:[UIAlertView class]]) [(UIAlertView*)o dismissWithClickedButtonIndex:[(UIAlertView*)o cancelButtonIndex] animated:YES]; } 有没有另一种解决scheme呢?

我可以像App Store应用程序一样在后台更新iOS Enterprise App吗?

我有一个iOS企业应用程序,我们正在无线分发到我们的设备。 目前该应用程序每天轮询我们的服务器一次,看是否有应用程序更新。 如果有的话,我们尝试通过让应用程序调用以下代码来安装它: NSURL *installUrl = [NSURL URLWithString:[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@", plistUrl]]; [[UIApplication sharedApplication] openURL:installUrl]; 这会导致应用程序通过警告对话框来提示用户安装更新。 如果他们点击安装,应用程序closures,更新下载并安装。 我想知道是否有类似于AppStore的自动更新iOS 7企业应用程序的任何东西? 我希望能够更新我们的应用程序,而无需用户按下更新button,并能够在用户不需要等待安装的时候进行更新。

在正确的时间显示键盘iOS7

在iOS 6中,我用于在viewDidLoad显示键盘。 – (void)viewDidLoad { [super viewDidLoad]; [txtField becomeFirstResponder]; } 这样,当navigationController推动新的viewController时,键盘已经在那里,从左到右平滑的animation,并避免自下而上的animation。 在iOS 7中,这种行为似乎中断。 如果我在viewDidLoad添加[txtField becomeFirstResponder] ,键盘会出现在推动animation的中间,已经到了最后的位置:一个不愉快的效果! 我试图在viewWillAppear移动[txtField becomeFirstResponder] ,但最终的结果是不变的。 你知道一种方法来取回iOS 6的行为,推动新的viewController和键盘在一起吗? 编辑:使用计时器不工作任何时间延迟我设置,键盘只显示在推animation的结尾。 到目前为止,我最好的尝试是将[txtField becomeFirstResponder]放在viewWillLayoutSubviews或viewDidLayoutSubviews 。 不幸的是,在推送viewController时这样做,而不是在popup时(键盘不显示)。

UITableView的错误值:iOS8的rowHeight

我用来创build一个矩形(至less到iOS7)的代码是 CGRect rect = [cTableView frame]; rect.origin.y += [cTableView rowHeight]; searchOverlayView = [[BecomeFirstResponderControl alloc] initWithFrame:rect]; 在iOS7上, cTableView (一个UITableView的实例)返回44 。 用iPhone 5s在iOS8中testing返回-1 。 为什么发生这种情况? 为了使我的应用程序与iOS7向后兼容,需要使用哪些正确的代码?