Tag: ios7

将Yelp API v2集成到iOS 7应用程序中

我认为这会是一个更加无缝的过程。 我下载了yelp api示例( https://github.com/Yelp/yelp-api/tree/master/v2/ios ),并假设我可以“构build并运行”,并看到一个例子, buttonPressed事件。 我一直在这里读: 如何在iPhone应用程序中集成Yelp APi? 和其他地方在网上,但是当试图整合一个基本的testing时,会得到大量的错误。 我已经注册了一个帐户,拥有一套API v2密钥。 许多错误似乎与ARC和yelp api试图显式autorelease他们的一些对象有关。

在skview中创buildbutton指向不同的场景

我正在尝试第一次使用sprite套件。 只是为了陈述明显的,我已经通过了文件,但我不能安静地掌握创build多个button的想法呢。 我可以创buildbutton好吧。 他们出现在我看来,但我不能附加function,以指出不同的意见。 这里是我用来创buildbutton的代码等等: #import "Levels.h" #import "MyScene.h" #import "MyScene1.h" @interface Levels () @property BOOL contentCreated; @end @implementation Levels – (void)didMoveToView: (SKView *) view { if (!self.contentCreated) { [self createSceneContents]; self.contentCreated = YES; } } – (void)createSceneContents { self.backgroundColor = [SKColor blueColor]; self.scaleMode = SKSceneScaleModeAspectFit; [self addChild: [self button]]; [self addChild: [self button1]]; [self […]

如何获得默认的iOS浏览器名称?

堆栈溢出应用程序检测我的越狱设置默认浏览器(Chrome)的名称。 我如何在objective-c和swift中实现相同的目标? (只是名称,不是ActivityView代码) 例: 更新:我进入设置>堆栈交换,发现这个: 它看起来像应用程序默认为Safari,但如果安装了Chrome浏览器,那么链接将被发送到该浏览器。 Chrome最有可能被下面答案中描述的canOpenUrl方法检测到。

UIWebview的键盘返回键按下ios 7

我试图找出一个解决scheme,当UIWebview的返回键被点击! 我尝试了以下链接,但它不工作! UIWebView,自定义“返回”键 如何检测键盘input密钥? 我想做一些偏移工作,当用户在UIWebview上键入并按下返回键! 这是我使用的代码! – (void)viewDidLoad { [super viewDidLoad]; NSString* plainContent = @"Edit here….."; NSString* htmlContentString = [NSString stringWithFormat: @"<html>" "<body>" "<div id=\"content\" contenteditable=\"true\" style=\"font-family: Arial\">" "%@" "</div>" "</body></html>", plainContent]; [_webview loadHTMLString:htmlContentString baseURL:nil]; } – (BOOL)webView:(UIWebView*)aWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType{ NSString *requestString = [[request URL] absoluteString]; NSArray *components = [requestString componentsSeparatedByString:@":"]; NSString *theTask = (NSString […]

访问电话簿ios时崩溃的应用程序

ios内存泄漏时访问电话簿是我的原始问题,这是崩溃日志。 内存泄漏问题已得到解决,但当我访问联系人并popup到导航控制器再次推入和访问联系人时,应用程序崩溃,重复此过程3-4次,应用程序将崩溃。 崩溃日志: Aug 6 19:11:08 IPad <Warning>: Fetching contact info —-> Aug 6 19:11:08 IPad <Notice>: (Warn ) [ABLog]: <ABSource.c ABAddressBookCopyDefaultSource:111> Actual default source doesn't exist Aug 6 19:11:57 IPad com.apple.debugserver-310.2[449] <Warning>: Got a 'k' packet, killing the inferior process. Aug 6 19:11:57 IPad com.apple.debugserver-310.2[449] <Warning>: Sending ptrace PT_KILL to terminate inferior process. Aug […]

如何通过字典键过滤字典的数组

这是我的JSON.This总共250个国家,我只列出3下面。 在这里我需要做的事情是我有parsing的国家进入七个不同的arrays基于大陆。 { "geonames" : [ { "languages" : "ca", "east" : 1.786542777831983, "continent" : "EU", "geonameId" : 3041565, "population" : "84000", "areaInSqKm" : "468.0", "countryName" : "Andorra", "south" : 42.42849259876837, "countryCode" : "AD", "capital" : "Andorra la Vella", "isoAlpha3" : "AND", "fipsCode" : "AN", "isoNumeric" : "020", "west" : 1.407186714111276, "continentName" : "Europe", "north" […]

iOS7状态栏问题

我发现在iOS 7的状态栏问题很多链接bt没有一个帮助很大。 问题是我的应用程序在iOS6中运行良好,但是当我尝试在iOS7上运行它时,我需要iOS7的外观和感觉。 状态栏与下面的UIViewController很好地凝结在一起: 但是对于UINavigationController它会变成黑色,如下所示: 我设法改变使用AppDelegate中的以下代码statusBar的文本颜色: if ([[UIView appearance] respondsToSelector:@selector(setTintColor:)]) { [[UIView appearance] setTintColor:[UIColor whiteColor]]; } 此外,我的plist文件具有以下条目: View controller-based status bar appearance设置为NO 和我的AppDelegate有: [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 导航控制器加载时,我希望statusBar采取蓝色。 注意:我已经使用以下代码来支持iOS7: #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 self.edgesForExtendedLayout=UIRectEdgeNone; #endif 不知道这是否导致了这个问题。

在iOS 7中,尽pipeUITabBarController被隐藏了,为什么UITableView的contentInset有底部值?

我不知道为什么UITableView自动底部插入,尽pipe我通过调用[setHidden:YES]隐藏UITabBarController 。 具有UITableView的视图控制器是UITabBarController的子项。 我已经知道,根据它的容器视图控制器的状态,AdjustsScrollViewInsets可以帮助任何UIScrollView获得正确的“contentInset”。 所以,我期望如果UITabBar被隐藏, UITableView的底部contentInset将为0。 但是,不这样做。 虽然自动调整ScrollViewInsets是YES,当UITabBar被隐藏时,我应该手动调整该值吗?

UICollectionView finishInteractiveTransition没有animation完成

我正在实现一个自定义的交互式集合视图布局转换,并且想要对它进行configuration,以便在调用finishInteractiveTransition使用一个转换布局transitionProgress为1.0, startInteractiveTransitionToCollectionViewLayout:completion:的完成块立即被触发。 我需要这种行为,因为我希望能够在完成后立即开始另一个转换。 有了这个完成块没有立即发射,我最终nested push animation can result in corrupted navigation bar日志中的nested push animation can result in corrupted navigation bar ,因为转换上下文还没有completeTransition:它的completeTransition:方法。 事实上,即使没有animation要求,也只有0.05秒的小延迟。 是否有可能强制UICollectionView不animation这个完成? 一些代码… 我有一个转换控制器,处理导航转换的animation和交互式转换。 该控制器的相关部分如下: – (void)startInteractiveTransition:(id<UIViewControllerContextTransitioning>)transitionContext { self.context = transitionContext; UIView *inView = [self.context containerView]; UICollectionViewController *fromCVC = (UICollectionViewController *)[self.context viewControllerForKey:UITransitionContextFromViewControllerKey]; UICollectionViewController *toCVC = (UICollectionViewController *)[self.context viewControllerForKey:UITransitionContextToViewControllerKey]; self.transitionLayout = (MyTransitionLayout *)[fromCVC.collectionView startInteractiveTransitionToCollectionViewLayout:toCVC.collectionViewLayout completion:^(BOOL […]

在IOS 7中的tableView分隔符布局问题

正如你所看到的,上面的分隔符的布局是不正确的。 tableView在MoreTabController 。 我发现的解决scheme如何解决iOS 7上的UITableView分隔符? 这有没有办法让iOS 7中的UITableView单元格在分隔符中没有换行符? 但我正在编译我的应用程序对SDK 6.0,而不是SDK 7.0,因为我的应用程序无法运行,如果编译对SDK 7.0。 函数setSeparatorInset只存在于SDK 7.0之后,还有其他方法可以解决吗?