Looks like I have worked out a solution to this, I would be happy to hear others views on this method or suggestions to improve it.
Instead of taking the string passed into the method and trying to directly update the array initializer I used the string to determine which array initializer should be used. For this to work I had to create a pointer before the if block so that I could then assign strings to it from within the if blocks.
const unsigned char *magic = NULL;
if (inputString == @"0APPLES") { magic = (const unsigned char*) "0APPLES\0";}
else if (inputString == @"0ORANGE") { magic = (const unsigned char*) "0ORANGE\0";}
Also recently tried this way and its also working :-
const unsigned char apples[] = "0APPLES\0";
const unsigned char orange[] = "0ORANGE\0";
const unsigned char *magic;
if (inputString2 == @"0APPLES") { magic = apples;}
else if (inputString2 == @"0ORANGE") { magic = orange;}
The method can then be called like this :-
[self buildrawdata1:@"0APPLES"];
[self buildrawdata1:@"0ORANGE"];