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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:40:14+00:00 2026-06-18T07:40:14+00:00

I am using NSoperation in Initiating request to server.Pullparser will be called and it

  • 0

I am using NSoperation in Initiating request to server.Pullparser will be called and it will initiate a o/p & i/p stream.In connecitonDidRecievedata I am writing data coming from server to oStream.Imeediately I have to call custom method instead of letting the parser start parsing.How to handle this case.How to handle the ostream call to parser and handle my custom method first then in my custom method I have to call the parser.

- (void)run
{     
    [gObjAppDelegatePtr displayActivityIndicator];
    self.m_cObjDownloadOprPtr = [[[NSInvocationOperation alloc]initWithTarget:self selector:@selector(requestToServer) object:nil]autorelease];

    if((NSOperationQueue *)nil == m_cObjDownloadOprQueuePtr)
    {
         m_cObjDownloadOprQueuePtr = [[NSOperationQueue alloc]init];
         [m_cObjDownloadOprQueuePtr setMaxConcurrentOperationCount:1];
    }
    [m_cObjDownloadOprQueuePtr addOperation:self.m_cObjDownloadOprPtr];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    //[self.m_cWebData setLength: 0];
    [self.m_cWebData appendData:data];    
    [self.m_cObjOriginalWebDataPtr appendData:data];
    [self attemptToWriteToStream];
}

- (void)attemptToWriteToStream 
{
    if([self.m_cWebData length] > 0) 
    {
        [self saveDownloadedData];
        NSUInteger written = [oStream write:(const uint8_t *)[m_cWebData bytes] maxLength:[m_cWebData length]];
        // NSLog(@"Rcvd Data=%d written = %d",[m_cWebData length],written);
        [m_cWebData replaceBytesInRange:NSMakeRange(0,written) withBytes:"" length:0];
        // NSLog(@"Rcvd Data after Reset =%d ",[m_cWebData length]);[self parseResponse];
    }
}

 self.m_cObjSAXHandler = [self createParser:(id)self];
 self.m_cCurrentDownloadInfo = pObjEntry;self.m_cObjConfig = (MobileCRMConfiguration*)super.m_cObjParent.m_cObjConfiguration;
 m_cIsSuccess = NO;

 self.m_cIsOrganizationMatches = NO;
 [self.m_cObjXmlParser ParseWithStream:iStream];

-(void)ParseWithStream:(NSInputStream *)pInputStream
{
    self.m_cObjXMLParser = [[NSXMLParser alloc] initWithStream:pInputStream];
    self.m_cObjXMLParser setDelegate:m_cObjSAXHandler];
    dispatch_block_t dispatch_block  = ^(void){
        [self.m_cObjXMLParser parse];
    };

    dispatch_queue_t dispatch_queue = dispatch_queue_create("parser.queue", NULL);
    dispatch_async(dispatch_queue, dispatch_block);
    dispatch_release(dispatch_queue);
}
  • 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-18T07:40:15+00:00Added an answer on June 18, 2026 at 7:40 am

    I have done this pullparser thing.I have to handle the parser delegates and stream data should be updated when it finished parsing and write the leftover data to stream.

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

Sidebar

Related Questions

I have a NSOperation that downloads some data using NSURLConnection, it looks somewhat like
I am trying to download a file from an FTP server using an NSOperation.
I am using Core Data. From there i am retrieving 10000+ data Using NSOperation,
I am using NSOperation to perform some heavy parsing of data, then return back
I am using MagicalRecord to help with core data operation. I have a NSOperation
I'm using an NSOperation to collect data that should be downloaded (takes 2-5 sec.)
Using SQL Server 2008 R2 we are looking for a way to select the
Using Microsoft SQL Server 2005, is there any way to see when a table
[self performSelector:@selector(stopPulling) withObject:nil afterDelay:0.01]; The code is fine. I just think that using NSOperation
I am currently using GCD. However, I've heard that NSOperation is actually a higher

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.