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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:54:18+00:00 2026-05-28T07:54:18+00:00

The discussions I found about setting NSString constants made me code it the following

  • 0

The discussions I found about setting NSString constants made me code it the following way:

.h file:

extern NSString * const kSectionHeaders;

.m file:

NSString * const kSectionHeaders = @"header";

As the program runs, it has to test words from a text file against a series of NSString constants.

I read memory comparison should work when setting function like stated above:

if (property == kSectionHeaders) {...}

Doesn’t work tough 🙁
The following works, but it was described as a bad solution (slower, what else?):

if ([property isEqualToString:kSectionHeaders]){...}

I feel I’ve done something wrong. But can’t see what!
Please help 🙂
Thanks!
J.

  • 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-28T07:54:19+00:00Added an answer on May 28, 2026 at 7:54 am

    Remember variable names are just pointers to objects in memory.

    The == operand compares the pointers. It will not be true unless it is comparing the exact same object in memory.

    isEqualToString: is your best bet. Don’t worry too much about speed. The devices are plenty fast enough to do the comparison in the blink of an eye. The things that really take noticible time are drawing on screen and reading from disk.

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

Sidebar

Related Questions

Although I found many answers and discussions about this question, I am unable to
I searched this topic and found several discussions. What I didn't like about those
I was reading about Clojure and found a discussion about Java not supporting tail
I've found a few articles & discussions on how to import data from Access
From discussions I've had about language design, it seems like a lot of people
Following the discussions here on SO I already read several times the remark that
I have seen a lot of discussions going on and people asking about DataGrid
I have problem with circle-rectangle intersection.Though A number of discussion i found about it
I found very much about the benefits of using a newer .Net version for
I found that running Math.Log10(double.Epsilon) will return about -324 on machine A, but will

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.