我在Objective-C中编写应用程序,我收到此错误:
MyApp(2121,0xb0185000)malloc:***对象0x1068310的错误:double free
***在malloc_error_break中设置断点以进行调试
当我发布一个NSAutoreleasePool并且我无法弄清楚我要发布两次的对象时,就会发生这种情况.
我该如何设置他的断点?
有没有办法知道这个"对象0x1068310"是什么?
我最近升级到iOS10和Xcode 8,之后一些以前正在运行的代码现在不再有效了.当代码运行时,应用程序崩溃并在控制台中显示以下错误消息:
malloc:*对象0x1700bea80的错误:没有分配被释放的指针*在malloc_error_break中设置一个断点来调试
我已经做了一些测试,并将错误缩小到以下代码中的'createNativeAd'函数.
任何人都可以看到为什么会抛出这个错误?
//
// FacebookAdPlugin.m
// TestAdMobCombo
//
// Created by Xie Liming on 14-11-8.
//
//
#import <FBAudienceNetwork/FBAudienceNetwork.h>
#import "UITapGestureRecognizer+Spec.h"
#import "FacebookAdPlugin.h"
#define TEST_BANNER_ID @"726719434140206_777151452430337"
#define TEST_INERSTITIAL_ID @"726719434140206_777151589096990"
#define TEST_NATIVE_ID @"726719434140206_777151705763645"
#define OPT_DEVICE_HASH @"deviceHash"
@interface FacebookAdPlugin()<FBAdViewDelegate, FBInterstitialAdDelegate, FBNativeAdDelegate, UIGestureRecognizerDelegate>
@property (assign) FBAdSize adSize;
@property (nonatomic, retain) NSMutableDictionary* nativeads;
- (void) __removeNativeAd:(NSString*)adId;
- (void) fireNativeAdLoadEvent:(FBNativeAd*)nativeAd;
@end
// ------------------------------------------------------------------
@interface UITrackingView : UIView
@end
@implementation UITrackingView
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
// Always ignore the …Run Code Online (Sandbox Code Playgroud)