• 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: pragma nowarn
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pragma nowarn


  • Subject: Re: pragma nowarn
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Wed, 12 Dec 2007 14:16:51 +0100

Especially when you want to dynamically call methods from different SDKs, getting rid of the warnings can be a challenge. Example:

Take this code, which is compiled against the 10.2 SDK (but the issue is the same for any cross-SDK development):

if (floor(NSAppKitVersionNumber) > 663) // NSAppKitVersionNumber10_2
[center postNotificationName:myNotification object:nil userInfo:info options:(1 << 1)];
else
[center postNotificationName:myNotification object:nil userInfo:info];

This will produce the following warning:

warning: `NSDistributedNotificationCenter' may not respond to `-postNotificationName:object:userInfo:options:'
warning: cannot find method `-postNotificationName:object:userInfo:options:'; return type `id' assumed

For someone who likes his code warning free, I have found no way of getting rid of this warning. And I DO NOT want to turn off the "cannot find method" warning

Alex


You should not use 10.3 method with the 10.2 SDK. (it does not generate linker error thanks to the dynamic linking, but with C functions, it will failed)
If you want to deploy on version from 10.2 to 10.4, you should compile using the 10.4 SDK, and set the min deployment target to 10.2.

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

This email sent to email@hidden

References: 
 >pragma nowarn (From: William Bates <email@hidden>)
 >Re: pragma nowarn (From: Alastair Houghton <email@hidden>)
 >Re: pragma nowarn (From: William Bates <email@hidden>)
 >Re: pragma nowarn (From: Alastair Houghton <email@hidden>)
 >Re: pragma nowarn (From: "Alexander v. Below" <email@hidden>)

  • Prev by Date: Re: Encoding of "long string"
  • Next by Date: Re: How to make a program look for dylibs other than /usr/local/lib?
  • Previous by thread: Re: pragma nowarn
  • Next by thread: Re: pragma nowarn
  • Index(es):
    • Date
    • Thread