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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:12:23+00:00 2026-06-03T10:12:23+00:00

I want a macro that I can use like this: CREATE_URL(@{SOME-TOKEN}/some/url/path); The macro should

  • 0

I want a macro that I can use like this:

CREATE_URL(@"{SOME-TOKEN}/some/url/path");

The macro should then replace my token analogue to the following call:

NSString *initialURL = @"{SOME-TOKEN}/some/url/path";
[initialURL stringByReplacingOccurencesOfString:@"{SOME-TOKEN}" withString:@"http://server.com"]

So I have defined my macro like this, which does not work unfortunately:

#define CREATE_URL(url) [##url stringByReplacingOccurencesOfString:@"{SOME-TOKEN}" withString:@"http://server.com"];

I the two errors when using the macro:

Missing '[' at start of message send expression
Pasting formed '[@', an invalid preprocessing token
  • 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-03T10:12:24+00:00Added an answer on June 3, 2026 at 10:12 am

    Why not this?

    #define CREATE_URL(url) [url stringByReplacingOccurencesOfString:@"{SOME-TOKEN}" withString:@"http://server.com"]
    

    It should work fine… why the ## and the ;?

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

Sidebar

Related Questions

I want to have a macro dbtest that can be used like this: (dbtest
I want a debug function-macro that works like this: int myVar = 5; PRINTVAR(myVar);
I have a macro that looks like this: #define coutError if (VERBOSITY_SETTING >= VERBOSITY_ERROR)
I'm using excel 2007 and i'm adding a macro that looks something like this
I want to create a C macro that creates a function with a name
I want to add a subroutine into my Word 2007 macro that will take
I want to connect to DB2 from excel macro...This is my code, but it
Heads up: This is a weird question. I've got some really useful macros that
I can use __LINE__ as a method parameter just fine, but I would like
I am creating a string that is a formula. Like in here (this is

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.