草庐IT

instance-methods

全部标签

iPhone/iOS : Will there be called any method if a UIView is added as a subview

如果我像这样添加一个View作为subview[self.viewaddSubview:mySubview];是否会在mySubview上调用任何方法,我可以重写以添加一些自定义行为? 最佳答案 将View添加到(新的)父View触发器-(void)willMoveToSuperview:(UIView*)newSuperview和-(void)didMoveToSuperview。参见UIViewReference了解更多。 关于iPhone/iOS:Willtherebecalled

iPhone/iOS : Will there be called any method if a UIView is added as a subview

如果我像这样添加一个View作为subview[self.viewaddSubview:mySubview];是否会在mySubview上调用任何方法,我可以重写以添加一些自定义行为? 最佳答案 将View添加到(新的)父View触发器-(void)willMoveToSuperview:(UIView*)newSuperview和-(void)didMoveToSuperview。参见UIViewReference了解更多。 关于iPhone/iOS:Willtherebecalled

iphone 通知结果为 "unrecognized selector sent to instance..."

简而言之,我在ClassA(在viewDidLoad中)注册了以下NSNotification监听器:[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(playSong)name:@"playNotification"object:nil];我在ClassA.h中声明了选择器:-(void)playSong:(NSNotification*)notification;实现如下:-(void)playSong:(NSNotification*)notification{NSString*theTi

iphone 通知结果为 "unrecognized selector sent to instance..."

简而言之,我在ClassA(在viewDidLoad中)注册了以下NSNotification监听器:[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(playSong)name:@"playNotification"object:nil];我在ClassA.h中声明了选择器:-(void)playSong:(NSNotification*)notification;实现如下:-(void)playSong:(NSNotification*)notification{NSString*theTi

ios - [__NSDictionaryI setObject :forKey:]: unrecognized selector sent to instance

我正在尝试将“dateTime”添加到我的字典中,定义如下:SymptomRanking:{5111ef19253b4a9150000000=1;5111f029253b4add4e000000=1;5111f036253b4a123d000001=1;5111f045253b4a404f000000=1;}NSLog(@"dateselected:%@",[[self.datePickerdate]description])[self.resultssetObject:[[self.datePickerdate]description]forKey:@"dateTime"];应用程序

ios - [__NSDictionaryI setObject :forKey:]: unrecognized selector sent to instance

我正在尝试将“dateTime”添加到我的字典中,定义如下:SymptomRanking:{5111ef19253b4a9150000000=1;5111f029253b4add4e000000=1;5111f036253b4a123d000001=1;5111f045253b4a404f000000=1;}NSLog(@"dateselected:%@",[[self.datePickerdate]description])[self.resultssetObject:[[self.datePickerdate]description]forKey:@"dateTime"];应用程序

ios - NS无效参数异常 : "Unrecognized selector sent to instance"

我遇到了一个我并不真正理解原因的问题。异常没有给我理解问题的线索。我想根据myArray中给定的数据修改我界面中UILabel的内容。但是,正如我在函数“cellForRowAtIndexPath”中指定的行,程序会触发异常。这个问题是什么原因造成的?@property(strong,nonatomic)NSMutableArray*myArray;//-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheview.[myArrayaddObject:@{@"field1":@"myfiel

ios - NS无效参数异常 : "Unrecognized selector sent to instance"

我遇到了一个我并不真正理解原因的问题。异常没有给我理解问题的线索。我想根据myArray中给定的数据修改我界面中UILabel的内容。但是,正如我在函数“cellForRowAtIndexPath”中指定的行,程序会触发异常。这个问题是什么原因造成的?@property(strong,nonatomic)NSMutableArray*myArray;//-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheview.[myArrayaddObject:@{@"field1":@"myfiel

ios - Xcode 6.1 : Multiple methods named 'count' found with mismatched result, 参数类型或属性

我在构建应用程序时发现多个名为“count”的方法具有不匹配的结果、参数类型或属性错误。该应用程序在32位中运行良好。我已根据Appleguideline将其更改为64位.我已经提到了这个Link但没有得到任何帮助。我已经在模拟器上的多个设备上测试了应用程序。在32位上运行良好,但在64位上提示错误。为什么会这样?-(void)serviceSuccessFulForPatientSelect:(id)response{[selfhideOverlay];if([responseisKindOfClass:[NSArrayclass]]){if([responsecount]>0){i

ios - Xcode 6.1 : Multiple methods named 'count' found with mismatched result, 参数类型或属性

我在构建应用程序时发现多个名为“count”的方法具有不匹配的结果、参数类型或属性错误。该应用程序在32位中运行良好。我已根据Appleguideline将其更改为64位.我已经提到了这个Link但没有得到任何帮助。我已经在模拟器上的多个设备上测试了应用程序。在32位上运行良好,但在64位上提示错误。为什么会这样?-(void)serviceSuccessFulForPatientSelect:(id)response{[selfhideOverlay];if([responseisKindOfClass:[NSArrayclass]]){if([responsecount]>0){i