• 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
Re: Newbie error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie error


  • Subject: Re: Newbie error
  • From: Lon Giese <email@hidden>
  • Date: Fri, 2 Jun 2006 10:28:06 -0700

if browser were not the proper type for the interface he would get an
(IMHO)

"incompatible pointer" warning

Well, that's wrong, as a simple test will show:

Hmmm... I ran your code example and it clearly says

Test.m:25: passing arg 1 of `test:' from incompatible pointer type

Maybe you are using a different version of GCC?
but why would they change the warning text? that doesn't make much sense.
I still think it's a bug in xcode ( more or less succinctly: GCC ).


as the author clearly stated:

and the instance variable browser is defined as (NSBrowser *) for this call:
browserDelegate = [[BrowserDelegate alloc] initWith:browser];

(I am pretty sure he meant to say 'method parameter', not 'instance variable', because the class has no instance variable named browser. just a little terminology mixup, no biggie) Which is absolutely correct and should not cause a warning. And IMHO the way the identifiers are named is not causing this problem.


Did you try recasting browser variable anyway. perhaps it is already the correct type but recasting it might jump start the compiler and work around the bug?

So, Does the author have the latest version of xcode? or not? Though I doubt that would help, but its worth a try. I'm guessing he does have the latest version. This is definitely a question for an xcode expert. Is there any easy way to get a work around for a bug without being charged for a tech support call?

It can be pretty stressful when learning a new language and the IDE has bugs in it.

Lon


WooHoo the ultimate Mac App for 'The Sims 2' power users. http://www.modthesims2.com/showthread.php?p=1239629 On Jun 2, 2006, at 8:42 AM, Michael Ash wrote:

On 6/2/06, Lon Giese <email@hidden> wrote:
> I am getting this error:
>
> /Users/graham/Projects/Pre FOF/Controller.m:13: warning: passing
> argument 1 of 'initWith:' from distinct Objective-C type
>

if browser were not the proper type for the interface he would get an
(IMHO)

"incompatible pointer" warning

Well, that's wrong, as a simple test will show:

@interface Foo { }
- (void)test: (NSString *)x;
@end
...
[foo test: array];

test.m:11: warning: passing argument 1 of 'test:' from distinct Objective-C type

So this cryptic warning just means you got your ObjC pointer types mixed up.

Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Newbie error
      • From: glenn andreas <email@hidden>
References: 
 >Re: Re: Newbie error (From: Graham <email@hidden>)
 >Re: Newbie error (From: Lon Giese <email@hidden>)
 >Re: Newbie error (From: "Michael Ash" <email@hidden>)

  • Prev by Date: NSMatrix setCellClass: vs setPrototype:
  • Next by Date: Double-click/Return/Enter in NSTableView
  • Previous by thread: Re: Newbie error
  • Next by thread: Re: Newbie error
  • Index(es):
    • Date
    • Thread