Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7965313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:07:08+00:00 2026-06-04T06:07:08+00:00

So I have a very weird issue in which that when I run my

  • 0

So I have a very weird issue in which that when I run my app on the simulator and the iPad plugged in (running the app on the device with cable plugged) it all works just fine. However after running on the device after it’s plugged and I tried to use the app, it crashes.. tried looking at the device crash logs and I am seeing:

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x3672bf78 objc_msgSend + 16
1   App                     0x000ca834 -[AHAppImageData dealloc] (AHInstagramImageData.m:122)
2   libobjc.A.dylib                 0x3672d16e _objc_rootRelease + 30
3   CoreFoundation                  0x33d792e0 CFRelease + 88
4   CoreFoundation                  0x33d8ea30 -[__NSArrayM removeObjectAtIndex:] + 288
5   CoreFoundation                  0x33d84adc -[NSMutableArray removeAllObjects] + 64
6   App                     0x000f717e -[AHImageDataSource clearDataSource] (AHImageDataSource.m:53)
7   App                     0x000c0a36 __49-[AHMainViewController loadRequestWithURLString:]_block_invoke_0 (AHMainViewController.m:91)
8   libdispatch.dylib               0x32658c52 _dispatch_call_block_and_release + 6
9   libdispatch.dylib               0x3265aee0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 188
10  CoreFoundation                  0x33e032a6 __CFRunLoopRun + 1262
11  CoreFoundation                  0x33d8649e CFRunLoopRunSpecific + 294
12  CoreFoundation                  0x33d86366 CFRunLoopRunInMode + 98
13  GraphicsServices                0x37d68432 GSEventRunModal + 130
14  UIKit                           0x36820cce UIApplicationMain + 1074
15  App                     0x000b2860 main (main.m:16)
16  App                     0x000b2820 0xb1000 + 6176

Any idea why this is only happening on device and not when running the app when plugged in or simulator?

Based on the comment below, I am showing the code that is responsible for this:

 [[AHMyAppAPIClient sharedClient] getPath:requestURLPath parameters:nil 
             success:^(AFHTTPRequestOperation *operation, id response) {
                 [self.progressHUD_ hide:YES];


                 self.nextPaginationURL_ = [[response valueForKey:@"pagination"] valueForKey:@"next_url"];

                 [self.collectionView_.pullToRefreshView stopAnimating];
                 [[NSOperationQueue sharedOperationQueue] cancelAllOperations];


                 NSArray *arr = [response valueForKey:@"data"];
                 if ([arr count] > 0){
                     [[AHImageDataSource sharedDataSource] clearDataSource];
                 }


                for (NSDictionary * data in arr){
                     AHInstagramImageData * imgData = [[AHInstagramImageData alloc] initWithData:data];
                     [[AHImageDataSource sharedDataSource] addObject:imgData];
                     [imgData release];
                 }


                 dispatch_async(dispatch_get_main_queue(), ^{
                     [self.collectionView_ setContentOffset:CGPointMake(0, 0)];
                     [self.collectionView_ reloadData];

                 });

             }
             failure:^(AFHTTPRequestOperation *operation, NSError *error) {
                 [self.progressHUD_ hide:YES];
                 NSLog(@"Error fetching user data!");
                 NSLog(@"%@", error);      

             }];

This is how I am setting the data source:

extern NSString * const kClearDataSource;

@interface AHImageDataSource : NSObject
+ (AHImageDataSource *)sharedDataSource;
- (void) clearDataSource;
- (void) addObject:(id) object;
- (void) addObject:(id)object atIndex:(int) index;
- (int) count;
- (id) objectAtIndex:(int) index;
@end


NSString * const kClearDataSource = @"clearDataSource";

@interface AHImageDataSource()
{
    NSMutableArray * imageDataSource_;
}

@property (nonatomic, retain) NSMutableArray * imageDataSource_;

@end

@implementation AHImageDataSource
@synthesize imageDataSource_;

+ (AHImageDataSource *)sharedDataSource {
    static AHImageDataSource *_sharedClient = nil;
    static dispatch_once_t oncePredicate;
    dispatch_once(&oncePredicate, ^{
        _sharedClient = [[self alloc] init];
    });

    return _sharedClient;
}


- (id)init {
    self = [super init];
    if (!self) {
        return nil;
    }

    NSMutableArray * temp = [[NSMutableArray alloc] initWithCapacity:200];
    self.imageDataSource_  = temp;
    [temp release];


    return self;
}

-(void) clearDataSource
{
    if ([self.imageDataSource_ count] > 0){
        [self.imageDataSource_ removeAllObjects];
    }

}

- (void) addObject:(id) object
{
    [self.imageDataSource_ addObject:object];
}

- (void) addObject:(id)object atIndex:(int) index
{
    [self.imageDataSource_ insertObject:object atIndex:index];
}

- (int) count
{
    return [self.imageDataSource_ count];
}

- (id) objectAtIndex:(int) index
{
    if (index >= 0 && index < [self.imageDataSource_ count]){
        return [self.imageDataSource_ objectAtIndex:index];
    } 

    return nil;
}

- (void) dealloc
{
    [super dealloc];
    [imageDataSource_ release];
}

@end

EDIT:

It seems that the NSZombieEnabled seemed to hide this issue. When I disable NSZombieEnabled it crashes now on the simulator and device.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:07:10+00:00Added an answer on June 4, 2026 at 6:07 am

    I agree with Jim, looks like a double release.

    I would utilize the Instruments ‘zombie‘ profile to test for this situation. It can only be done in the simulator, but should show you exactly what is being double released.

    Once that is 100% clear, it is typically pretty easy to resolve the situation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this weird crash that only happens when running the app on the
I have a very, very weird effect here using Monotouch 5.2.5 running my app
Im having a very weird issue. I have a normal ajax call that upload
I have very weird issue. I have method that called by wcf that hosted
I have a very weird issue. I have a UserControl that has some controls
I have this very weird issue that I cant really get why it's not
Ok, very very weird issue here. I have a sub nav menu that links
It is very weird, and I don't have any idea what is the issue!
I have a very weird problem.That my web project deployed to the Weblogic 10.0,Monday
I have a very weird issue with Firefox only (works fine with IE &

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.