Question about a warning in code...
Question about a warning in code...
- Subject: Question about a warning in code...
- From: Ed Silva <email@hidden>
- Date: Mon, 10 Sep 2001 11:52:12 -0700
Hi all,
I am getting a warning, 'assignment from incompatible pointer type', from
this code:
NSString *fileName; // path to a file...
NSMutableString *script_buf, *tmp_buf;
NSRange range;
....
tmp_buf = [NSMutableString stringWithContentsOfFile:fileName];
range = [tmp_buf rangeOfString:@"__1__\n"];
script_buf = [tmp_buf substringToIndex:range.location]; // <== This is
where the warning occurs...
Why am I getting this warning when tmp_buf and script_buf are both
NSMutableStrings?
The code works fine, but I hate it when my code generates warnings, so I
really want to do the right thing and fix whatever is causing the warning.
Any clues are appreciated. :-)
Cheers,
--Ed