Error in replacing the bytes.

Hi all,
I like to implement "System.arraycopy" method of java in objective C. I have implemented as follows :
+(BOOL)copyBuffer:(NSData *)srcdata_ :(int)srcIndex :(unsigned char*)dest :(int)destIndex :(int)destLength
BOOL isCopied = YES;
@try
NSMutableData *subData = (NSMutableData *)[srcdata_ subdataWithRange:NSMakeRange(srcIndex, destLength)];
NSMutableData *destData = (NSMutableData *)[NSData dataWithBytes:dest length:20];
[destData replaceBytesInRange:NSMakeRange(destIndex, destLength) withBytes:[subData bytes] ];//length:destLength];
dest = (unsigned char*)[destData bytes];
@catch (NSException *exp)
NSLog(@"Error in copying the array : %@", [exp reason]);
isCopied = NO;
return isCopied;
- But the above code returns following exception.
"* -[NSConcreteData replaceBytesInRange:withBytes:]: unrecognized selector sent to instance 0xd21b90" .. I have checked the range , but the range lies in the length of the source.
I tried but couldnt spot the error.
Any help would be greatly appreciated.
Regards,
Mohammed Sadiq.

Mohammed Sadiq wrote:
NSMutableData *destData = (NSMutableData *)[NSData dataWithBytes:dest length:20];
The above typecast simply turns off the compiler warning. It doesn't change the type of the object. So destData is not a mutable object and the attempt to modify it causes the exception.
Try something like this:
NSMutableData *destData = [NSMutableData dataWithBytes:dest length:20];
[destData replaceBytesInRange:NSMakeRange(destIndex, destLength) withBytes:subData];
Note that your subData object is also not mutable for the same reason, though in the posted code this shouldn't matter.
- Ray

Similar Messages

  • Hewlett Packard Ink Jet Printer Model C6180==Error Message "Replace the following empty.."

    I have replaced two magenta ink cartridges but still get message: "replace the following empty ink cartridge(s) to resume printing"

    This ink cartridge error message document may offer some help here:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00720996&tmp_task=solveCategory&cc=us&dlc=en&lc...
    007OHMSS
    I was a support engineer for HP.
    If the advice resolved the situation, please mark it as a solution. Thank you.

  • Error in replacing the default repository of BI server with a new one

    Hi everyone,
    This is my first post to this form, i have just started exploring oracle BI Enterprise edition.
    I am naive to Oracle BI, sorry i do'nt know much about the installion and configuration things, i installed Oracle BI to explore the Development things.
    I am currently creating a repository by using bi administrator tool. I am following the following tutorial
    http://st-curriculum.oracle.com/obe/fmw/bi/bi1113/biadmin11g_01/biadmin11g.htm
    As I was doing the necessary prerequisite setups for the deployment of SAMPLEAPP core application.
    I have done the following steps
    1. Copying Files into Appropriate Locations
    2. Creating Main SampleApp Oracle Data source
    3. Deploying Weblogic Server Users and Custom Apps (Please note that i can'nt find BI_Server1 so i have done this step on Admin Server)
    4. Deploy Custom content folder location in WLS (Again the Admin Server was selected by default as there was'nt BI_SERVER1)
    5. OBIEE Configuration Edits and Starting (Please note that i have done the setting for PHYSICAL_TABLE_NAME as
    PHYSICAL_TABLE_NAME = "XX - System DB (ORCL)"."Catalog"."dbo"."S_NQ_ACCT"; (I do'nt know with which value to replace XX, so i putted 09 as it was in the tutorial.
    I am getting error in the following step
    6. Setting the default rpd and webcat paths through EM
    I have selected SampleApp.rpd for repository file option and given path for webcat selection after pressing APPLY button i get the error when i click on ACTIVATE CHANGES.
    The error is as following
    Supplementry information regarding operation:JEE_SERVER:ETS-HO-SDGN37:Adminserver;Unexpected error; error acquired during setting configuration values.
    After getting this error i am not able to login to the Oracle business intellegence page as well while the Administration and EM are able to login normally.
    Kindly someone help me in the regard, as i am unable to solve the issue.
    Regards
    Farhan Ali
    Edited by: user6770381 on Aug 5, 2011 3:26 PM

    iphonefan1,
    To transfer your information from your old iPhone to your new iPhone, you are going to want to do a few things:
    1) Backup any information on the old iPhone to your computer. You can use Windows Address book or Outlook (2003 or 2007) to backup contacts and Internet Explorer to backup your bookmarks. You will need to import any pictures you have taken on the iPhone to your computer (they do not sync) or email them if you would like them saved. Sync your old iPhone with iTunes so that it will make a backup of your text messages and other preference information.
    This article describes what information can be directly synced from your iPhone to the computer:
    http://docs.info.apple.com/article.html?artnum=306071
    2) Take your SIM card out of your old iPhone and put it into the new iPhone. This takes all of your ATT account information to the new iPhone so that you will not have to run through a full activation again. You will have to run through a mini-activation, but all of your information will already be set up.
    3) Connect the new iPhone into your computer. As part of the mini-activation process, iTunes will ask you if you want to restore your iPhone from the backup. If you say yes, then it will use the preferences from your old iPhone and put them on the new iPhone. You can then sync any information (contacts, bookmarks, photos, etc.) that you backed up on the computer from the old iPhone to the new iPhone.
    This article will help you import the data on your computer to the iPhone:
    http://docs.info.apple.com/article.html?artnum=305741
    4) Once you are confident that all of your information has been transferred from the old iPhone to the new one, you can restore the old iPhone and that will put the software back to factory settings. That will also erase all of your old data. (This process cannot be undone, so please make sure you do not need any information off the old iPhone before you restore.)
    Hope this helps!
    Jennifer B.

  • I replaced the hard drive to a 30gig on my Ipod 4th gen. click wheel but it is still not recognized on my computer or in itunes......I get an error message with a folder and "!"....what can I do to fix??

    I replaced the hard drive to a 30gig on my Ipod 4th gen. click wheel but it is still not recognized on my computer or in itunes......I get an error message with a folder and "!"....what can I do to fix??

    Have you recharge the battery for at least 2 hours, or just leave it connected for 4 hours?
    (When you replaced the Hardisk, you should also replace the battery.)
    Some other iPod SSD sites, says that you may have to format the CF in FAT32, as Mac dont read NTFS drive so if Windows is the 1st PC that your CF is connected, it may be formatted to NTFS.
    You can try erasing the CF using Disk Utilty, so that Mac can recognise it. (but not Windows)
    Have a nice day!

  • I am trying to re-install Creative Suite 5.5 Design Standard on my Widows 7 Professional computer after I had to replace the hard drive. I keep getting error message and I get "Exit Code 15: Media DB Sync failed". I have run C Cleaner with same results. H

    I am trying to re-install Creative Suite 5.5 Design Standard on my Widows 7 Professional computer after I had to replace the hard drive. I keep getting error message and I get "Exit Code 15: Media DB Sync failed". I have run C Cleaner with same results. Have Disabled UAC and Startup items and Services with no success. Please help - frustrated to no end. Can someone help me?

    make sure you're using the adobe cleaner, not crap cleaner, Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    copy the installation files to a desktop folder and install from there.

  • I had a problem with the hard disk on a 2010 macbook pro. Replaced the hard disk with an Hitachi 1TB and when I tried to erase and format It fails with input/output error. Any help much appreciated!

    I had a problem with the hard disk on a 13" 2010 macbook pro. Replaced the hard disk with an Hitachi 1TB disk but when I tried to erase and format, it fails with input/output error and at other times saying unable to allocate memory. Any help much appreciated!

    Zap the PRAM and Reset the SMC, then try again.

  • HT201210 Just replaced the battery in my iPhone 4S.  Before doing so I backed-up then wiped the phone.  Now when I go to restore it, it gets about 3/4 done and that is when I get an error message, "Code 1." does this mean I fried it??  :-(

    Hello,
      Just replaced the battery in my iPhone 4S.  Before doing so I backed-up then wiped the phone.  Now when I go to restore it, it gets about 3/4 done and that is when I get an error message, "Code 1." does this mean I fried it??

    Hey joshuafromisr,
    If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    or here:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Best,
    David

  • I received a low ink warning on my mac for my epson artisan 837 printer. I replaced the cartridge that was low but it still reads low ink on the mac but reads full on the epson control panel. I am also receiving a communication error between the mac

    I received a low ink warning on my mac for my epson artisan 837 printer. I replaced the cartridge that was low but it still reads low ink on the mac but reads full on the epson control panel. I am also receiving a communication error between the mac

    What exactly is the error?
    And, we'd need some info re. your Mac model and OS version - you are not running iOS on it.
    You need to realize that this model has been discontinued and the last driver updates are dated about a year ago. If you are running Mavericks, there may not be an updated driver for it. But you can try to delete the printer and add it again to see if that will work.

  • TS1372 I replaced the hard drive, motherboard, and battery but now can not restore my Ipod 5th gen?  Error code 1416, any help?

    I replaced the hard drive, motherboard, and battery but now can not restore my Ipod 5th gen?  Error code 1416, any help?

    When I did a Google search on "1416 error ipod 5th," there is some discussion that the earlier version of the logic board only accepted 30 and 60 GB drives (or words to that effect), but the later "5.5" version did allow larger capacity drives.  If that info is true, the question is, do you have a compatible combination of logic board and hard drive?

  • Error when I replaced  the DOM parcer with JAXP

    I replaced the DOM parcer with JAXP ....
    We moved from DOM parcer �import org.apache.xerces.parsers.DOMParser;� to JAXP.
    Here is my code:
    // Step 1: create a DocumentBuilderFactory and setNamespaceAware
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    // Step 2: create a DocumentBuilder
      DocumentBuilder db = dbf.newDocumentBuilder();
    // Step 3: parse the input file to get a Document object
    Document doc = db.parse(location);
      root = doc.getDocumentElement();
      root.normalize();
    AND when we run stress test after a while we start getting error
    java.lang.NullPointerException
    at org.apache.xerces.dom.DeepNodeListImpl.nextMatchingElementAfter(Unknown Source)
    at org.apache.xerces.dom.DeepNodeListImpl.item(Unknown Source)
    at org.apache.xerces.dom.DeepNodeListImpl.getLength(Unknown Source)
    at com.xxx.yyy.WfStartTasksXmlDAO.getActionPerformed(Unknown Source)
    at com.xxx.yyy.WfStartTasksXmlDAO.getAction(Unknown Source)
    - Any idea why we are getting this error. Is this server (Linux) problem? or JAXP?
    Message was edited by:
    TamerBasha

    This is happening because JAXP is not thread safe. need to synchronize bracket or use thread safe parser.

  • I had to replace the hard drive on my computer.  I am now trying to download Adobe Photoshop CS6, previously purchased.  I get an error that files are missing after waiting for the whole download.  I have Windows7

    I had to replace the hard drive on my computer.  I am now trying to download Adobe Photoshop CS6, previously purchased.  I get an error that files are missing after waiting for the whole download.  I have Windows7

    The error msg said that the file archive part of Adobe photoshop CS6 is missing and that I need all parts in the same folder.

  • Error in replacing script in the editing page properties of Oehr_Depatment sample

    Hi Forum,
    I downloaded and imported the Oehr sample objects to repeat tutorials. The tutorial instructed me to scroll to the Source on the Region Definition page and replace the content on the Department report region (i.e.
    select
    "DEPARTMENT_ID",
    "DEPARTMENT_NAME",
    "MANAGER_ID",
    "LOCATION_ID"
    from   "OEHR_DEPARTMENTS"
    where
    instr(upper("DEPARTMENT_NAME"),upper(nvl(:P2_REPORT_SEARCH,"DEPARTMENT_NAME"))) > 0
    with:-
    SELECT d.department_id "Department ID",
    d.department_name "Department Name",
    count(e2.employee_id) "Number of Employees",
    substr(e.first_name,1,1)||'. '|| e.last_name "Manager Name",
    c.country_name "Location"
    FROM oehr_departments d,
    oehr_employees e,
    oehr_locations l,
    oehr_countries c,
    oehr_employees e2
    WHERE d.manager_id = e.employee_id
    AND d.location_id = l.location_id
    AND d.department_id = e2.department_id
    AND l.country_id = c.country_id
    AND instr(upper(d.department_name),upper(nvl(:P2_REPORT_SEARCH,d.department_
    name))) > 0
    GROUP BY d.department_id,
    d.department_name,
    substr(e.first_name,1,1)||'. '||e.last_name, c.country_name
    Unfortunately, I am not successful. Instead the following error message:-
    1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00907: missing right parenthesis
    Please can anyone help me correct where the error is?. I am using 2Day + Application Express Developer's Guide.pdf (page 38)
    Regards
    Godis-Tei
    Message was edited by: Godis-Tei

    Hi Forum,
    I downloaded and imported the Oehr sample objects to repeat tutorials. The tutorial instructed me to scroll to the Source on the Region Definition page and replace the content on the Department report region (i.e.
    select
    "DEPARTMENT_ID",
    "DEPARTMENT_NAME",
    "MANAGER_ID",
    "LOCATION_ID"
    from   "OEHR_DEPARTMENTS"
    where
    instr(upper("DEPARTMENT_NAME"),upper(nvl(:P2_REPORT_SEARCH,"DEPARTMENT_NAME"))) > 0
    with:-
    SELECT d.department_id "Department ID",
    d.department_name "Department Name",
    count(e2.employee_id) "Number of Employees",
    substr(e.first_name,1,1)||'. '|| e.last_name "Manager Name",
    c.country_name "Location"
    FROM oehr_departments d,
    oehr_employees e,
    oehr_locations l,
    oehr_countries c,
    oehr_employees e2
    WHERE d.manager_id = e.employee_id
    AND d.location_id = l.location_id
    AND d.department_id = e2.department_id
    AND l.country_id = c.country_id
    AND instr(upper(d.department_name),upper(nvl(:P2_REPORT_SEARCH,d.department_
    name))) > 0
    GROUP BY d.department_id,
    d.department_name,
    substr(e.first_name,1,1)||'. '||e.last_name, c.country_name
    Unfortunately, I am not successful. Instead the following error message:-
    1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00907: missing right parenthesis
    Please can anyone help me correct where the error is?. I am using 2Day + Application Express Developer's Guide.pdf (page 38)
    Regards
    Godis-Tei
    Message was edited by: Godis-Tei

  • I dropped my mac pro. The disc drive plays but will not record. medium drive error. How hard is it to replace the drive my self. i see screws on the bottom. Could I just order a new internal drive and replace it? Or is it too complicated for the average ?

    I dropped my mac pro. The disc drive plays but will not record. medium drive error. How hard is it to replace the drive my self. i see screws on the bottom. Could I just order a new internal drive and replace it? Or is it too complicated for the average person? Would be cheaper to buy an external drive than to replace internal one? Any advice is appreciated

    How certain are you the superdrive ONLY is at fault?
    That depends on your skill level, if you grew up tearing things apart and putting them together, its absurd how easy it is.
    For some however its too daunting.   On a general skill level for the "average" person its about a 3 out of 10 in difficulty.
    Can you order same? yes.

  • My 822 now says, "ERROR: Unable to find bootable option. Press any key to shut down." Just happened after my phone froze. Everything I've searched says to replace the phone.  I have no phone in or out, no alarm....what is going on with this?  I see others

    My 822 now says, "ERROR: Unable to find bootable option. Press any key to shut down." Just happened after my phone froze. Everything I've searched says to replace the phone.  I have no phone in or out, no alarm....what is going on with this?  I see others have the same problem.

    Just got the same error message today.  My phone went to the black screen of death with the error message at the top.  Contacted Verizon via chat.  Was online for 1 hour and 15 minutes only to find out that nothing could be done which I could have told them based upon what I had read on this site.  Of course my phone is out of warranty since I have had it for 1 1/2 years and I am not eligible for an upgrade.  How convenient!  I was told to contact Nokia which I did and they gave me a download to try to reset everything.  It looked like it was working but after almost 3 hours it got to the end and nothing happened.  It just froze even though it said it was done.  I rebooted the phone and am back at the same black screen of death.  Guess I have to buy a used phone and then will have to reconsider whether or not to stay with Verizon going forward.  I have not had any issues with the phone in the past - keep it in an otter box, never dropped, never got wet, etc.  But all of a sudden it goes haywire like this that seems like either a hardware or software problem but something completely out of my control and all I get is sorry, you're out of warranty!

  • Im getting errors when i do a mem test on my hp a6000f.....ive replaced the ram and still get errors

    im getting errors on mem test, Ive replaced the ram, still get errors. How do I disable the L2 cache....on hp a6000f, I dont see anywhere to do it while im in the BIOS/ CMOS setup
      I get error code : BIOME-1

    Here is what you should do to trouble shoot your problem.
    Open up the composition that is giving you problems
    Your error message tells you that you are having problems with the Shatter effect so select the layer with the shatter effect and turn the effect off
    Try a ram preview
    If the ram preview is successful add a solid to your comp
    Copy your shatter effect and paste it to the new solid you created
    Turn off all other layers
    Try a ram preview
    If the ram preview crashes go back to step 6 and reset shatter and try again
    If the ram preview is successful start adding the properties from your original shatter effect until you get a crash.
    If the ram preview works the first time you try step 6 then there is something wrong with the combination of shatter and the original layer it was applied to so remove shatter from that layer, pre-compose that layer moving all attributes to the new layer then paste the working shatter from the solid to the pre-comp, turn off the solid and try another ram preview.
    Do you kind of get the procedure here. When something is causing a crash first isolate that problem, try it on something simple, then try different things until you can reproduce the crash. Make sure you are saving copies of your project so you can easily go back.
    If you can't figure out what settings in Shatter are causing the crash then we need to know everything there is to know about your composition and see a screenshot or the project file. If it is the footage that is causing the crash then you need to transcode, recompress, or in some other way change the format of the footage. There is nothing we can surmise from the details you have given us that give us any clue why shatter is crashing. It usually does not. I can't think of the last time it caused a crash for me. The only possible thing I can think of that would be causing a crash is that the number of particles is causing your system to run out of memory.

Maybe you are looking for

  • Why does time machine open a finder window

    I just tried to enter time machine and instead of the display I'm used to, it opened 2 finder windows.  It's happend every time I've tried it today on two different logins on the same machine.  It's just a plain mac book pro, no external display.

  • Macbook internal isight not working

    I purchased a new macbook two months ago. isight worked great with photobooth, imovie, ichat. Suddenly isight is gone, no green light. Photobooth, imovie, ichat tell be that no camera is attached. If anyone has any ideas please let me know?

  • Using reflection api to copy like named attributes of a class

    Hi guys, I have been hearing about this for a long time now. How can one copy like named attributes from one class to another using the reflection api?? Can anyone provide a small example, with code?? Thanks.

  • MathType and InDesign 4 - Blank display

    I am not able to see the text, when I open the equations (Edit original) in InDesign 4. It is displayed as blank in MathType software. Please advise. Thanks

  • Add Val.Fld/Key Fig. for use it in KEU2

    Hi,    Can i add a new Val.Fld/Key Fig., like a Netsales, for use it in a CO-PA cycle in a KEU2?    Where can i define it?, because i need a formula, the total of two Val.Fld/Key Fig already defined. Thanks in advance.