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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:02:18+00:00 2026-06-11T15:02:18+00:00

I’m developing an app to create as many notes as you want, something like

  • 0

I’m developing an app to create as many notes as you want, something like post-it’s. I’m adding views and putting the into a viewArray

- (IBAction)add:(id)sender {
NoteViewController *noteController = [[NoteViewController alloc]initWithNibName:@"NoteViewController" bundle:nil];

[self.view addSubview:noteController.view];
UIView *myAddedView = (UIView *)[noteController view];

[viewArray insertObject:myAddedView atIndex:0];
noteController.myTextView.tag = viewArray.count;}

As you can see, I’m adding tags to textviews in the noteController even after the cast to addviews so I can get the textview text by the time I want to export the content from all textviews created.

- (IBAction)export:(id)sender{
NSData *myData;
NSInteger *cont = (NSInteger *)viewArray.count;
for (UIView *subviewa in [self.view subviews])
{
    if(cont>0)
        if (subviewa.tag == 0)
        myData = (NSData *)[subviewa viewWithTag:1];

        NSLog(@"%@", myData);
    }
    cont--;
 }

When I clic Export I get

<UITextView: 0x684a130; frame = (6 0; 84 92); text = 'my text'; clipsToBounds = YES;
 autoresize = RM+BM; tag = 1; layer = <CALayer: 0x684a310>; contentOffset: {0, 0}>

As far as I know, this is a nsdata. I’ve tried JSON, casting… and when I try to access text property the app crashes. I need help to access textviews texts from all objects in viewarray. Thank you in advance for your help.

  • 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-06-11T15:02:19+00:00Added an answer on June 11, 2026 at 3:02 pm

    Any view has it’s subviews array. So when you add textview to view, and there is no other objects in this view, you car refer to textview like this:

    [subviewa.subviews objectAtIndex:0];
    

    And get text property like this:

    [(UITextView *)[subviewa.subviews objectAtIndex:0] text]; 
    

    Code of export: method to return all views from array and display their textviews text:

    - (IBAction)export:(id)sender{
        for (UIView *subviewa in [self.view subviews])
        {
            NSLog(@"SUBVIEW %@", (NSData *)subviewa);
            NSLog(@"TEXTVIEW TEXT IN SUBVIEW %@", [(UITextView *)[subviewa.subviews objectAtIndex:0] text]);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm trying to create an if statement in PHP that prevents a single post
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.