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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:26:44+00:00 2026-05-27T21:26:44+00:00

DataController.h @class Play; @interface DataController : NSObject – (unsigned)countOfList; – (Play *)objectInListAtIndex:(unsigned)theIndex; @end DataController.m

  • 0

DataController.h

@class Play;

@interface DataController : NSObject 

- (unsigned)countOfList;
- (Play *)objectInListAtIndex:(unsigned)theIndex;

@end

DataController.m

#import "DataController.h"
#import "Play.h"


@interface DataController ()
@property (nonatomic, copy, readwrite) NSMutableArray *list;
- (void)createDemoData;
@end


@implementation DataController

@synthesize list;


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

Why do you think that @interface is defined twice? And also whats the meaning of ()? Shouldn’t there be a class name maybe the super class between the parentheses?

  • 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-27T21:26:44+00:00Added an answer on May 27, 2026 at 9:26 pm

    In general, the syntax @interface ClassName (CategoryName) is for declaring a category. Categories are a way to add methods to a class. You can do this even with classes for which you don’t have the source code. See more here.

    @interface ClassName () (with nothing in the parentheses) is essentially a special case of a category and is called a class extension. The primary difference between a class extension and a category is that methods declared in a class extension must be defined/implemented in the main @implementation block for the class, or you’ll get a compiler warning. Methods in a regular category can be defined in an external @implementation block.

    The most common use for class extensions (as in this case) is for declaring private methods. Objective-C doesn’t have support for true private methods, so an easy way to accomplish the same basic end result is to declare private methods in a class extension at the top of the .m file. Since these methods aren’t defined in the .h file, other classes won’t see them, and you’ll get a compiler warning if you try to use them outside the class they belong to.

    You can also redeclare a readonly @property as readwrite in a class extension. That way, code external to the class implementation can only read a property’s value, but inside the class’s implementation, you can write to it too. This is the only case where it’s allowable to redeclare an @property.

    (Note that class extensions were a new feature in Objective-C 2.0 and aren’t available on Mac OS X 10.4 and earlier.)

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

Sidebar

Related Questions

i have a simple question : if we don't use here the dataController property
I've got following classes: public class Container { private String name; private Data data;
The goal is to have a singleton data controller class called FetchData.h/.m that pulls
I have a DataController for my ViewController, which handles loading data from the internet.
I have some class initialized in Appdelegate, but when I get this class instance
I use a TcxExtLookupComboBox from Devexpress and try to implement a custom datasource. I
My line ctx.SaveChanges(); in my controller DutyController.cs throws the following exception when I try
like the topic states - i'm trying to update a NSManagedObject in another thread.
our main client solution has 111 projects. When I first started on this team
I have got an application, that is getting data via XML-files. During the parsing-part

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.