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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:09:41+00:00 2026-06-11T00:09:41+00:00

Categories question: I’d like to place a category on NSURL that, among doing other

  • 0

Categories question:

I’d like to place a category on NSURL that, among doing other things, overrides the query method to be able to provide a query string from a URL that is not RFC 1808 compliant. Is it legal to do something like this in my category:

- (NSString *)query //real NSURL method
{
     if (stringIsRFC1808) //want to get the default implementation
          return [super query];
     else 
          return somethingElse; //want to get my custom implementation
}

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-11T00:09:43+00:00Added an answer on June 11, 2026 at 12:09 am

    The code as-is is not valid, because you’re using [super query] – that doesn’t quite do what you expect it to do so. Categories aren’t superclasses. Here [super query] will try to invoke - [NSObject query] – BOOM an unrecognized selector error. If you’re using categories to extend a class, you won’t be able to call the original method – if you don’t need this functionality, then using categories is fine, if you do need it, however, you should consider subclassing, (even better composition for Foundation objets!) or using the Objective-C runtime to perform method swizzling – this way you’ll have access to the original implementation of the method.

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

Sidebar

Related Questions

Newbie question URL: /categories/new?parent_id=6 Controller: def new @category = Category.new( :parent_id => params[ :parent_id
Following on from this question: Display ALL categories that a product belongs to in
This is an additional question regarding sub categories. The current problem is that when
I am designing a database that contains questions, answers and categories. One question can
<p>Title: <xsl:value-of select=$section_map /></p> Note the above section_map variable is printing value /form/medical-info/question-categories/question-category .
Short question: How should product categories that appear under multiple categories be managed? Is
My question is that with example. I have to show all categories of books
that´s my first question in stackoverflow . I have two MYSQL tables: categories and
Question: I have a category listing which some categories have children, I am trying
I have a question about Mage::registry and categories: I'm a on a category page,

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.