草庐IT

local-class

全部标签

facebook - 父类(super class)没有空构造函数,但没有给出参数

我在我的应用程序中使用SpringSocial:3.2.0.RELEASE4.1.9.Final1.41.1.0.BUILD-SNAPSHOT1.1.0.BUILD-SNAPSHOT3.2.1.RELEASE3.1.3.RELEASE当我申请时privatefinalFacebookfacebook;@InjectpublicSearchController(Facebookfacebook){this.facebook=facebook;}到我的HomeController:@ControllerpublicclassHomeController{privatefinalFacebo

ios - 在初始化程序的父类(super class)中设置定义的属性

据我了解,在init中设置值的一般经验法则是直接使用ivars。例如@interfaceCustomClass@property(nonatomic,strong)NSString*name;@end然后:-(instancetype)initWithName:(NSString*)name{if(self=[superinit]){_name=name;}returnself;}到目前为止一切顺利。我对一个稍微不同的案例感兴趣。假设您正在对UIView进行子类化,并且在初始化程序中您想要为该子类分配背景颜色。这里,属性backgroundColor是在父类中定义的。我的问题是:在初始

objective-c - Objective-C : Any issues in having 2 NSNotifications set up in a single class?

我有一个实现了2个NSNotifications的类//Setupnotifications[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(getData)name:@"AnswerSubmitted"object:nil];[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(reloadTable)name:@"CommentSubmitted"object:nil];我只想检查是否可以在一个类(cla

objective-c - 苹果错误 - "_OBJC_CLASS_$_TFHpple"

我的应用程序使用Hpple。我包括了TFHpple.h、TFHpple.m、TFHppleElement.h、TFHppleElement.m、XPathQuery.h和XPathQuery.m。还包括${SDKROOT}/usr/include/libxml2和-lxml2。我有这么一小段代码:NSData*data=[[NSDataalloc]initWithContentsOfFile:@"example.html"];TFHpple*xpathParser=[[TFHpplealloc]initWithHTMLData:data];当我尝试运行它时,我收到此错误:"_OBJC_

ios - Objective-C : how to inherit category methods loaded in a parent class?

在我的项目中,我使用了NSObject+Properties.h类别(参见aqtoolkit:https://github.com/AlanQuatermain/aqtoolkit/blob/master/Extensions/NSObject%2BProperties.h)然后我有一个我声明为的类#import#import"NSObject+Properties.h"@interfaceGFDictionaryInitiable:NSObject...然后我有几个GFDictionaryInitiable的子类,例如GFRestaurant:#import#import"GFDic

ios - 所有子类的 class_copyPropertyList 也

这里是解释ListofclasspropertiesinObjective-C如何使用class_copyPropertyList在运行时获取类的所有属性。我已经测试过了,它工作正常。我注意到它只会从该类获取属性,而不是它的子类。代码:@interfaceJustForThisUT:NSObject@propertyNSUIntegerpublic_access;@end@interfaceJustForThisUT()@propertyNSUIntegerprivate_access;@end@implementationJustForThisUT@end@interfaceJust

ios - NSDate 是 MemberOfClass : [NSDate class] returns false?

这个问题在这里已经有了答案:usageofisMemberOfClass;returningfalse(3个答案)关闭7年前。这很奇怪。以下if语句失败。有什么问题吗?NSDate*date=[NSDatedate];if([dateisMemberOfClass:[NSDateclass]]){//Notexecuted.}

ios - 将 "class"消息发送到类的实例是什么意思

在Facebook登录代码中https://developers.facebook.com/docs/facebook-login/ios/advanced,他们要求我们执行以下序列通过Storyboard声明将要显示的View属于“FBSDKLoginButton”类。在应用委托(delegate)didFinishLaunchingWithOptions中执行以下行。[FBSDKLoginButtonclass];向对象发送“类”消息是什么意思? 最佳答案 用于调用FBSDKLoginButton的initialize方法。+(

ios - 覆盖函数错误!方法不会覆盖其父类(super class)中的任何方法

overridefunctouchesBegan(touches:Set,withEventevent:UIEvent){}overridefuncsupportedInterfaceOrientations()->Int{}这里我有一个错误。它说Methoddoesnotoverrideanymethodfromitssuperclass.多次出现,我无法修复。你知道吗? 最佳答案 错误来了,因为你的方法签名与实际的不同。您应该使用确切的方法签名进行覆盖(您应该使用Xcode中提供的自动完成功能或引用文档)TouchesBegan

objective-c - "This class is not key value > coding-compliant for the key previewB"但我已经删除了 previewB

我从nib文件中删除了一个按钮。我还删除了与该按钮关联的socket和IBAction。我已经清理了我的项目并卸载了该应用程序。但是我仍然收到以下错误消息:Terminatingappduetouncaughtexception'NSUnknownKeyException',reason:'[setValue:forUndefinedKey:]:thisclassisnotkeyvaluecoding-compliantforthekeypreviewB.'但是如果我在我的工作区中搜索previewB,我找不到任何东西。我已将其从ComposerViewController中删除。谢谢