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 1108277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:03:30+00:00 2026-05-17T02:03:30+00:00

I have an NSObject set up to control various elements on my screen. I

  • 0

I have an NSObject set up to control various elements on my screen.

I initialize the class inside my View Controller like this:

self.pageSetupClass = [[PageSetup alloc] set:self.pageID];

In IB I have added my NSObject object and linked a button to an IBOutlet on it. I’ve also linked it to an IBAction found in the object. When I click this button the app crashes and I get this error:

2010-09-23 15:33:11.640 BookTest10[49139:207] *** -[NSCFDictionary clickSoundByte:]: unrecognized selector sent to instance 0x4b10bc0
2010-09-23 15:33:11.641 BookTest10[49139:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary clickSoundByte:]: unrecognized selector sent to instance 0x4b10bc0'
2010-09-23 15:33:11.642 BookTest10[49139:207] Stack: (
    42195024,
    43352876,
    42203739,
    41666166,
    41662962,
    2915566,
    3413054,
    3422400,
    3417197,
    3042792,
    2934339,
    2965976,
    51188092,
    41474204,
    41470120,
    51181725,
    51181922,
    2958194
)
terminate called after throwing an instance of 'NSException'

There is nothing in the function at the moment so it must be the calling that crashes it…right?

If you need me to post more code I certainly can. If you have any ideas I’m all ears. Thank You

Edit:

This is the contents of the function set called out when I initialize the PageSetup object:

-(PageSetup*) set:(int) i {
    self = [super init];
    if(self) {
        self.iD=i;

        self.pageSetupFile = [[NSBundle mainBundle] pathForResource:@"PageSetup" ofType:@"plist"];
        self.pageSetupArray = [[NSMutableArray alloc] initWithContentsOfFile:self.pageSetupFile];
        self.pageInfo = [self.pageSetupArray objectAtIndex:self.iD];

        [self initializeSoundBytes];
        [self initializeAnimations];
        [self initializeToys];

        NSLog(@"Page Setup Initializing: %@", self.pageInfo);
        return self;
    }
    return self;
}

Another Edit:

I set my set function to return (void) and no longer initialize it using init.

I now receive this error message:

2010-09-23 17:10:05.096 BookTest10[50519:207] *** -[UITouch clickSoundByte:]: unrecognized selector sent to instance 0x4b1b580
2010-09-23 17:10:05.097 BookTest10[50519:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UITouch clickSoundByte:]: unrecognized selector sent to instance 0x4b1b580'
2010-09-23 17:10:05.099 BookTest10[50519:207] Stack: (
    42166352,
    43324204,
    42175067,
    41637494,
    41634290,
    2886894,
    3384382,
    3393728,
    3388525,
    3014120,
    2905667,
    2937304,
    51159420,
    41445532,
    41441448,
    51153053,
    51153250,
    2929522
)
terminate called after throwing an instance of 'NSException'

Final Edit:

I had forgotten to connect my NSObject to the File’s Owner in IB.

  • 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-17T02:03:30+00:00Added an answer on May 17, 2026 at 2:03 am
    self.pageSetupClass = [[PageSetup alloc] set:self.pageID];
    

    What does set: return? Is that a method of your PageSetup class? Does it return self?
    Because apparently you’re assigning pageSetupClass to whatever set: returns…
    Unless set: returns self, you should try this:

    self.pageSetupClass = [[PageSetup alloc] init];
    [self.pageSetupClass set:self.pageID];
    

    Edit:

    ok, if you added the object in IB, the object was already instantiated for you when you loaded the nib, and the IBAction and IBOutlet connections have already been made.
    When you do self.pageSetupClass = ..., you’re setting pageSetupClass to a new instance, and that probably leaves the button with a bad target for its IBAction.
    If the object was instantiated from the nib, and you have a reference to it in pageSetupClass from a IBOutlet, then just set whatever you want in the object, no need to alloc a new one.

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

Sidebar

Related Questions

I have a class like this: @interface MyCollection : NSObject { NSMutableDictionary *data; }
Say I have a class like this: @interface MyAwesomeClass : NSObject { @private NSString
I have a simple Answer class that looks like this: @interface Answer : NSObject
I have this code: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { [NSObject cancelPreviousPerformRequestsWithTarget:self]; [self performSelector:@selector(scrollViewDidEndScrollingAnimation:) withObject:nil afterDelay:0.01];
Say I have this Class @interface CustomClass : NSObject @property (nonatomic, strong) NSArray *
I have a classes: BasicObject : NSObject AdvObject : BasicObject in other class i
I have an object from a NSObject class that I call brand and has
I have following simple class: @interface Article: NSObject { NSString *title; } @property (copy,
I have the following simple class definition: //mycommon.h @interface CurrentPath : NSObject @property (nonatomic,
I have a very basic data class that is subclassed from NSObject. I declare

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.