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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:02:30+00:00 2026-06-10T09:02:30+00:00

The following codes crashed: @interface AppDelegate (PrivateMethods) @property (nonatomic, strong) NSString * name; @end

  • 0

The following codes crashed:

@interface AppDelegate (PrivateMethods)

@property (nonatomic, strong) NSString * name;

@end

@implementation AppDelegate

- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    self.name = @"foobar";
    ...

Error is:

'-[AppDelegate setName:]: unrecognized selector sent to instance 0x6d73df0'

When I change

@interface AppDelegate (PrivateMethods)

to

@interface AppDelegate ()

Then it is okay, what would be the reason?

Update: As answered below, since I must use class extension for this purpose, now this question become: Is the use of class extension to declare private methods acceptable?

e.g.

@interface AppDelegate ()

- (void) start;
@property (nonatomic, strong) NSString * name;

@end
  • 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-10T09:02:31+00:00Added an answer on June 10, 2026 at 9:02 am

    Class extension is basically used to enhance the public property variable. Suppose you have exposed readonly object, or getter method of any variable, then you have make the same object as readwrite in extension.Whereas Category is only used to enhance the method/functionality of class.

    check this

    @interface MyClass : NSObject
    // property here is used as readonly.
    @property (retain, readonly) float value;
    @end
    
    // Private extension, typically hidden in the main implementation file.
    @interface MyClass ()
    @property (retain, readwrite) float value;
    @end
    

    or

    @interface MyClass : NSObject
    // here we have exposed getter method of private instance.
    - (float) value;
    @end
    
    // Private extension, typically hidden in the main implementation file.
    @interface MyClass ()
    @property (retain, strong) float value;
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following code: @interface ClassA : NSObject @property (nonatomic, copy) void(^blockCopy)(); @end @implementation
Following is my code: .h file: #import Foundation/Foundation.h @interface GObject:NSObject{ NSTimer* m_Timer; } @property(nonatomic,
I have this following codes: @implementation MyImageView @synthesize image; //image is a UIImage -
I have the following codes <div class=row-fluid> <div class=span6><img src = <?php echo $photo
I have used the following codes: bar([c f], 0.1,'stacked'); and bar( [c , f
I am trying the following codes to suffle the elements of an ArrayList -
i have the following codes in SQL XML . I need to insert a
Please Check the following codes & please tell me about the error(s) I have
I am using the following codes, to replace a JLabel each 0.5 seconds, with
I'm using Eclipse, and it is perfectly happy with the following code: public interface

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.