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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:40:40+00:00 2026-06-05T19:40:40+00:00

I have a class which represents exam,it can start/reset/pause exam, so the methods look

  • 0

I have a class which represents exam,it can start/reset/pause exam, so the methods look like:

- (void)startExam;
- (void)resetExam;
- (void)pauseExam;

But as far as I know, if the method name ends with some noun, it should have argument for that noun, something like:

- (void)startExam:(Exam *)exam;

But in this case, the class is named ‘Exam’, so when the class is used, people would know that the object is an Exam, so it seems the better way of naming is:

@interface Exam : NSObject
- (void)start;
- (void)reset;
- (void)pause;
@end

so I can use is as:

Exam *exam = [[[Exam alloc] init] autoreleased];
[exam start];

which looks better than:

[exam startExam];

or

[exam examStart];

But this does look TOO generic, and I feel risky as NSObject(or whatever super class) may have methods of the same name added in the future, for example, Java Object has notify, notifyAll, wait, and subclass should not overwrite these for other purposes. Is this also true in Objective C?

So what is the best naming convention in this case?

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-05T19:40:42+00:00Added an answer on June 5, 2026 at 7:40 pm

    start/pause/reset belong to the class Exam. So I would go for:

    @interface Exam : NSObject
    - (void)start;
    - (void)reset;
    - (void)pause;
    @end
    

    When I am using an object of the Class Exam I just read it in my head:

    [myExam start]; 
    

    For me makes more sense than this:

    [myExam startExam];
    

    As for the one that has an input parameter:

    - (void)startWith:(Exam *)exam;
    

    PS: But I could see myself doing what Dirk suggested.

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

Sidebar

Related Questions

I have a abstract class which represents an immutable value. Like strings, the immutable
Say I have a class which represents a person, a variable within that class
I have a Location class which represents a location somewhere in a stream. (The
I have a class, called Media, which represents coredata. If something changes in my
I have class which have one public method Start , one private method and
I have class Employee which is something like this. class Emp { int EmpID;
I have a class which .def ines the __getitem__ , __setitem__ methods (and keys
I'm using ASP.NET MVC and I have a model class which represents a peice
I have a Vector class which represents a 2D vector. It is templated to
I have a class PlayingCard which represents a particular playing card. I have another

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.