• 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: Why can't I name a property `tag'?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why can't I name a property `tag'?


  • Subject: Re: Why can't I name a property `tag'?
  • From: "Michael Ash" <email@hidden>
  • Date: Thu, 10 Jul 2008 15:59:26 -0400

On Thu, Jul 10, 2008 at 3:29 PM, Michael Ash <email@hidden> wrote:
> I recommend you file a bug with Apple.

And to put my money where my mouth is, I've filed this bug as rdar://6066914

Anyone who's interested in playing with this further may find this
python program useful:

#!/usr/bin/python

types = ['void', 'int', 'float', 'double', 'id', 'NSObject *',
'NSRect', 'NSPoint']

pairs = []
for idx, type1 in enumerate(types):
    for type2 in types[idx:]:
        if type1 != type2:
            pairs.append((type1, type2))


print '#import <Foundation/Foundation.h>'
print ''
print ''
print '@interface C1'
print ''
for idx, pair in enumerate(pairs):
    print '- (%s)m%d;' % (pair[0], idx)
print ''
print '@end'
print ''
print ''
print '@interface C2'
print ''
for idx, pair in enumerate(pairs):
    print '- (%s)m%d;' % (pair[1], idx)
print ''
print '@end'
print ''
print ''
print 'int main(int argc, char **argv)'
print '{'
print '    id obj;'
for idx, pair in enumerate(pairs):
    print '    [obj m%d]; // %s and %s' % (idx, pair[0], pair[1])
print '}'

When compiling its output with gcc, it's obvious which conflicts are
missed as the warnings *should* be numbered sequentially, so gaps
stand out. You can then find the gap in the main() code and see which
pair was missed.

This particular test case misses int and float, int and id, int and
NSObject *, float and id, float and NSObject *, and id and NSObject *.
Modify the 'types' array at the top if you want to experiment with
other conflicts.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Why can't I name a property `tag'? (From: an0 <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: Graham Cox <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: an0 <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: "I. Savant" <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: an0 <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: an0 <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: Jens Alfke <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: Graham Cox <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: the 11th can't come soon enough :-)
  • Next by Date: Re: Why can't I name a property `tag'?
  • Previous by thread: Re: Why can't I name a property `tag'?
  • Next by thread: Re: Why can't I name a property `tag'?
  • Index(es):
    • Date
    • Thread