草庐IT

NSInvalidArgumentException

全部标签

ios - 具有单个字典的 NSInvalidArgumentException

我正在尝试将NSDictionary数据放入tableView中。但是当只有一个值时我遇到了问题。在这里,有一个“上传”计数返回8(但它应该返回1),如果有多个“上传”计数返回“上传”的数量,因为它应该在第一种情况下。NSDictionary*jsonDictionary=aDicLog;NSMutableArray*tableData=jsonDictionary[@"multimedia"][@"uploads"][@"upload"];intcount=[tableDatacount];NSLog(@"COUNT:%i",count);表格-(NSInteger)tableVie

iphone - 使用从 JSON 数据中提取的值时出现 NSInvalidArgumentException

我正在尝试检索id的值:{"id":1,"name":"XYZ"}当我使用时:NSString*jsonData=[[NSStringalloc]initWithContentsOfURL:[NSURLURLWithString:url]];NSArray*myPeople=[jsonDataJSONValue];NSString*name=[[NSStringalloc]init];NSDictionary*person=[myPeopleobjectAtIndex:[indexPathrow]];name=[NSStringstringWithString:[personvalue

ios - UIAlertController 抛出 NSInvalidArgumentException

我正在尝试使用UIAlertController弹出警报,但我一直收到此错误:***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'Applicationtriedtopresentanilmodalviewcontrollerontarget.'if([InAppPurchaseVerifierhasSubscription]){NSUIntegerrow=[indexPathrow];NSDictionary*myDict=[[NSDictionaryalloc]initWithDic

ios - 将图像保存到相册时出现 NSInvalidArgumentException

我正在尝试下载图像文件并将其保存到如下相册dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{NSLog(@"DownloadingStarted");NSString*urlToDownload=@"http://wallpapercave.com/wp/66iglE0.jpg";NSURL*url=[NSURLURLWithString:urlToDownload];NSData*urlData=[NSDatadataWithContentsOfURL:url];if(urlDa

ios - 'NSInvalidArgumentException',原因 : '-[UINavigationController setMed:]: unrecognized selector sent to instance 0x746dda0'

我正在开发一款应用程序,可以帮助患有某些健康问题的人管理他们的药物。我创建了一个模式来添加有效的药物并使用核心数据保存新药物。我现在正试图让人们在保存药物后对其进行编辑。为此,我试图将药物的托管对象发送到“fibromappMedsEditViewController”,并在该类的viewDidLoad方法中分配信息。我一直收到这个错误:'NSInvalidArgumentException',reason:'-[UINavigationControllersetMed:]:unrecognizedselectorsenttoinstance0x746dda0'谁能告诉我我做错了什么?

iOS7 只返回 'NSInvalidArgumentException' ,原因 : '-[__NSCFString containsString:]:

这个问题在这里已经有了答案:NSStringcontainsStringcrashes(6个答案)关闭7年前。我正在使用一个图书应用程序,用户可以在其中点击一个词,然后将为他们播放包含该词的音频文件的一部分,并且该词将被突出显示。不幸的是,我现在尝试优化代码,从仅支持iOS8到支持iOS7,现在我遇到了一些错误。这是我得到的错误:2015-06-1010:42:50.455ChiShinfårenhund[63976:607]selected:sammen--(28B)2015-06-1010:42:50.456ChiShinfårenhund[63976:607]-[__NSCFSt

iphone - nsinvalidargumentexception' 原因 'an avplayeritem cannot be associated with more than one instance of avplayer'

我正在使用MPMoviePlayerController用于播放视频,在此我使用自定义搜索栏来跳转视频。但是当我不断地向前和向后搜索时,应用程序崩溃并抛出以下错误:nsinvalidargumentexception'reason'anavplayeritemcannotbeassociatedwithmorethanoneinstanceofavplayer'所以请提出建议。谢谢 最佳答案 有同样的问题,尝试在设置SourceType后设置ContentURL,如下所示,moviePlayerController_=[[MPMov

ios - 由于未捕获的异常 'NSInvalidArgumentException' 而终止应用程序 ...原因( key : networkCarrier)

我在运行iPad模拟器时在应用程序中遇到此错误***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'***setObjectForKey:objectcannotbenil(key:networkCarrier)'请帮我解决这个问题......它进入主线程returnUIApplicationMain(argc,argv,nil,NSStringFromClass([AppDelegateclass])); 最佳答案 添加异常断点。这将

ios - 初始化时出现 Firebase 错误 'NSInvalidArgumentException'

我有一个iOS项目,其中包括Firebase和GoogleToolboxForMacviaPods:target'MyApp'dopod'GoogleToolboxForMac','~>2.1'pod'GTMSessionFetcher','~>1.1'pod'gtm-logger','~>0.0.5'pod'Firebase/Core'pod'Firebase/Auth'pod'Firebase/Database'pod'Firebase/Messaging'end在AppDelegate中配置:@implementationAppDelegate-(instancetype)ini

ios - 使用 MapKit 时出现“NSInvalidArgumentException”

我正在使用iOS11MKMarkerAnnotationView创建一个带有map和100-200MKPointAnnotation的简单ViewController这是Controller的viewDidLoadoverridefuncviewDidLoad(){super.viewDidLoad()self.mapView.register(StationAnnotationView.self,forAnnotationViewWithReuseIdentifier:MKMapViewDefaultAnnotationViewReuseIdentifier)self.mapView