草庐IT

objc_overrelease_during_dealloc_e

全部标签

ios - 当 UIView dealloc 仍保留引用时删除所有当前动画

我有一个UIView子类,它在iOS项目中经常被分配和释放。我添加了[self.layerremoveAllAnimations];以尝试在销毁对象之前删除所有动画。偶尔,我仍然收到-[ClassNameanimationDidStop:finished:]:消息发送到已释放的实例。现在,删除动画不应该杀死那个委托(delegate)并阻止它尝试调用animationDidStop吗? 最佳答案 请看"Willsending-removeAllAnimationstoalayeralsopropagatetoallit'ssubla

iphone - 对象 dealloc 仅在 iOS 4.3 中崩溃

我试图弄清楚为什么在我的tableView中使用didSelectRowAtIndexPath推送viewController会导致iOS4.3崩溃,但在iOS5.0+中,它工作正常。它在我调用时崩溃了:self.customViewController=[[[CustomViewControlleralloc]initWithNibName:@"CustomViewController"bundle:nil]autorelease];第一次推送customViewController后的任何时间。这是我的相关代码:@property(nonatomic,retain)CustomVi

objective-c - Objective C - iOS - Dealloc 在 webViewDidFinishLoad 的执行过程中被调用

我在ios中遇到内存管理问题。问题是当我将具有webView的viewController推送到导航堆栈时,当我在加载webview之前单击返回时,我得到了exec_bad_access。在“A类”中,我正在创建一个NewViewController,然后将其推送到导航堆栈,然后释放它。所以在这里,我放弃了我的所有权。A类:-(void)onButtonClick{NewViewController*viewController=[[NewViewControlleralloc]init];[self.navigationControllerpushViewController:vie

objective-c - objective-c - dealloc 委托(delegate)上的调用方法

我有一个对象Person和协议(protocol)PersonDelegatePerson有一个@property(assign)iddelegate;我在代码中的某处:Person*newPerson=[[Personalloc]init];newPerson.delegate=theDelegate;...[theDelegaterelease];//anddealloc...nowPersonhassomenewinformationforthedelegate,soIcallinPerson[self.delegatedoSomething];但是我得到了EXC_BAD_ACC

objective-c - 方法仍在运行时调用 Dealloc

在我正在处理的一个项目中(我选择了这段代码并一直在尝试对其进行调试),我有一个被观察者调用的函数。观察者调用一个方法来更新要放在屏幕上的数据。进行此更新时(更新需要几秒钟),用户可以按导航栏上的“后退”按钮,这会导致发生dealloc调用。当该方法运行时,dealloc调用会释放所有ivar,最终会在该方法尝试访问ivar时导致EXC_BAD_ACCESS。更新方法的结构也包含在@synchronizedblock中。-(void)update{@synchronized(self){//somecodehere...//Alsoaccessivarshere.}}如何告诉Contro

iphone - SEGV_ACCERR 调用 [[NSNotificationCenter defaultCenter] removeObserver :self] in dealloc

我真的不知道这是怎么发生的。我有一个使用ARC的应用程序。大多数我的ViewController都注册了NSNotifications。所有注册都在主线程上完成。当发生内存警告时,用于每个不可见选项卡的导航Controller为nil',因此被释放。在这种情况下,一个导航Controller及其ViewController被释放,并且ViewController在其dealloc方法期间使应用程序崩溃。具体来说,它正在从所有NSNotificationCenter通知中删除自己。dealloc方法也在主线程中运行,所以我不明白这怎么可能是线程问题。崩溃的行是-[SearchTabVie

ios - 我在 MonoTouch 中对 UIButton 进行了子类化,但底层的 ObjC 类仍然是 UIButton

我有BackButton继承UIButton。它没有xib,非常简单并且包含一些我省略的布局逻辑。这是我声明它的方式:[Register("BackButton")]publicclassBackButton:UIButton{publicBackButton(stringtext,EventHandlerhandler):base(UIButtonType.Custom){TouchUpInside+=handler;SetTitle(text,UIControlState.Normal);}publicBackButton(IntPtrhandle):base(handle){}}

ios - 触摸 UITextField 时出现 "message sent to deallocated instance"崩溃

我有一个UIViewController的实现,其中viewDidLoad的代码如下:-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheviewfromitsnib.for(inti=0;i0)[selfgetTextField:i].text=speedDial;[selfgetTextField:i].returnKeyType=UIReturnKeyDone;[selfgetTextField:i].delegate=self;}}当我触摸屏幕上的UITextField时,应用程序

ios - UIActionSheet block View Controller dealloc

在我的Viewcontroller中,我点击一个按钮启动这个简单的代码-(IBAction)tapOnButton:(UIButton*)sender{UIActionSheet*act=[[UIActionSheetalloc]initWithTitle:@"test"delegate:selfcancelButtonTitle:@"aa"destructiveButtonTitle:@"bb"otherButtonTitles:@"cc",nil];[actshowFromRect:CGRectMake(50,50,100,100)inView:self.viewanimated:

iOS 10 [CFString 发布] : message sent to deallocated instance

最近,我将我的iPhone升级到iOS10。我在iPhone上安装了我的应用程序后,我发现当我在我的应用程序中点击一个tableView时,它肯定会崩溃。我在方法cellForRowAtIndexPath中做了一些断点,并在Diagnostics表中选择了ZombieObjects。但是消息[CFStringrelease]:messagesenttodeallocatedinstance0x17063b960总是出现在Debug区。此问题仅出现在iOS10Beta上,我不确定是否是iOS10Beta引起的问题。有没有人像我一样遇到这个问题?我将不胜感激。更新:当它返回cell时,崩溃