草庐IT

button_sent

全部标签

ios - 为什么我在比较 NSString 时会出错? (-[__NSCFNumber isEqualToString :]: unrecognized selector sent to instance)

我有一个NSMutableArray(_theListOfAllQuestions),我正在用文件中的数字填充它。然后我将该数组中的对象与qNr(NSString)进行比较,但出现错误。我什至将数组转换为另一个NSString,_checkQuestions,只是为了确保我正在比较NSStrings。我也测试了使用item进行比较。-(void)read_A_Question:(NSString*)qNr{NSLog(@"read_A_Question:%@",qNr);intcounter=0;for(NSString*itemin_theListOfAllQuestions){NS

iOS SDK : Moving the button into the center of screen by code

我想通过代码将一个按钮移动到屏幕中央。我在某处看到它只有几行代码,但找不到它们。 最佳答案 这使按钮在其父View中居中:CGRectbounds=button.superview.bounds;button.center=CGPointMake(CGRectGetMidX(bounds),CGRectGetMidY(bounds)); 关于iOSSDK:Movingthebuttonintothecenterofscreenbycode,我们在StackOverflow上找到一个类似的

iOS SDK : Moving the button into the center of screen by code

我想通过代码将一个按钮移动到屏幕中央。我在某处看到它只有几行代码,但找不到它们。 最佳答案 这使按钮在其父View中居中:CGRectbounds=button.superview.bounds;button.center=CGPointMake(CGRectGetMidX(bounds),CGRectGetMidY(bounds)); 关于iOSSDK:Movingthebuttonintothecenterofscreenbycode,我们在StackOverflow上找到一个类似的

iOS 和 Stackmob - [NSNull 长度] : unrecognized selector sent to instance

在我的iOS应用程序中,我尝试更新数据库中的用户信息(使用Stackmob),但我不断收到“无法识别的选择器发送到实例”。-(IBAction)save:(UIButton*)sender{NSFetchRequest*fetchRequest=[[NSFetchRequestalloc]initWithEntityName:@"User"];NSPredicate*predicte=[NSPredicatepredicateWithFormat:@"username==%@",self.username];[fetchRequestsetPredicate:predicte];[se

iOS 和 Stackmob - [NSNull 长度] : unrecognized selector sent to instance

在我的iOS应用程序中,我尝试更新数据库中的用户信息(使用Stackmob),但我不断收到“无法识别的选择器发送到实例”。-(IBAction)save:(UIButton*)sender{NSFetchRequest*fetchRequest=[[NSFetchRequestalloc]initWithEntityName:@"User"];NSPredicate*predicte=[NSPredicatepredicateWithFormat:@"username==%@",self.username];[fetchRequestsetPredicate:predicte];[se

iphone - 只有 iOS 7 崩溃 [NSNull intValue] : unrecognized selector sent to instance

我想从JSON服务获取数据。从JSON值获取数据时,只有iOS7版本崩溃。它从下面的JSON服务返回:{voteAverageRating=0;voteCount=0;}我的代码intvoteCount=[listDicobjectForKey:@"voteCount"]intValue];_LB_voteNumber.text=[NSStringstringWithFormat:@"(%i)",voteCount];它适用于iOS5、5.1、6.0、6.1,但它仅在iOS7版本上崩溃。它给出了这个错误:0x00098117_mh_execute_header[NSNullintVal

iphone - 只有 iOS 7 崩溃 [NSNull intValue] : unrecognized selector sent to instance

我想从JSON服务获取数据。从JSON值获取数据时,只有iOS7版本崩溃。它从下面的JSON服务返回:{voteAverageRating=0;voteCount=0;}我的代码intvoteCount=[listDicobjectForKey:@"voteCount"]intValue];_LB_voteNumber.text=[NSStringstringWithFormat:@"(%i)",voteCount];它适用于iOS5、5.1、6.0、6.1,但它仅在iOS7版本上崩溃。它给出了这个错误:0x00098117_mh_execute_header[NSNullintVal

ios - Bar Button Item 中只有一个 tab bar controller 导航栏

我有一个带有4个ViewController的标签栏Controller,并且在导航Controller中有这个标签栏Controller。我只想为标签栏Controller的一个特定ViewController显示一个UIBarButtonItem。我尝试使用以下内容if(tabBarController.selectedViewController==customTourViewController){[tabBarController.navigationItemsetRightBarButtonItem:done];}但是按钮没有显示。如果我将每个ViewController都

ios - Bar Button Item 中只有一个 tab bar controller 导航栏

我有一个带有4个ViewController的标签栏Controller,并且在导航Controller中有这个标签栏Controller。我只想为标签栏Controller的一个特定ViewController显示一个UIBarButtonItem。我尝试使用以下内容if(tabBarController.selectedViewController==customTourViewController){[tabBarController.navigationItemsetRightBarButtonItem:done];}但是按钮没有显示。如果我将每个ViewController都

objective-c - NSInvalidArgumentException',原因 : '-[__NSCFString isFileURL]: unrecognized selector sent to instance 0x712e450'

我是iPhone应用程序开发的新手。当我运行一个示例项目时,我解析了一个xml提要并在表格View中显示内容和图像,我得到了这个错误-"NSInvalidArgumentException',reason:'-[__NSCFStringisFileURL]:unrecognizedselectorsenttoinstance0x712e450'"它仅在我尝试在UITableViewCell中显示图像时发生。我用于从url获取图像的代码是-if([elementNameisEqualToString:IMAGE]){NSURL*imageUrl=[attributeDictobjectF