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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:59:55+00:00 2026-05-23T14:59:55+00:00

OK this should be an easy one but still im breaking my head here:

  • 0

OK this should be an easy one but still im breaking my head here:

In my root view controller I have a NSString called “entry” and is working perfectly. I NSLogged it and it works.
I have another class called ´ParseOperation´ and in it i have a NSStringcalled “localEntry” and im trying to send to “ParseOperation” the variable “entry” from “RootViewController” this is my RootViewController code for that:

RootViewController.m  

ParseOperation *parseOperation = [[ParseOperation alloc] init];  
parseOperation.localEntry = entry;

It just doesn’t work. If I NSLog in my ParseOperation.m it returns “null”, but if i do it on my RootViewController it returns the correct variable. and yes i did imported the ParseOperation.h

Here is the ParseOperation code (only the part that uses localEntry):

ParseOperation.h  

@interface ParseOperation : NSOperation <NSXMLParserDelegate>
{
    NSString        *localEntry;
}
@property (nonatomic, retain) NSString *localEntry;

@end

ParseOperation.m  

@synthesize localEntry;

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
                                    namespaceURI:(NSString *)namespaceURI
                                   qualifiedName:(NSString *)qName
                                      attributes:(NSDictionary *)attributeDict
{

    //NSLog(@"entrada %@",localEntry);
    if ([elementName isEqualToString:localEntry])
    {
        self.workingEntry = [[[AppRecord alloc] init] autorelease];
    }
    storingCharacterData = [elementsToParse containsObject:elementName];
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
                                  namespaceURI:(NSString *)namespaceURI
                                 qualifiedName:(NSString *)qName
{
    if (self.workingEntry)
    {
        if (storingCharacterData)
        {
            NSString *trimmedString = [workingPropertyString     stringByTrimmingCharactersInSet:
                                   [NSCharacterSet whitespaceAndNewlineCharacterSet]];
            [workingPropertyString setString:@""];  // clear the string for next time
            if ([elementName isEqualToString:kIDStr])
            {
                self.workingEntry.appURLString = trimmedString;
            }
            else if ([elementName isEqualToString:kNameStr])
            {        
                self.workingEntry.appName = trimmedString;
            }
            else if ([elementName isEqualToString:kImageStr])
            {
                self.workingEntry.imageURLString = trimmedString;
            }
            else if ([elementName isEqualToString:kArtistStr])
            {
                self.workingEntry.artist = trimmedString;
            }
        }
        else if ([elementName isEqualToString:localEntry])
        {
            [self.workingArray addObject:self.workingEntry];  
            self.workingEntry = nil;
        }
    }
}

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-23T14:59:56+00:00Added an answer on May 23, 2026 at 2:59 pm

    To answer my own question I just had to connect the viewController and the ParseOperation programmatically by adding the following to my header in the parseOperation:

    @class RootViewController;
    
    RootViewController *rootViewController;
    
    @property (nonatomic, retain) IBOutlet RootViewController *rootViewController;
    

    And the following on the m file of the ParseOperation:

    #import "RootViewController.h"
    
    rootViewController = [[RootViewController alloc]init];
    

    After that in the parse operation I just declared:

    localEntry= rootViewContoller.entry;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this should be a very easy one, but I cant find the
This should be an easy one, but I am having a moment. Why does
This should be easy, but I am missing something. I have the following form:
This should be and easy one for the LINQ gurus out there. I'm doing
This should be easy (at least no one else seems to be having a
This one should be easy. I just can't figure out what to search for...
Should be an easy one. I thought, from reading this blog post that I
This should be easy to find out but I can't seem to find it
It seems this should be easy but I'm having a lot of difficulty using
OK, I'm feeling like this should be easy but am obviously missing something fundamental

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.