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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:08:22+00:00 2026-06-09T07:08:22+00:00

I am having a problem with method naming. I want to follow the method

  • 0

I am having a problem with method naming. I want to follow the method naming format as seen in UITableViewDataSource:

- (int)numberOfSectionsInTableView:(UITableView *)tableView;

but my class name is much longer than ‘UITableView’ — it’s XYPagedContentScrollView where XY is the class prefix for the project. I have a delegate protocol:

@protocol XYPagedContentScrollViewDelegate <NSObject>
- (CGFloat)defaultPageHeightForPagedContentScrollView:(XYPagedContentScrollView *)pagedContentScrollView;
@end

and this method name looks ridiculously long. I know it is not a strict rule, but I just wonder is there any way to deal with the long name and still conform to Apple’s naming convention? Something like:

@protocol XYPagedContentScrollViewDelegate <NSObject>
- (CGFloat)defaultPageHeightForPagedContentScrollView:(XYPagedContentScrollView *)pagedContentSV;
@end

or even:

@protocol XYPagedContentScrollViewDelegate <NSObject>
- (CGFloat)defaultPageHeightForPCScrollView:(XYPagedContentScrollView *)pagedContentSV;
@end

Can anyone help?

  • 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-09T07:08:26+00:00Added an answer on June 9, 2026 at 7:08 am

    The length of a method is not limited by the language in any way, so feel free to make it as long as you want.

    It may look bad at first, but the more verbose it is, the less chance you have of conflicts later down the line.

    My rule is, if it looks like it could conflict with another method (especially if it’s a delegate method), it needs a longer name.

    Now, with that said, don’t make names ridiculously long,so that they are 100s of characters in length, like this:

    -(void) fooBarViewController:(FooBarViewController *) controller didTapRightMarginAtPoint:(CGPoint point) ofPage:(NSUInteger) page lengthHeld:(NSTimeInterval) tapLength fingers:(NSUInteger) fingerCount;
    

    Instead, consider wrapping it in a dictionary of the event details:

    -(void fooBarViewController:(FooBarViewController *) controller didTapMargin:(NSDictionary *) eventDetails; 
    
    /* eventDetails should contain the following information:
        which margin?
        touch location
        page index
        touch length
        finger count
     */
    

    This simplifies the method signature, and allows the receiver to only pull out the variables they need.

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

Sidebar

Related Questions

I'm having a problem with naming a method for a database application. In my
Hi I'm having a problem implementing this method. I have added using System.Management but
I created a class extending CursorAdapter, i am having problem on the bindView method.
I have following method that does some stringbuilding, but unfortunately i am having problem
i'm having problem when i want to get Parameter value from method POST or
i having a problem with a global method called returnDayNumber. If i call the
I am having a problem with the Document.SaveAs method in Word VBA with large
I'm having a problem with Python's subprocess.Popen method. Here's a test script which demonstrates
I'm having a problem de-compressing a ZIP file using Java. The method is below.
I am having a strange problem: In -(void)viewWillAppear:(BOOL)animated method I use: [[UIApplication sharedApplication] setStatusBarHidden:YES

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.