From: Mark H. <di...@ma...> - 2005-06-01 15:05:51
|
On Jun 1, 2005, at 4:26 AM, Jonathan Paisley wrote: > > On 31 May 2005, at 15:59, Mark Hubbart wrote: > > >> def toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar >> (toolbar, itemid, insert) >> if itemid == "install item toolbar item" >> >> > > Does this code work? The condition above is likely to always be > false, since itemid is an NSString, not a ruby string: > > irb> "Foo" == "Foo" > => true > irb> OSX::NSString.stringWithString("Foo") == "Foo" > => false > irb> OSX::NSString.stringWithString("Foo").to_s == "Foo" > => true Ahhh! Thank you so much! I added those five characters to my code and it works. Now I can stop pulling my hair out :) There were a few other bugs that I solved by looking at the japanese example code on the website, but the String != NSString eluded me. I'm not sure why I didn't think of that, I probably should have realized I would be getting an NSString argument, not a Ruby String... thanks, Mark |