草庐IT

property_selector

全部标签

iOS @property 什么时候应该在 .h 中,什么时候在 .m 中

我知道其他类可以调用的方法应该在头文件中..但是我有点困惑什么时候@property应该在头文件中,什么时候应该在实现文件中。您是如何做出这个决定的,它有什么不同? 最佳答案 您希望向其他类公开的任何属性都放在.h文件中。“私有(private)”属性(双关语)进入匿名类别或类扩展中的实现文件。例如,您还可以将属性的.h版本设置为只读,将.m版本设置为可读写。具有在私有(private)类别中定义的属性的实现文件@interfaceCPClassFileName()@property(nonatomic,retain)NSStrin

iPhone:IBAction 导致 “Unrecognized Selector Sent to Instance” 错误

我正在开发一个iPhone应用程序,您可以在其中登录服务器,在您获得验证后,我的应用程序会将您带到另一个ViewController,您可以在其中使用按钮发送您的GPS位置。出于某种原因,当我在下一个ViewController中按下按钮时,出现此错误:Administrator[3148:c07]-[UIViewControllerSendGPS:]:unrecognizedselectorsenttoinstance0x88b58d02013-01-0816:01:21.662Administrator[3148:c07]***Terminatingappduetouncaught

ios - NSInvalidArgumentException',原因 : '-[__NSArrayI length : unrecognized selector sent to instance

当我从谷歌寻找答案时,这里的大部分答案都说你正试图在不受支持的NSArray上使用长度。这里的问题是我什至没有在我的代码中使用任何NSArray或长度。我有一个NSMutableArray*filteredContent;其中filteredContent将包含来自plist的字典。在tableView的单元格上写入cell.textLabel.text之前,一切都运行良好。用NSLog检查,内容确实是一个数组。这就是我尝试编写单元格文本的方式:cell.textLabel.text=[[self.filteredContentobjectAtIndex:indexPath.row]v

ios - NSManagedObject setter 给我 [ MyObject setName :]: unrecognized selector sent to instance

我通过xcode编辑器菜单创建了一个NSManagedObject。我的对象只有一个属性“名称”。当我尝试设置属性时,我得到“[MyObjectsetName:]:unrecognizedselectorsenttoinstance”MyObject*thing=[MyObjectobjectFromJSONDictionary:obj];thing.name=obj;我已检查我的属性“名称”在CD中与在我的类(class)中相同。我的接口(interface)属性也是一样的。和我的动态属性是一样的。@property(nonatomic,retain)NSString*name;@d

iphone - 关键帧动画期间应用程序崩溃 : -[NSConcreteValue doubleValue] unrecognized selector

由于此原因应用程序崩溃-[NSConcreteValuedoubleValue]:unrecognizedselectorsentto我的项目中使用了以下代码,我进行了很多搜索,我得到了转换的原因,但是如果我将transform.scale替换为它,那么动画就会改变帮帮我![viewContent.layeraddAnimation:[selfgetShakeAnimation]forKey:@"transform.scale"];-(CAAnimation*)getShakeAnimation{CAKeyframeAnimation*animation=[CAKeyframeAnim

ios-copyWithZone :]: unrecognized selector sent to instance

我想创建一个单元格对象的副本。以下是我的代码,但检索copyWithZone:]:unrecognizedselectorsenttoinstanceCollectionCell*cell=[cvdequeueReusableCellWithReuseIdentifier:@"KCell"forIndexPath:indexPath];if(kCell==nil){cell=[selfgetiPadCell:indexPathcv:cvdict:dict];kCell=cell;returncell;}else{cell=[kCellcopy];returncell;}

ios - 返回 "unrecognized selector sent to instance"错误的 NSDictionary 查询

我正在我的iOS应用程序中设置以下功能:-(IBAction)nextButton:(id)sender{if(self.itemSearch.text.length>0){[PFCloudcallFunctionInBackground:@"eBayCategorySearch"withParameters:@{@"item":self.itemSearch.text}block:^(NSString*result,NSError*error){NSLog(@"'%@'",result);NSData*returnedJSONData=result;NSError*jsonerror

hadoop - M/R 作业提交失败,错误为 : Could not find Yarn tags property > (mapreduce. job.tags)

我在运行map/reduce作业时遇到以下异常。我们通过oozie提交map/reduce作业。FailingOozieLauncher,Mainclass[org.apache.oozie.action.hadoop.JavaMain],main()threwexception,CouldnotfindYarntagsproperty(mapreduce.job.tags)java.lang.RuntimeException:CouldnotfindYarntagsproperty(mapreduce.job.tags)atorg.apache.oozie.action.hadoop

java - 如何使用 log4j.properties 使日志文件根据大小旋转并压缩

主题-RollingFileAppender,以及如何压缩旋转的文件RollingfileAppender根据文件大小旋转日志文件。MaxFileSize表示文件的最大大小,而MaxBackupIndex表示要保存在日志文件夹中的文件数量。示例属性文件如下:1log4j.rootLogger=INFO,fileLogger2log4j.appender.fileLogger=org.apache.log4j.RollingFileAppender3log4j.appender.fileLogger.layout=org.apache.log4j.PatternLayout4log4j.

java - 在 java 代码中设置 job.properties 文件以启动 oozie 操作

我正在尝试使用Java代码启动oozie操作。使用命令行时,我们通过“-configjob.properties”指定属性文件,它知道选择哪个工作流程。我们如何在java代码中定义“job.properties”文件来完成相同的任务?conf.setProperty(OozieClient.APP_PATH,"hdfs://clusterdb05.com:8020/user/apps/merge-logs/workflow.xml");conf.setProperty("jobTracker","jobtracker.com:8021");conf.setProperty("nameN