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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:52:05+00:00 2026-06-13T17:52:05+00:00

I was trying to use the objective c class extension header (only the .h)

  • 0

I was trying to use the objective c class extension header (only the .h) template that is new in Xcode. I dont know how to. Well i did File – > New File – > objective c class extension header and gave it a name “UICodeButton” and it inherits from UIButton. Now in that .h file i wrote @property (read write) NSInteger * cID; and just below that the implementation.So like this:

#import <UIKit/UIKit.h>

@interface UIButton ()
@property (readwrite) NSInteger * codeID;
@property (readwrite) NSInteger * pID;
@property (readwrite) NSString * cDesc;
@property (readwrite) NSString *pDesc;
@end

@implementation UIButton

@synthesize codeID;
@synthesize pID;
@synthesize cDesc;
@synthesize pDesc;
@end

i am using this in viewcontroller class..so i have (ViewCP.h and ViewCP.m) files. In the .m file i am importing #import “UIButton_UICodeButton.h”
Here in this file i am writing in the view did load the following

- (void)viewDidLoad
{
NSInteger tt = (NSInteger) S_B_T;
NSLog(@" the value is %d",tt);
 self.btnJobType.pID = &(tt);
}

Output:
the value is 555

i have S_B_T set as 555 in the define.
When it hits the self.btnJobType.pID= &(tt); It throws an error
* Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UIRoundedRectButton setPID:]: unrecognized selector sent to instance. So i am not writing something correct with it. Where should i write the set method for pID? I thought synthesize
pID would do the trick. But apparently not. So how do i proceed? i searched examples for the “objective c class extension” .But couldnt find any. If more information is needed please let me know. Thanks

  • 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-13T17:52:07+00:00Added an answer on June 13, 2026 at 5:52 pm

    You are prohibited from creating class continuations (e.g. @interface SOMEClass ()) on classes which you do not implement. Consequently, you cannot add fields/properties to framework classes. Of course, you can use categories to add either class methods or instance methods.

    Instead, you would create a subclass and add your properties/ivars there.

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

Sidebar

Related Questions

I'm trying to use an Objective-C class made in Python to do this but
I am trying to use the UINavigationController class in Objective-C, but I am having
I'm new to Objective C. I'm trying to use a protocol as I would
I'm trying to use a C++ member in an Objective-C++ class. Something like this:
I have a class that inherits from UIView However when trying to use the
I am trying to use Objective-C blocks in an iPhone 3.1.3 app but am
I'm trying to convert a piece of Objective-C code into C# for use with
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I am trying to write my first class in objective-c and i want to
i am writing my first custom class in objective-c and when i am trying

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.