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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:51:23+00:00 2026-05-28T03:51:23+00:00

Q)is it a requirement that all interface classes inherit from super class? Q) In

  • 0

Q)is it a requirement that all interface classes inherit from super class?
Q) In the code below – from iOS5 on wards with ARC do i still need to do (player is NSMUtable array) unless i’m wrong i believe after ARC we dont need to keep ref count:

//is this required then?
Player *player = [[Player alloc] init];

{players = [NSMutableArray arrayWithCapacity:20];
Player *player = [[Player alloc] init];
player.name = @"Bill Evans";
player.game = @"Tic-Tac-Toe";
player.rating = 4;
[players addObject:player];
player = [[Player alloc] init];
player.name = @"Oscar Peterson";
player.game = @"Spin the Bottle";
player.rating = 5;
[players addObject:player];
player = [[Player alloc] init];
player.name = @"Dave Brubeck";
player.game = @"Texas Hold’em Poker";
player.rating = 2;
[players addObject:player];}

Q) what is the rule around making interface file and implementation file sub class of i.e. in java everything is derived from OBject class so do we declare NSObject for both implementaiotn / interface classes or its not needed and where else i would define this?

Q) which one is recomended solution
A: Player *player = [[Player alloc] init];
OR
B: Player *player = [[Player new]; //unless this is illegal?

Q) is ARC only available on Mac OS X apps or also on iOS i.e. iphone / touch etc or we still have to do manual memory management?

Q) can singleton pattern be applied to Objective-c,cocoa touch iphone apps?

  • 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-28T03:51:23+00:00Added an answer on May 28, 2026 at 3:51 am
    • you have to do [[Player alloc] init] to instantiate the object
    • always derive your classes from NSObject, unless you want to specifically derive from some other class
    • [[Player alloc] init] is equivalent to [Player new], but the former is preferred, since you can easily swap for another initializer, such as [[Player alloc] initWithName:@"John Doe"]
    • ARC is available both on iOS and on Mac, where it should be used instead of garbage collection, which is somewhat being deprecated
    • I don’t see why you wouldn’t be able to create singletons on iOS
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a specific requirement that all children of a particular JComponent have double
In our project we have requirement that, after receiving sms message from third party
I have a number of class, all with exactly the same interface. This interface
I have a requirement to create some objects that implement a given interface, where
Interface vs. Base class is still a fairly gray area to me. I'm reading
It is a requirement that all .net Controls are created on the main thread,
I have a requirement that a SPList should be sorted by the Priority field
I have a unique requirement that I hope is possible with LINQ to SQL.
I have a requirement that when the user clicks on [X] button of the
I have a requirement that I want to check the request headers and according

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.