Questions tagged «ios»

iOS是在Apple iPhone,iPod touch和iPad上运行的移动操作系统。使用此标签[ios]来解决与iOS平台上的编程有关的问题。使用相关的标签[objective-c]和[swift]解决那些编程语言所特有的问题。

7
在iOS中显示动画GIF
我注意到,使用iMessage,现在可以发送和显示动画gif。这是否意味着Apple现在支持在应用程序中显示动画GIF,还是最简单的方法仍然是将图像分成帧然后顺序显示?从iOS 5.1开始,显示动画GIF的最简单方法是什么? 谢谢!
90 objective-c  ios 


2
使用NOT IN的NSArray与NSPredicate
我有一个NSArray,我想使用NSPredicate过滤掉某些对象,我希望可以使用NOT IN,因为我看到自己可以轻松地进行IN。 所以我有我的数组: self.categoriesList 然后我得到要删除的值: NSArray *parentIDs = [self.cateoriesList valueForKeyPath:@"@distinctUnionOfObjects.ParentCategoryID"]; 这为我提供了我不想显示的类别的ParentCategoryID列表,因此我认为可以使用NSPredicate删除它们: self.cateoriesList = [self.cateoriesList filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"CategoryID NOT IN %@",parentIDs]]; 这将失败: reason: 'Unable to parse the format string "CategoryID NOT IN %@"' 如果我只想使用IN,那当然是完美的。



9
触摸后保持UIButton处于选中状态
用户单击按钮后,我希望在执行网络操作期间该按钮保持按下状态。网络操作完成后,我希望按钮返回其默认状态。 我曾尝试[UIButton setSelected:YES]在按钮按下后立即拨打电话(与之对应的呼叫- [UIButton setSelected:NO]在我的网络操作完成之后),但似乎没有任何作用。如果我打电话也一样setHighlighted:。 我想我可以尝试换掉背景图像以表示在网络运行期间处于选定状态,但这似乎是一种hack。还有更好的建议吗? 这是我的代码: - (IBAction)checkInButtonPushed { self.checkInButton.enabled = NO; self.checkInButton.selected = YES; self.checkInButton.highlighted = YES; [self.checkInActivityIndicatorView startAnimating]; [CheckInOperation startWithPlace:self.place delegate:self]; } - (void)checkInCompletedWithNewFeedItem:(FeedItem*)newFeedItem wasNewPlace:(BOOL)newPlace possibleError:(NSError*)error; { [self.checkInActivityIndicatorView stopAnimating]; self.checkInButton.enabled = YES; self.checkInButton.selected = NO; self.checkInButton.highlighted = NO; }
90 ios  uibutton  selected 

2
swift:闭包声明就像块声明
我们可以在Objective-C中声明以下块。 typedef void (^CompletionBlock) (NSString* completionReason); 我试图迅速做到这一点,它给错误。 func completionFunction(NSString* completionReason){ } typealias CompletionBlock = completionFunction 错误:使用未声明的“ completionFunction” 定义: var completion: CompletionBlock = { } 这该怎么做? 更新: 根据@jtbandes的回答,我可以使用多个参数创建闭包,例如 typealias CompletionBlock = ( completionName : NSString, flag : Int) -> ()
90 ios  swift 

6
如何在新的iTunes Connect网站中删除App Build?
我想在iTunes connect上上传应用程序的新版本,但是我不能像在这里提到的那样提交它。 现在,我想删除上传的版本并使用保存版本上传新的版本,但是出现错误,如屏幕截图所示。 在这里找到解决方案 您不能删除旧的已上传版本。必须上传具有新版本(+1)版本的新版本。


10
iOS-如何使用多个参数和afterDelay实现performSelector?
我是iOS新手。我有一个选择器方法如下- - (void) fooFirstInput:(NSString*) first secondInput:(NSString*) second { } 我正在尝试实现这样的东西- [self performSelector:@selector(fooFirstInput:secondInput:) withObject:@"first" withObject:@"second" afterDelay:15.0]; 但这给了我一个错误的说法- Instance method -performSelector:withObject:withObject:afterDelay: not found 关于我所缺少的任何想法吗?


4
iOS Prefix.pch最佳做法
我已经看到许多开发人员在其iOS项目的Prefix.pch中添加了各种便利宏。 您建议(或不建议)向iOS Prefix.pch文件添加什么?您的Prefix.pch是什么样的?
90 ios  objective-c  xcode  pch 

1
为什么UIBezierPath比Core Graphics路径快?
我正在研究绘图路径,并且发现至少在某些情况下,UIBezierPath的性能优于我认为相当于Core Graphics的性能。-drawRect:下面的方法创建两条路径:一条UIBezierPath和一条CGPath。路径除了位置外都是相同的,但是抚摸CGPath的时间大约是抚摸UIBezierPath的两倍。 - (void)drawRect:(CGRect)rect { CGContextRef ctx = UIGraphicsGetCurrentContext(); // Create the two paths, cgpath and uipath. CGMutablePathRef cgpath = CGPathCreateMutable(); CGPathMoveToPoint(cgpath, NULL, 0, 100); UIBezierPath *uipath = [[UIBezierPath alloc] init]; [uipath moveToPoint:CGPointMake(0, 200)]; // Add 200 curve segments to each path. int iterations = 200; CGFloat cgBaseline = 100; …
90 iphone  ios  drawing  bezier 


21
Xcode9 iOS11应用程序发行版中缺少CFBundleIconName
我正在努力使用使用iOS 11 SDK构建的Xcode 9发布我们应用的新版本。存档和上传二进制文件进行得很顺利,没有任何问题。该构建在iTunes Connect的“活动”下显示为“处理中”,它消失了,我收到了以下电子邮件。 亲爱的开发人员, 我们发现您最近为“”投放的商品有一个或多个问题。要处理交货,必须纠正以下问题:缺少Info.plist值-包''中缺少Info.plist键CFBundleIconName的值。在资产目录中提供图标的应用程序还必须提供此Info.plist密钥。有关更多信息,请参见 http://help.apple.com/xcode/mac/current/#/dev10510b1f7。解决这些问题后,您可以重新交付更正后的二进制文件。此致App Store小组敬上 该链接提供了有关资产捆绑包的一些信息。我尝试将CFBundleIconName键设置为项目名称或图像文件名,然后再次提交了该应用程序。但是,我仍然收到与上述相同的电子邮件。 任何帮助的建议将不胜感激。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.