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

  • Home
  • SEARCH
  • 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 3930758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:17:14+00:00 2026-05-19T23:17:14+00:00

I have created new class which handles button. It does nothing (just for test,

  • 0

I have created new class which handles button. It does nothing (just for test, method is clean). It is deallocated just after launch and when I click button app crashes with EXC_BAD_ACCESS.
This is my .h file of the class:

@interface pagechanger : NSObject {
}
- (IBAction)gonext:(id)sender;
@end

Implementation file:

@implementation pagechanger
- (IBAction)gonext:(id)sender{
// blablabla, some code which is even hasn't been read, breakpoints were not touched.
}

-(void)dealloc{
    NSLog(@" pc released");
    [super dealloc];
}
@end

Console listing (NSZombieEnabled is turned on):

[11724:207] * -[pagechanger
performSelector:withObject:withObject:]:
message sent to deallocated instance
0x4b35900

This is what “info malloc-history address” returns:

Alloc: Block address: 0x04b35900 length: 16
Stack - pthread: 0xa0180540 number of frames: 36
    0: 0x9154e103 in malloc_zone_calloc
    1: 0x9154e05a in calloc
    2: 0x105cd0f in _internal_class_createInstanceFromZone
    3: 0x105f87d in class_createInstance
    4: 0xe2cff8 in +[NSObject(NSObject) allocWithZone:]
    5: 0xe2cdfa in +[NSObject(NSObject) alloc]
    6: 0x4ab205 in -[UIClassSwapper initWithCoder:]
    7: 0x5919e4 in UINibDecoderDecodeObjectForValue
    8: 0x592693 in -[UINibDecoder decodeObjectForKey:]
    9: 0x4aaf43 in -[UIRuntimeConnection initWithCoder:]
   10: 0x4ab4b1 in -[UIRuntimeEventConnection initWithCoder:]
   11: 0x5919e4 in UINibDecoderDecodeObjectForValue
   12: 0x5912dc in UINibDecoderDecodeObjectForValue
   13: 0x592693 in -[UINibDecoder decodeObjectForKey:]
   14: 0x4aa200 in -[UINib instantiateWithOwner:options:]
   15: 0x4ac081 in -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:]
   16: 0x364a94 in -[UIViewController _loadViewFromNibNamed:bundle:]
   17: 0x362709 in -[UIViewController loadView]
   18: 0x2607 in -[ZoomingPDFViewerViewController loadView] at /Users/ruzard/Desktop/ZoomingPDFViewer/Classes/ZoomingPDFViewerViewController.m:92
   19: 0x3625e3 in -[UIViewController view]
   20: 0x2231 in -[ZoomingPDFViewerAppDelegate application:didFinishLaunchingWithOptions:] at /Users/ruzard/Desktop/ZoomingPDFViewer/Classes/ZoomingPDFViewerAppDelegate.m:65
   21: 0x2b51fa in -[UIApplication _callInitializationDelegatesForURL:payload:suspended:]
   22: 0x2b755e in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:]
   23: 0x2c1db2 in -[UIApplication handleEvent:withNewEvent:]
   24: 0x2ba202 in -[UIApplication sendEvent:]
   25: 0x2bf732 in _UIApplicationHandleEvent
   26: 0x183ea36 in PurpleEventCallback
   27: 0xeea064 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
   28: 0xe4a6f7 in __CFRunLoopDoSource1
   29: 0xe47983 in __CFRunLoopRun
   30: 0xe47240 in CFRunLoopRunSpecific
   31: 0xe47161 in CFRunLoopRunInMode
   32: 0x2b6fa8 in -[UIApplication _run]
   33: 0x2c342e in UIApplicationMain
   34: 0x21c4 in main at /Users/ruzard/Desktop/ZoomingPDFViewer/main.m:54
   35: 0x2155 in start

I am trying to modificate Apple’s code (ZoomingPDFViewer). I couldn’t find any way to add new buttons there… so I made a new window programmatically and added subview into it. However I don’t know whether this code can help or not…

    UIWindow* window = [UIApplication sharedApplication].keyWindow;
if (!window) {
    window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 980, 500, 500)];
    window.hidden = NO;
    [window becomeKeyWindow];
    window.windowLevel = UIWindowLevelStatusBar;
}
[window addSubview:myheader];

You can get orginal code here.

How can I get my method working without EXC_BAD_ACCESS?

  • 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-05-19T23:17:15+00:00Added an answer on May 19, 2026 at 11:17 pm

    the solution comes down to this:

    what is responsible for managing the lifetime of the pagechanger instance in this case? when using target/action, the target is not retained by the invoker. therefore, you’ll need something to hold a reference of the pagechanger while the target is registered with the invoker.

    =====

    as far as specifics: there’s not enough relevant code posted to begin diagnosing the details of your specific issue.

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

Sidebar

Related Questions

Does a new SessionFactor y and Session object have to be created for each
We have created a new List View Style that shows thumbnails from a picture
I have created a new solution with a minimal amount of code that represents
I m new to use ankhSVN and having issues. I have created some new
I've just create a new MVC project, and have made no changes at all,
i am making a app which takes photo on button click i have camera.java
PROBLEM: I have a Child class which uses DataContractSerialization and raises a Changed event
How to create new PCL file similar to existing MS doc. I have MS
I have some code that creates a new site in SharePoint. Upon browsing to
I have an NSArray and I'd like to create a new NSArray with objects

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.