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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:42:10+00:00 2026-06-02T23:42:10+00:00

I get a weird semantic issue: missing ‘[‘ at start of message send expression

  • 0

I get a weird semantic issue:

missing ‘[‘ at start of message send expression

and a parse issue:

Expected ‘]’

in NSLog line of AFURLConnectionOperation.m:

 @catch(NSException *e) { caughtException = e; }
 if(caughtException) {
   NSLog(NSLocalizedString(@"Unhandled exception on %@ networking thread: %@, userInfo: %@", nil), NSStringFromClass([self class]), caughtException, [caughtException userInfo]); 
 }
 [exceptionPool drain];

after I added

#define NSLog(__FORMAT__, ...) TFLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

to my project’s pre-compile file: Proj-Prefix.pch

How can I fix this error?
I searched but without any workaround except comment out the NSLog line..

Thanks in advance!


EDIT:

NSLog(@"%@", [NSString stringWithFormat:NSLocalizedString(@"Unhandled exception on %@ networking thread: %@, userInfo: %@", nil), NSStringFromClass([self class]), caughtException, [caughtException userInfo]]);

and

NSLog(@"Unhandled exception on %@ networking thread: %@, userInfo: %@", NSStringFromClass([self class]), caughtException, [caughtException userInfo]);

are okay.

But why the original one does not? 😕

  • 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-02T23:42:12+00:00Added an answer on June 2, 2026 at 11:42 pm

    Think about the macro expansion. In your macro, you’re trying to use string literal concatenation:

    (@"%s [Line %d] " __FORMAT__)
    

    But the value of the __FORMAT__ parameter is NSLocalizedString(@"Unhandled exception on %@ networking thread: %@, userInfo: %@", nil), which is not a string literal. The expansion looks like this:

    (@"%s [Line %d] " NSLocalizedString(@"Unhandled exception on %@ networking thread: %@, userInfo: %@", nil))
    

    Clearly that’s erroneous syntax. The error is made extra-inscrutable because NSLocalizedString is itself a macro (defined in NSBundle.h), so the full expansion looks like this:

    (@"%s [Line %d] " [[NSBundle mainBundle] localizedStringForKey:(@"Unhandled exception on %@ networking thread: %@, userInfo: %@") value:@"" table:nil])
    

    By the way, you should not use __FORMAT__ as your macro parameter name. All identifiers that begin with two underscores are reserved. (Also reserved are all identifiers that begin with an underscore followed by a capital letter.)

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

Sidebar

Related Questions

Is this possible? i get weird error message when i put char as the
Hello I get a weird error in this code: function validateForm(aform) { var s=;
I'm trying to use Asp.NET WebAPI module but I get a weird error. When
i'm trying to get started with silverlight 2. i have a weird bug. every
I've a weird string escape problem with my PHP script. I'm trying to get
I'm trying to make LocationManager work and get weird security exception. When I run
I am pulling in an RSS feed using PHP. I get weird characters in
In IntelliJ I get this weird error when I try to compile. Cannot find
Following my previous question ( Why do I get weird results when reading an
EDIT: What's weird is even if I comment out <?php get_footer(); ?> it still

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.