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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:40:06+00:00 2026-05-14T02:40:06+00:00

I am working with MapKit and want to be able to add a (NSString

  • 0

I am working with MapKit and want to be able to add a (NSString *)itemTag value to each of my annotations. I have created myAnnotiation.m and myAnnotation.h

I tried adding itemTag to the myAnnotation.h/m but when I try to access currentAnnotation.itemTag within my main code, it says “itemID not found in protocols” – so I went to the MapKit.Framework and into MKAnnotation.h. I added (NSString *)itemID, but when I save the .h file in the Framework, it changes the file’s icon and doesn’t appear to by jiving with everything else.

Any help or links to help would be greatly appreciated. I am not even sure if I’m on the right path here, but Googling “modify iphone sdk framework” does not turn up much.

  • 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-14T02:40:07+00:00Added an answer on May 14, 2026 at 2:40 am

    Why are you trying to modify the framework? You should be defining itemID as a property or instance variable (or both) in myAnnotation.h. You say that currentAnnotation.itemTag
    didn’t work; for that to work, you need to have itemTag defined as a property of whatever class currentAnnotation belongs to.

    Changing the header file for the framework won’t recompile it, so you won’t be able to get that to work.

    EDIT: Here’s an example.

    In MyAnnotation.h:

    @interface MyAnnotation : NSObject <MKAnnotation> {
        NSString *itemID;
        // Other instance variables
    }
    
    @property (nonatomic, retain) NSString *itemID;
    
    // Class and instance methods.
    
    @end
    

    In MyAnnotation.m:

    @implementation MyAnnotation
    
    @synthesize itemID;
    
    // Your code here.
    
    @end
    

    The @property call defines the property and the @synthesize call will create setters and getters for you (methods to set and retrieve the value of itemID). In MyAnnotation.m, you can use self.itemID or [self itemID] to get the value of itemID, and you can use self.itemID = @"something" or [self setItemID:@"Something"] to set the value.

    EDIT 2:

    When you get currentAnnotation, if the compiler doesn’t know that the annotation is an instance of your MyAnnotation class, it won’t know about itemID. So, first ensure that you’ve included this line at the beginning of your .m file:

    #import MyAnnotation.h
    

    That wil ensure that the compiler knows about the class. When you use currentAnnotation, you cast it as an instance of MyAnnotation like so:

    (MyAnnotation*)currentAnnotation
    

    That should quiet down the warnings.

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

Sidebar

Related Questions

I am working on a Mapkit App and I want to show annotations according
I am working with Mapkit and I have to show annotations in the map
I am working with MapKit and annotations in iOS. Right before the annotations are
i'm NEW TO XCODE, working with mapkit and annotations, howver after building and running
I am currently working on an application involving mapkit. I would like to add
Working on dom html . I want to convert node value to string: $html
I have an app that deals with mapkit and annotation and it's working fine,
Working on a project where I want to be able to delete a dynamic
I am working on a sample map kit app for iOS. I have everything
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports

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.