草庐IT

Instance

全部标签

ios - 为什么我必须在头文件中定义两次变量?

为什么必须在头文件中定义两次变量?这些变量之间有什么区别?第一个定义在这里:@interfaceMyController:UIViewController{NSIntegerselectedIndex;}第二个定义在这里:@property(nonatomic)NSIntegerselectedIndex; 最佳答案 Whatyou'reseeingwasrequiredinearlierversionsofObjective-C,butisn'tanymore.InthefirstversionsofObjective-Cused

ios - [__NSArrayM objectForKeyedSubscript :]: unrecognized selector sent to instance - source code and screenshot attached

在GitHub我有asimpleiPhoneapp,它从社交网络Mail.ru获取用户信息(通过使用OAuth):它确实获取并打印了信息,但随后崩溃了。作为iOS编程新手,我对下面的输出感到困惑(另请参阅thefulloutputatPasteBin):2014-01-2121:21:10.873oauthMailru[8228:3307]-[__NSArrayMobjectForKeyedSubscript:]:unrecognizedselectorsenttoinstance0x8a972902014-01-2121:21:10.875oauthMailru[8228:3307]

objective-c - 如何将 Class 对象转换为符合协议(protocol)

我正在尝试将Class对象转换为某个协议(protocol),该协议(protocol)定义了该类实现的类方法(+)。我知道如何使用(id)执行此操作,如概述inthisquestion,但我似乎无法找出Class对象的正确方法。基本场景如下。我有一个协议(protocol):@protocolProtocol+(id)classMethod:(id)arg;@end然后我有一个接受Class对象的函数,它知道有时符合基于另一个参数的协议(protocol)(这显然非常简化):-(id)someMethodWithClass:(Class)clsandUseArg:(BOOL)arg{

ios - NSError 版本 : message sent to deallocated instance

我在iOS7应用程序上遇到崩溃并出现以下错误:-[NSErrorrelease]:messagesenttodeallocatedinstance0x3c443fe0当我添加对以下方法的调用时引发错误:-(void)loadMessages:(NSString*)customerUID{NSString*formatUID=[NSStringstringWithFormat:@"%s%@%s","'",customerUID,"'"];formatUID=[formatUIDstringByReplacingOccurrencesOfString:@"'"withString:@"%2

ios - [GADSlot 状态] : unrecognized selector sent to instance in iphone

我是iOS开发新手。我正尝试在我的phonegap应用程序中在iOS中实现admob广告,所以我用谷歌搜索并找到了somveadmobwithoutplugin.完成所有程序后,我收到错误MyApp[2388:70b]*由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[GADSlot状态]:无法识别的选择器发送到实例0x10415920”**所以我用谷歌搜索并发现我必须更改其他链接器标志。(-ObjC)here我已经试过了,但还是不行。我遇到了这个错误。此解决方案也不适合我。[GADSlotstate]:unrecognizedsele

ios - HTTP 请求适用于 curl 但不适用于 iOS 或 Postman

***我对HTTP网络还很陌生。基本上,这是可行的:curl-k-L-v-XPOST--header"Content-Type:application/json"--header"Accept:application/json"--header'Authorization:OAuthsomeAccessToken'--header"Force-Instance-Url:websiteurl"--header"Force-User-Id:someUserId"--data"{}""websiteurl"但是,我似乎无法在Postman(chrome的HTTP测试插件)或我在iOS中制作的

iOS 6.1/7 - Cordova 3.1.0 + AngularJS - 单击/滚动到具有 [NSCFSet opacity] : unrecognized selector sent to instance 的 HTML/CSS View 时应用程序崩溃

我们看到了这个奇怪的错误,我在网上找不到任何东西。只有一个帖子没有答案或解决方法:https://groups.google.com/forum/#!topic/phonegap/7pRzASZpnQc我们使用Angular、Underscore、angular-route、angular-touch、angular-animate、CSSFlex布局和Cordova3.1.0构建了一个应用程序,并且在Android4.0++上一切都运行得很好。当我们将iOS转移到Mac上并添加iOS平台时,我们在XCode5中编译,当我们在6.1和7的iPhone模拟器中单击或尝试滚动时,应用程序在

ios - NSInvalidArgumentException "Unrecognized selector sent to instance"(使用 MPMoviePlayerController)

好吧,我在RootViewController和DetailViewController中有一个TableView,用于显示单条记录的信息。根据本指南,在详细信息页面中,我必须播放多媒体文件并且我正在使用框架MediaPlayer:http://www.techotopia.com/index.php/Video_Playback_from_within_an_iOS_4_iPhone_Application看起来一切正常,但是当我点击播放按钮时出现这个错误:-[DetailsViewControllerplaymovie]:unrecognizedselectorsenttoinst

ios - 如何定位 "unrecognized selector sent to instance"的错误在哪里?

有时我的应用程序会因为这个错误日志而崩溃:-[NSNullfloatValue]:unrecognizedselectorsenttoinstance0x3befd090我没有调用任何“floatValue”,那么我如何才能找到使应用程序崩溃的确切行?要重现崩溃需要一些我无法控制的网站的特定数据,那么有什么办法可以解决这个问题吗?谢谢。 最佳答案 最简单的方法是添加异常断点。转到后点Pane,然后单击左上角的opde+。在弹出窗口中选择AddExceptionBreakpoint。只需单击弹出窗口中的Done,您就可以在调试器抛出的

ios - Xamarin 绑定(bind)类别返回错误 : cannot declare instance members in a static class

我正在尝试绑定(bind)ReFrostedViewController到c#。我使用ObjectiveSharpie来生成界面。但是当我使用Xamarin编译它时,它返回错误。/REFrostedViewController_UIViewController.g.cs(10,10):ErrorCS0708:`REFrostedMenu.REFrostedViewController_UIViewController.__mt_FrostedViewController_var':cannotdeclareinstancemembersinastaticclass(CS0708)(RE