本文介绍了无法创建本机类型"NSObject"的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在执行下面的代码时遇到此错误
I'm getting this error on executing the code below
无法创建本机类型为" NSObject "的实例,可以通过将Class.ThrowOnInitFailure设置为false来忽略此条件
failed to create an instance of native type 'NSObject' it is possible to ignore this condition by setting Class.ThrowOnInitFailure to false
var alert=new UIAlertView("Error","Something missing !"
,new UIAlertViewDelegate(),"OK",null);
仅对于最新的iOS 6模拟器,我会收到此错误.对于我的iOS 5设备,它可以按预期运行.
I get this error only for the latest iOS 6 simulator. For my iOS 5 device it works as expected.
推荐答案
尝试一下:
var alert = new UIAlertView ("Error", "Something missing !", null, "OK");
这篇关于无法创建本机类型"NSObject"的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!