• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Question about a warning in code...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Question about a warning in code...
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Would Any Developers Use This?
  • Next by Date: Re: Redeclaring overrides
  • Previous by thread: Re: UMLish Modellers
  • Next by thread: Re: Question about a warning in code...
  • Index(es):
    • Date
    • Thread