I have the following code:
The problem I have is that reinitializing myNSString (at the line with --->>) throws an exception "selector not recognized" at the NSObject level. Is this a problem with myNSString being auto released? Or what else is my problem please?
Code:
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
FILE *ftest;
int size, i;
char *string;
NSString *myNSString = [NSString alloc];
ftest = fopen("/form.txt", "r");
stat(name, &stbuf);
myBuffer = calloc(1, size = stbuf.st_size);
string = myBuffer;
fread(myBuffer, 1, size, ftest);
for(i=0; i<size; i++){
if(myBuffer[i]==0x09) {
myBuffer[i]=0;
--->> myNSString = [myNSString initWithCString:string encoding:1];
string = &myBuffer[i+1];
}
}
}
The problem I have is that reinitializing myNSString (at the line with --->>) throws an exception "selector not recognized" at the NSObject level. Is this a problem with myNSString being auto released? Or what else is my problem please?
Last edited: