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

  • Home
  • SEARCH
  • 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 976503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:45:23+00:00 2026-05-16T03:45:23+00:00

For some or other reason when I call the init method and try and

  • 0

For some or other reason when I call the init method and try and set the property it never seems to work:

//This is where I am setting the value
Hotel *newHotel = [[Hotel alloc]initWithCoordinate: coordinate 
                   hotelId:[NSNumber numberWithInt:1234]];


//This is the implementation of the method I am calling
- (id)initWithCoordinate:(CLLocationCoordinate2D)c hotelId:(NSNumber *)hId
{
   self = [super init];
   coordinate = c;

   hotelId = hId; //When I access this property afterwards its always out of scope

   return self;
}

//This is the interface
@interface Hotel : NSObject <MKAnnotation>
{
  NSNumber *hotelId;
}

@property (nonatomic, retain) NSNumber *hotelId;

- (id)initWithCoordinate:(CLLocationCoordinate2D)c hotelId:(NSNumber *)hotelId;

@end
  • 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-16T03:45:24+00:00Added an answer on May 16, 2026 at 3:45 am

    I changed the type to NSString in desperation and that worked. Please vote to close if you see fit but none of the suggestions worked.

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

Sidebar

Related Questions

For whatever reason, ThreadPool 's QueueWorkItem doesn't return an IAsyncResult or some other handle
I've looked for some other articles on this problem and even tried some of
This is related to some other questions, such as: this , and some of
Background: JEdit (and some other text editors as well) support a feature called Multiple
According to google and some other sources (e.g., http://www.enterprisedt.com/publications/oracle/result_set.html ), if I want to
I'd like to enable/disable some other controls based on how many items are in
Other than standard OO concepts, what are some other strategies that allow for producing
Is there a free API or some other way to determine what carrier a
Or should you always create some other lock object?
Without resorting to using an ActiveX or some other kind of client side coding:

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.