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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:27:10+00:00 2026-06-05T20:27:10+00:00

I have the following data inside an NSData object: <00000000 6f2d840e 31504159 2e535953 2e444446

  • 0

I have the following data inside an NSData object:

<00000000 6f2d840e 31504159 2e535953 2e444446 3031a51b 8801015f 2d02656e 9f110101 bf0c0cc5 0affff3f 00000003 ffff03>

I’m having issues parsing this data. This data contains information which is marked by tags

Tag 1 is from byte value 0x84 to 0xa5

Tag 2 is from byte value 0xa5 to 0x88

Tag 3 is from byte value 0x88 to 0x5f0x2d

Tag 4 is from byte value 0x5f0x2d to 0x9f0x11

How would I go about to get those values from the NSData object?

Regards,
EZFrag

  • 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-05T20:27:11+00:00Added an answer on June 5, 2026 at 8:27 pm

    I managed a nice solution, deciding to actually use the graymatter

    -(int)getIndexOfSubDataInData:(NSData*)haystack forData:(NSData*)needle{
        int dataCounter = 0;
        NSRange dataRange = NSMakeRange(dataCounter, [needle length]);
        NSData* compareData = [haystack subdataWithRange:dataRange];
    
        while (![compareData isEqualToData:needle]) {
    
            dataCounter++;
            dataRange = NSMakeRange(dataCounter, [needle length]);
            compareData = [haystack subdataWithRange:dataRange];
        }
    
        return dataCounter;
    }
    
    -(NSData*)getSubDataInData:(NSData*)targetData fromTag:(NSData*)fromTag toTag:(NSData*)toTag{
    
        int startIndex = [self getIndexOfSubDataInData:targetData forData:fromTag] + [fromTag length];
        int endIndex = [self getIndexOfSubDataInData:targetData forData:toTag];
        int dataLength = endIndex - startIndex;
    
        NSRange dataRange = NSMakeRange(startIndex, dataLength);
    
        return [targetData subdataWithRange:dataRange];
    }
    
    //here is how I use the code
     NSData* langTagStart=[[NSData alloc] initWithBytes:"\x5F\x2D" length:2];
        NSData* langTagEnd=[[NSData alloc] initWithBytes:"\x9F\x11" length:2];
    
        NSData* languageData = [self getSubDataInData:[response bytes] fromTag:langTagStart toTag:langTagEnd];
    

    Thanks for your suggestions.

    Regards,
    EZFrag

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

Sidebar

Related Questions

I have the following markup and I need to fetch value of data-base inside
Inside my viewmodel I have following code: var self = this; self.Name = ko.observable(data.Name);
I am using **<style>..{data inside}..</style>** which is there in following code.i have taken all
Hi i have the following 3 tables, example data inside them patients : 1,DUMMY
I have following data frames > head(elo) date elo 1 1921-12-18 1597 2 1922-05-14
I have following data structure (simplified): A giant list of the class TestClass public
I have following data to save in database using php my data is :
I have following data in my table. alt text http://img26.imageshack.us/img26/3746/productfield.png I want to extract
I have following data in excel table r1 r2 r3 r4 r5 v1 v2
I have following data in a file called binFile 78 1 79 4 80

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.