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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:06:23+00:00 2026-05-24T23:06:23+00:00

I have the weirdest error! In Xcode I have a singleton with the following

  • 0

I have the weirdest error! In Xcode I have a singleton with the following defined (file is: MyGizmoClass.h):

NSString            *plistPath;

NSString            *dataDomain;
NSString            *pathToChatScript;
NSString            *pathToUpdates;

and

@property (nonatomic,retain) NSString *plistPath;

@property (nonatomic,retain) NSString *dataDomain;
@property (nonatomic,retain) NSString *pathToChatScript;
@property (nonatomic,retain) NSString *pathToUpdates;

I have a Constants.h file (which I #import early in my .pch file) that contains:

#define kUserPlistName  @"userPlist.plist"

#define kDataDomain @"http://www.jann.com/";
#define kPathToChatScript @"path/top/chatscript.cgi";
#define kPathToupdates @"pathtoupdates/";

Okay, so far, so good.

The order, in my .pch file is as such:

#import "Constants.h"
#import "MyGizmoClass.h"    

and then later in the Constants.h file I do this:

#import "FileFunctions.h"

Okay, fine setup. This should work, a singleton with 3 NSStrings. But when I try to do this in FileFunctions.h I get a weird error in the compiler:

FileFunctions.h

[myGizmoClass setDataDomain: kDataDomain];
[myGizmoClass setPathToChatScript: kPathToChatScript];
[myGizmoClass setPathToUpdates: kPathToupdates];

[myGizmoClass setPlistPath:[[myGizmoClass libraryDir]  stringByAppendingPathComponent:kUserPlistName]];

Compiler Results

Expected ‘]’ before ;

What is going on? I get this 3 times … one for setDataDomain, one for setPathToChatScript and one for setPathToUpdates. But no error on kUserPlistName. When I do this in FileFunctions.h then all is well:

[myGizmoClass setDataDomain: @"http://www.jann.com/"];
[myGizmoClass setPathToChatScript: @"path/top/chatscript.cgi"];
[myGizmoClass setPathToUpdates: @"pathtoupdates/"];

Compiler Results

All is well.

I cannot figure this out. Later (4 lines below this) I do the following:

[myGizmoClass setPlistPath:[[myGizmoClass libraryDir]  stringByAppendingPathComponent:kUserPlistName]];

And THAT works! Why would subbing kUserPlistName work, yet kDataDomain wouldn’t? This is probably SO easy…but I cannot, for the life of me, see it!

ADDENDUM

I have found that EVERYWHERE I use kDataDomain, setPathToChatScript or setPathToUpdates in the code I get the same

Compiler Results

Expected ‘]’ before ;

error! 🙁

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-05-24T23:06:24+00:00Added an answer on May 24, 2026 at 11:06 pm

    Don’t include the semicolon in your #defines.

    The compiler substitutes in exactly what you have there, so these would be equivalent:

    [myGizmoClass setPathToUpdates: kPathToupdates];
    [myGizmoClass setPathToUpdates: @"pathtoupdates/";]; // obvious syntax error
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the weirdest error I have ever encountered. This MVC web project was
I am seeing the weirdest bug with the following code. I have a PathGeometry
I have been having the hardest time trying to resolve the weirdest error when
I know this one is the weirdest of all weird questions I have asked
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have the weirdest problem. I am implementing a simple gallery with a use
I have a weird error that I cannot seem to find any documentation or
i have encountered a really weirdest bug in eclipse, i would love if someone
I just found a solution to one of the weirdest bug i have ever

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.