Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Plug It In, Plug It In
Subject:   plugin vs. plug-in in discoverPlug-ins
Date:   2002-10-16 12:44:22
From:   halliday
- (void)discoverPlug-ins
{
...
while ( path = [pathEnum nextObject] ) {
...
while ( name = [e nextObject] )
if ( [[name pathExtension] isEqualToString:@"plugin"] ) {
/**/NSBundle *plugin = [NSBundle bundleWithPath: name];

/**/if ( filterClass = [plug-in principalClass] )
...


As you can see above, you declared the NSBundle as "plugin" but you used it as "plug-in". Unfortunately, hyphens are significant in all C languages. :-)


In fact, doesn't C disallow hyphens in identifiers, so it would try and take the difference between "plug" and "in"?


This will cause a compiler error, or two. :-)

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Michael Beam photo plugin vs. plug-in in discoverPlug-ins
    2002-10-25 07:18:04  Michael Beam | O'Reilly Author [View]

    Wow, that's really bizarre. That's about all I can say about that. Something must have gone a little wonky in the final publishing process. At anyrate, as you correctly surmised, the hyphens should no be there at all.
  • Apple shouldn't have used a popup with "plug-in" on it
    2002-10-19 19:12:32  psheldon [View]

    I see I was wise to download Mike's working code. I used to be scared to compare my nonworking code with working code, but now I have learned some confidence.

    Comments, columns, or documentation might spell things ala Webster for a promised but late night release. To err is human too late. Deadlines doth make fools of us all.
    ;-)

    I think Apple or Oreilly might need to fiddle with their spell checker to make their own English for c.

    In addition, when you write something with a dash, you evidentally don't tend to capitalize after the dash for a sense of word break. So, when I scanned for dashes to remove, I had to also be careful to capitalize to get the defined method, because objective c distinguishes between capital and small letters.

    Hope that helps others on this thread as yours post did.

    Thanks.

    Maybe life needs this source of frustration for there to be any sense of victory!

    ;-)