草庐IT

custom-selectors

全部标签

iphone - UILocalizedIndexedCollat​​ion 的 sectionForObject :(id)object collationStringSelector:(SEL)selector method 选择器的作用是什么

我是iOS开发的初学者,正在经历this文档(关于使用索引列表配置TableView的iOS开发人员指南)我遇到了这个://Listing4.7for(State*theStateinstatesTemp){NSIntegersect=[theCollationsectionForObject:theStatecollationStringSelector:@selector(name)];theState.sectionNumber=sect;}我无法弄清楚选择器(@selector(name))及其用途,也无法找到在选择器中传递名称的方法,即name.我在谷歌上搜索示例以找到更好的

ios - iTunes : App Upload Warning : The app references non-public selectors in :setRefreshInterval

将二进制应用程序上传到iTunes时,报如下警告:Theappreferencesnon-publicselectorsin:setRefreshInterval我该如何解决这个问题?哪个公共(public)API可以解决问题(:setRefreshInterval)? 最佳答案 这意味着您使用的是私有(private)API,而不是文档化/公开的API。如果您使用它,Apple通常会拒绝您的应用程序,因为它们是不允许的,并且如果Apple更改内部系统(包括此未记录的代码),它可能会使您的应用程序崩溃。人们会留下负面评论。在这种情况

ios - 适用于 iOS 的 Apache Cordova (VS2015) : Adding custom entries to *info. plist 工具

我在VS2015上使用ToolsforApacheCordova开发一个项目,我需要在*info.plist文件中设置一些额外的选项,以便暂时取消阻止HTTPWeb访问(NsAppTransportSecurity)以及启用地理定位服务运行在后台。基本上,我需要添加以下...UIBackgroundModeslocationNSLocationAlwaysUsageDescriptionLocationservicesarerequired.NSAppTransportSecurityNSAllowsArbitraryLoads根据我对微软文档的理解here,也被SO问题引用here,

objective-c - 为什么UINavigaionController的子类会调用Default Constructor和Custom Constructor?

@implementationNVController//PlainInitmethod-(id)init{self=[superinit];if(self){}returnself;}//CustomInitMethod-(id)initWithRootViewController:(UIViewController*)rootViewController{self=[superinitWithRootViewController:rootViewController];if(self)`entercodehere`{}returnself;}@endNVController*ins

iphone - 错误 : "-[NSCFString sizeWithTextStyle:]: unrecognized selector" in IPhone SDK

我在运行我的应用程序时遇到以下错误。'-[NSCFStringsizeWithTextStyle:]:无法识别的选择器我没有在我的整个项目中使用sizeWithTextStyle。那么哪里出了问题呢?我在下面的returnpos;语句中出错代码:(UIView*)tableView:(UITableView*)tableViewviewForHeaderInSection:(NSInteger)section{UIView*pos=[[UIViewalloc]initWithFrame:CGRectMake(0.0,0.0,320.0,35.0)];returnpos;}控制台错误:由

ios - Objective-C : using non latin letters in NSURL objects corrupt custom URL schemes on iOS

我想将自定义URL方案添加到我的应用程序中。我做到了,但我发现如果我在我的URL中使用不包含拉丁字母的NSString作为参数,我的应用程序将无法打开。我的目标是分享类似这样的字符串:myapp://?text=blabla,但在“blabla”的地方可能是任何字符串或表情符号。根据RFC1808,URL只能包含拉丁字母,这对我来说很奇怪,因为如果我想分享法语、俄语或亚洲字符的文本怎么办?那么,有没有办法做到这一点? 最佳答案 RFC1808已被RFC3986废弃.您在这里关心第2节。该片段允许:fragment=*(pchar/"

iOS swift : Popup Custom view as alert box

**我用文字和图片设计了自己的View。我想将其呈现为警报View或仅显示为窗口我如何将.modalPresentationStyle用作.Custom并实现此目的我应该使用ViewController还是直接显示View@IBActionfuncBtnClickFnc(sender:AnyObject){letMsgBoxVar=MsgBoxCls()MsgBoxVar.modalPresentationStyle=.CustomMsgBoxVar.preferredContentSize=CGSizeMake(200,400)self.presentViewController(M

iphone - 不能将参数传递给@selector 方法?

我目前正在尝试使用名为“X”的UIButton作为从View中删除Sprite的方法。基本上,我的代码是这样工作的,当一个Sprite被触摸时,一条消息被发送到传递已被选中的(Sprite*)sprite的委托(delegate)(ViewController)。在这种方法中,我在该Sprite之上绘制了一个UIButton。到目前为止,还不错。但是,问题是我现在希望我的UIButton在按下按钮时运行@selector以删除该Sprite。最初我试过这个:-(void)spriteSelected:(Sprite*)sprite{//delegatemethodimplementat

ios - UITextView 中的链接 : add and custom

1)我想添加一个指向UITextView的链接。我知道如果我把一个像http://stackoverflow.com这样的url在我的文本中,它会自动被识别为一个链接。但是有没有办法为一个词建立一个链接,而不仅仅是一个url?就像在HTML中一样:stackoverflow2)我想自定义这个链接,尤其是它的颜色、字体类型等。有没有办法只为链接添加一个属性?如果这一切都很复杂,您有没有更好的方法轻松完成?谢谢! 最佳答案 试试这个:self.myTextView.dataDetectorTypes=UIDataDetectorType

ios - PhoneGap 3.3.0 在 URLforFilesystemPath : selector 上崩溃

好的,所以我更新到Phonegap3.3.0。现在fileTransfer.download在iOS上运行时崩溃并显示消息:[CDVAssetLibraryFilesystemURLforFilesystemPath:]:unrecognizedselectorsenttoinstance0x14d14ea0'所以我去了CDVAssetLibraryFilesystem.h和CDVAssetLibraryFilesystem.m并添加了一个虚拟函数:-(NSString*)URLforFilesystemPath:(NSString*)path{returnnil;}这避免了崩溃但文件