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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:03:56+00:00 2026-05-22T21:03:56+00:00

Usually When i want a object to be accesed by many different event calls

  • 0

Usually When i want a object to be accesed by many different event calls i just declare it in the h file.

However im making a app where i need to allow the user to create UILabels and drag and drop them where they want. So i have the code to make the labels and a alertview where they change the text.

-(IBAction)AddText{
UITextField *TextView;
TextView = [[UITextView alloc] initWithFrame:CGRectMake(40.0, 40.0, 40, 40)];
[self.view addSubview:TextView];

Which works however i need the user to be able to create many textviews which each have a unique name and a way i can reference them later such as TextView.text, doing it this way always creates a object named TextView and i can only reference it from his event, otherwise its undeclared.

Im really stuck at how i would go about doing this if anyone could help it would be great!,

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-22T21:03:57+00:00Added an answer on May 22, 2026 at 9:03 pm

    You could think about adding the newly created label to a NSMutableArray or, better, to a NSMutableDictionary. This latter solution gives you the possibility of creating a dictionary in which each label can be referred to using a string key. If you put such a dictionary in your .h file you’ll be fine, I think.

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

Sidebar

Related Questions

I often need to pass methods from objects into other objects. However I usually
How many vptrs are usually needed for a object whose clas( child ) has
I need to detect if an object is transient..if it is not I want
when i want to get a view object delared in xml,usually i have two
I need to add functionality to my web service calls so object translation and
Let's say I want to create an Object called 'Vertex'. Usually, in Java I
I want my AltGr key to behave exactly like left Alt . Usually, I
I usually edit RUBY files in VIM. I want the methods(def...end) to fold. Could
I want some code to be triggered every second. Usually, I'd create a Timer
When I want to get to a web, I usually have to do code

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.