You can subscribe to this list here.
| 2002 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(3) |
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(1) |
Feb
(11) |
Mar
(9) |
Apr
(1) |
May
(5) |
Jun
(5) |
Jul
(4) |
Aug
(3) |
Sep
(15) |
Oct
(8) |
Nov
(9) |
Dec
(11) |
| 2004 |
Jan
(5) |
Feb
(2) |
Mar
(1) |
Apr
(3) |
May
(6) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(3) |
| 2005 |
Jan
(1) |
Feb
(7) |
Mar
(6) |
Apr
(36) |
May
(20) |
Jun
(42) |
Jul
(21) |
Aug
(12) |
Sep
(56) |
Oct
(5) |
Nov
(55) |
Dec
(53) |
| 2006 |
Jan
(43) |
Feb
(83) |
Mar
(98) |
Apr
(42) |
May
(68) |
Jun
(55) |
Jul
(50) |
Aug
(104) |
Sep
(13) |
Oct
(70) |
Nov
(37) |
Dec
(42) |
| 2007 |
Jan
(56) |
Feb
(18) |
Mar
(43) |
Apr
(80) |
May
(65) |
Jun
(149) |
Jul
(103) |
Aug
(71) |
Sep
(62) |
Oct
(67) |
Nov
(72) |
Dec
(63) |
| 2008 |
Jan
(64) |
Feb
(63) |
Mar
(31) |
Apr
(42) |
May
(71) |
Jun
(62) |
Jul
(37) |
Aug
(25) |
Sep
(5) |
Oct
(2) |
Nov
(7) |
Dec
(14) |
| 2009 |
Jan
(20) |
Feb
(15) |
Mar
(19) |
Apr
(8) |
May
(7) |
Jun
|
Jul
(37) |
Aug
(12) |
Sep
(19) |
Oct
(5) |
Nov
(1) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(24) |
Mar
(16) |
Apr
(9) |
May
(4) |
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(7) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(5) |
Dec
|
| 2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Jonathan P. <jp...@dc...> - 2005-09-13 14:03:45
|
On 13 Sep 2005, at 13:43, Free (rupert.barrow) wrote: > Has anyone got Ruby/RubyCocoa and CoreData working ? > Are there any examples out there, of Apps (with GUI) and/or Tools > (without GUI). Just in case you don't get any other responses to this message - I don't think anybody has tried extensively or got CoreData working yet with RubyCocoa. I haven't looked into it myself so I'm not sure what the stumbling blocks (which there are likely to be) are. Jonathan |
|
From: Free (rupert.barrow) <rup...@fr...> - 2005-09-13 12:43:25
|
Hi, Has anyone got Ruby/RubyCocoa and CoreData working ? Are there any examples out there, of Apps (with GUI) and/or Tools (without GUI). TIA, Rupert |
|
From: Steven A. <st...@ne...> - 2005-09-13 11:11:04
|
On Sep 13, 2005, at 4:56 AM, Dave Howell wrote: > Fine. Download what ruby-lang.org tells me is the latest version. > Run ./configure. > "configure:2045: error: C compiler cannot create executables" [...] > > My server, on which I'm trying to install Rails, has basically a > stock Apple install of 10.3.9. Dumb question -- you _do_ have the latest xcode installed, and you _can_ compile other packages, right? steve |
|
From: Jonathan P. <jp...@dc...> - 2005-09-13 09:43:29
|
On 13 Sep 2005, at 10:36, Dave Howell wrote: > The error message in my original message was copied verbatim from > the config.log. That's all it gave me. There should be a bunch of stuff in the preceding lines, starting with an invocation of gcc that's intended to test that it's capable of building programs. If in doubt, post a page or two preceding the error message from config.log. |
|
From: Dave H. <da...@gr...> - 2005-09-13 09:36:12
|
On Sep 13, 2005, at 2:22, Jonathan Paisley wrote: > On 13 Sep 2005, at 9:56, Dave Howell wrote: > >> Fine. Download what ruby-lang.org tells me is the latest version. Run >> ./configure. >> "configure:2045: error: C compiler cannot create executables" >> I recall once before having to change from the default gcc3.3 >> compiler to something else. Sure enough, on my other system, gcc has >> been redefined as gcc-3.1. I switch the gcc link to 3.1. Doesn't >> work. I copy the gcc binary from my other computer to this one. Still >> doesn't work. > > gcc-3.3 should work fine, or gcc-4.0 if you have Xcode 2.1. I don't. That's Tiger only. > Did you switch the link by hand? There's a tool to do this: > gcc_select. Perhaps switching by hand broke things? I did. Then I used gcc_select. Still didn't work. > Look in the 'config.log' file to see what error messages the > compiler/linker spat out when failing. You could post the relevant > excerpt here if it's not obvious. The error message in my original message was copied verbatim from the config.log. That's all it gave me. |
|
From: Dave H. <gr...@gr...> - 2005-09-13 09:34:09
|
On Sep 13, 2005, at 2:05, Tom Counsell wrote: > Have you tried the ruby packages from > http://homepage.mac.com/discord/Ruby/ ? I don't know whether they are > sufficiently up-to-date now, but in my Panther days I found them very > useful. I downloaded it, but since it apparently matters *which* 1.8.2 I install, and that site doesn't tell me what's actually in the package, I haven't tried it yet. |
|
From: Jonathan P. <jp...@dc...> - 2005-09-13 09:23:13
|
On 13 Sep 2005, at 9:56, Dave Howell wrote: > Fine. Download what ruby-lang.org tells me is the latest version. > Run ./configure. > "configure:2045: error: C compiler cannot create executables" > I recall once before having to change from the default gcc3.3 > compiler to something else. Sure enough, on my other system, gcc > has been redefined as gcc-3.1. I switch the gcc link to 3.1. > Doesn't work. I copy the gcc binary from my other computer to this > one. Still doesn't work. gcc-3.3 should work fine, or gcc-4.0 if you have Xcode 2.1. Did you switch the link by hand? There's a tool to do this: gcc_select. Perhaps switching by hand broke things? Look in the 'config.log' file to see what error messages the compiler/ linker spat out when failing. You could post the relevant excerpt here if it's not obvious. > I guess at this point, I could try obliterating /usr/local/bin/ruby > entirely, and copy over the directory from my laptop. Yea, that > sounds like a recipe for more not-working . . . . Probably won't work unless you copy all of /usr/local, due to library dependencies. I use ruby from darwinports (www.darwinports.org) which installs into /opt/local. If there's some fundamental compiler problem on your system then it's unlikely to help though. |
|
From: Tom C. <ta...@ca...> - 2005-09-13 09:05:33
|
Have you tried the ruby packages from http://homepage.mac.com/discord/ Ruby/ ? I don't know whether they are sufficiently up-to-date now, but in my Panther days I found them very useful. Tom On 13 Sep 2005, at 09:56, Dave Howell wrote: > This is actually straight Ruby sadness, not specifically RubyCocoa. > Anybody willing to suggest a place to get help if this isn't it, > please do. > > Time to install Rails, I says to myself. Supposed to be a very > simple three line process. Oops, but I have to have Gems 8.5 or > later, and I have 8.3. OK, I'll ask 8.3 to update itself. Fails: it > can't find an update path. Various attempts to get it to go in > don't work. Eventually, I abandon Gems as incapable of handling its > update, and download the package, unpack by hand, and run the > installer from the command line. That appears to work. > > Dear Gem, install rails. Yes? Wonderful. ">rails /usr/local/bin/ > rails" Oh, but I'm not running 1.8.2. Except I am running 1.8.2, > but it's apparently the November version, and Rails requires the > December one. > > Fine. Download what ruby-lang.org tells me is the latest version. > Run ./configure. > "configure:2045: error: C compiler cannot create executables" > I recall once before having to change from the default gcc3.3 > compiler to something else. Sure enough, on my other system, gcc > has been redefined as gcc-3.1. I switch the gcc link to 3.1. > Doesn't work. I copy the gcc binary from my other computer to this > one. Still doesn't work. > > My server, on which I'm trying to install Rails, has basically a > stock Apple install of 10.3.9. > > Once again, just as I start to like Ruby, I get to descend to > installer-failure hell. Sigh. > > I guess at this point, I could try obliterating /usr/local/bin/ruby > entirely, and copy over the directory from my laptop. Yea, that > sounds like a recipe for more not-working . . . . > |
|
From: Dave H. <da...@gr...> - 2005-09-13 08:56:20
|
This is actually straight Ruby sadness, not specifically RubyCocoa. Anybody willing to suggest a place to get help if this isn't it, please do. Time to install Rails, I says to myself. Supposed to be a very simple three line process. Oops, but I have to have Gems 8.5 or later, and I have 8.3. OK, I'll ask 8.3 to update itself. Fails: it can't find an update path. Various attempts to get it to go in don't work. Eventually, I abandon Gems as incapable of handling its update, and download the package, unpack by hand, and run the installer from the command line. That appears to work. Dear Gem, install rails. Yes? Wonderful. ">rails /usr/local/bin/rails" Oh, but I'm not running 1.8.2. Except I am running 1.8.2, but it's apparently the November version, and Rails requires the December one. Fine. Download what ruby-lang.org tells me is the latest version. Run ./configure. "configure:2045: error: C compiler cannot create executables" I recall once before having to change from the default gcc3.3 compiler to something else. Sure enough, on my other system, gcc has been redefined as gcc-3.1. I switch the gcc link to 3.1. Doesn't work. I copy the gcc binary from my other computer to this one. Still doesn't work. My server, on which I'm trying to install Rails, has basically a stock Apple install of 10.3.9. Once again, just as I start to like Ruby, I get to descend to installer-failure hell. Sigh. I guess at this point, I could try obliterating /usr/local/bin/ruby entirely, and copy over the directory from my laptop. Yea, that sounds like a recipe for more not-working . . . . |
|
From: Dave H. <gr...@gr...> - 2005-09-10 08:07:46
|
On Sep 10, 2005, at 0:54, Dave Howell wrote: > How do I get my Ruby object back? Sigh. Never mind. I'd forgotten to include an array conversion one step later. |
|
From: Dave H. <gr...@gr...> - 2005-09-10 07:54:47
|
I'm doing a little program that has an outline view and a table view, and my Ruby code is being the datasource for both. The table view is to show details of whichever item is selected in the outline view. The outline view gets updated, in part with def outlineView_isItemExpandable(outlineTable, item) blah blah blah end In this case, "item" contains the Ruby object that's represented on that line of the outline view. Cool. I'm assuming that comes from the fact that my def outlineView_child_ofItem(outlineTable, child, item) is returning a Ruby object when called by the outline view. However, for the table view, I need to figure out what object is currently the selected object. So I'm doing this: def tableView_objectValueForTableColumn_row(table, tableColumn, row) currentRow = @myOutlineView.selectedRow selectedItem = @myOutlineView.itemAtRow(currentRow) blah blah end In this case, "selectedItem" contains <OSX::OCObject:0x142014 class='<RBObject: 0xa6234>' id=0x5737140>. It isn't unwrapping my RBObject from the OCObject. How do I get my Ruby object back? |
|
From: Steven A. <st...@ne...> - 2005-09-06 12:49:47
|
On Sep 6, 2005, at 3:43 AM, Jonathan Paisley wrote: > NSIndexSet.indexSetWithIndex(3) That was it, thanks Jonathan. :-) steve |
|
From: Jonathan P. <jp...@dc...> - 2005-09-06 07:43:36
|
On 6 Sep 2005, at 6:55, Steven Arnold wrote:
> In the irb session below I require/include needed libraries and
> then attempt to use the NSIndexSet class. This worked under PyObjC
> but does not seem to work under RubyCocoa. The docs suggest that
> NSIndexSet should respond to indexSetWithIndex:. Any ideas what's
> going on? Is this a bug?
> irb(main):039:0> NSIndexSet.alloc.indexSetWithIndex(3)
> OSX::OCMessageSendException: NSIndexSet#indexSetWithIndex: -
> methodSignature is nil.
indexSetWithIndex is a method on the NSIndexSet class, not a method
on NSIndexSet instances. You can tell the difference in the Xcode
documentation because class methods have a leading '+' and instance
methods a '-'.
So you either want:
NSIndexSet.indexSetWithIndex(3)
or
NSIndexSet.alloc.initWithIndex(3)
Hope that helps
Jonathan
|
|
From: Steven A. <st...@ne...> - 2005-09-06 05:56:04
|
Hi,
In the irb session below I require/include needed libraries and then
attempt to use the NSIndexSet class. This worked under PyObjC but
does not seem to work under RubyCocoa. The docs suggest that
NSIndexSet should respond to indexSetWithIndex:. Any ideas what's
going on? Is this a bug?
steve
irb(main):035:0> require 'osx/cocoa'
=> true
irb(main):037:0> include OSX
=> Object
irb(main):039:0> NSIndexSet.alloc.indexSetWithIndex(3)
OSX::OCMessageSendException: NSIndexSet#indexSetWithIndex: -
methodSignature is nil.
from /Library/Frameworks/RubyCocoa.framework/Versions/A/
Resources/ruby/osx/objc/oc_wrapper.rb:17:in `ocm_send'
from /Library/Frameworks/RubyCocoa.framework/Versions/A/
Resources/ruby/osx/objc/oc_wrapper.rb:17:in `method_missing'
from (irb):39
from :0
irb(main):040:0> NSIndexSet.alloc.indexSetWithIndex()
OSX::OCMessageSendException: NSIndexSet#indexSetWithIndex -
methodSignature is nil.
from /Library/Frameworks/RubyCocoa.framework/Versions/A/
Resources/ruby/osx/objc/oc_wrapper.rb:17:in `ocm_send'
from /Library/Frameworks/RubyCocoa.framework/Versions/A/
Resources/ruby/osx/objc/oc_wrapper.rb:17:in `method_missing'
from (irb):40
from :0
|
|
From: Karl-Heinz W. <kh...@wi...> - 2005-08-25 15:17:53
|
On 25.08.2005, at 16:37, Jonathan Paisley wrote: > On 25 Aug 2005, at 15:15, Karl-Heinz Wild wrote: > >> In the Window I've created a NSTableView with a bind toe the >> Controller >> Outlet - FileTableView => NSTableView( Files ) >> >> In the original source I click on the + Button an select one or >> more files >> in the dialog. After pressing OK the files will be in the >> FileTableView. >> >> Not so in my rewritten code. I've added some debuging statements >> and all >> seem ok, except the files will not be written to the FileTableView. >> > > Did you also connect the Controller as the dataSource for the > NSTableView? i.e., control-drag from the table view to the > Controller instance and choose dataSource. That could explain the > behaviour you're seeing. :) Thanks you very much. Now it works. regards Karl-Heinz |
|
From: Jonathan P. <jp...@dc...> - 2005-08-25 14:37:51
|
On 25 Aug 2005, at 15:15, Karl-Heinz Wild wrote: > In the Window I've created a NSTableView with a bind toe the > Controller > Outlet - FileTableView => NSTableView( Files ) > > In the original source I click on the + Button an select one or > more files > in the dialog. After pressing OK the files will be in the > FileTableView. > > Not so in my rewritten code. I've added some debuging statements > and all > seem ok, except the files will not be written to the FileTableView. Did you also connect the Controller as the dataSource for the NSTableView? i.e., control-drag from the table view to the Controller instance and choose dataSource. That could explain the behaviour you're seeing. Also, when making connections to the NSTableView, make sure that it really is the NSTableView that's being selected - I often accidentally create connections to the NSTableColumn, since it's far easier to select. Hope that helps, Jonathan |
|
From: Karl-Heinz W. <kh...@wi...> - 2005-08-25 14:16:09
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 25.08.2005, at 16:07, Jonathan Paisley wrote: > On 25 Aug 2005, at 14:37, Karl-Heinz Wild wrote: > > >> Can someone give me a hint what I should looking for. >> Maybe a flag in the .nib part of the application. >> > > I'm afraid I couldn't find the link to Xcode project in the article > to download to see the original. http://www.macdevcenter.com/mac/2004/10/12/examples/code.zip > Could you explain in more detail what's not working? What I'm > assuming is that when you've selected some files in the dialog box > they don't get added to the table view... Ok. I'll try to explain. In the Window I've created a NSTableView with a bind toe the Controller Outlet - FileTableView => NSTableView( Files ) In the original source I click on the + Button an select one or more files in the dialog. After pressing OK the files will be in the FileTableView. Not so in my rewritten code. I've added some debuging statements and all seem ok, except the files will not be written to the FileTableView. > Perhaps you could post the entire source for the controller class, > or else put a zip file of your project online somewhere and post > the URL here. require 'osx/cocoa' class Controller < OSX::NSObject include OSX ib_outlets :fileTableView, :fileType, :archiveFile, :fileTypeView, :mainWindow def initialize @files = Array.new end def addFile(sender) oPanel = NSOpenPanel.openPanel oPanel.setAllowsMultipleSelection(true) buttonClicked = oPanel.runModal if buttonClicked == NSOKButton files = oPanel.filenames count = files.count for i in 0..count - 1 # puts files.objectAtIndex( i ) @files.push( files.objectAtIndex(i)) end @fileTableView.reloadData end end def removeFile( sender ) puts "removeFile methode" end def browseForArchive( sender ) puts "browseForArchive methode" end def createArchive( sender ) puts "createArchive methode" end def extractArchive( sender ) puts "extractArchive methode" end def numberOfRowsInTableView( afileTable ) @files.length puts "hier" end def tableView_objectValueForTableColumn_row( afileTable, aTableColumn, rowIndex ) @files[ rowIndex ] puts "dort" end end Thanks. Karl-Heinz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFDDdKck3cK3IljlKMRAoWJAJ9gOH2wDLjlfWaT9YR+6uQVFcCGVwCeLa6d cPcNjoLN8eEn+z58a8NG/7M= =EWTr -----END PGP SIGNATURE----- |
|
From: Jonathan P. <jp...@dc...> - 2005-08-25 14:07:44
|
On 25 Aug 2005, at 14:37, Karl-Heinz Wild wrote: > Can someone give me a hint what I should looking for. > Maybe a flag in the .nib part of the application. I'm afraid I couldn't find the link to Xcode project in the article to download to see the original. Could you explain in more detail what's not working? What I'm assuming is that when you've selected some files in the dialog box they don't get added to the table view... Perhaps you could post the entire source for the controller class, or else put a zip file of your project online somewhere and post the URL here. Thanks Jonathan |
|
From: Karl-Heinz W. <kh...@wi...> - 2005-08-25 13:38:00
|
Hi. I'm totaly new in Ruby/OSX and also not the expert in programming ruby. I'm working through the example on http://www.macdevcenter.com/pub/a/mac/2004/10/12/cocoa.html?page=1 This part works in the source I've downloaded from the page below but not in the code I've written. def addFile(sender) oPanel = NSOpenPanel.openPanel oPanel.setAllowsMultipleSelection(true) buttonClicked = oPanel.runModal if buttonClicked == NSOKButton files = oPanel.filenames count = files.count for i in 0..count - 1 # puts files.objectAtIndex( i ) @files.push( files.objectAtIndex(i)) end @fileTableView.reloadData end end Can someone give me a hint what I should looking for. Maybe a flag in the .nib part of the application. Sorry if this mail is OT but where else could I ask for. Thanks and regards Karl-Heinz |
|
From: Steven A. <st...@ne...> - 2005-08-23 13:21:40
|
On Aug 23, 2005, at 3:50 AM, Jonathan Paisley wrote: > Hope that makes sense. It does, thanks a lot! steve |
|
From: Jonathan P. <jp...@dc...> - 2005-08-23 07:50:54
|
On 23 Aug 2005, at 2:12, Steven Arnold wrote: > > Here's a complete program, runnable on the command-line, that will > break. If you comment out the "private" line and the attr_accessor > line, it will work. It does not have the same problem with public > or protected attributes! > > Weird...... Any thoughts? I don't think the attr_accessor is relevant. What's happening is this: 'private' with no arguments makes all following methods private. The getHash method is private. When you call it from outside the class, ruby fails to find the method and invokes method_missing if defined. If it wasn't, you'd get something like: private method `getHash' called for #<Y:0x4fce88> (NoMethodError) Since method_missing is defined by RubyCocoa, it does the method lookup, which ignores the method protection. Solution: add 'public' sometime after 'private' in order to reset the protection. Hope that makes sense. Jonathan |
|
From: Steven A. <st...@ne...> - 2005-08-23 01:12:16
|
Hi Jonathan, thanks for your reply.
On Aug 22, 2005, at 4:19 PM, Jonathan Paisley wrote:
> On 22 Aug 2005, at 17:45, Steven Arnold wrote:
>
>> When I call self.getFormValues, I do not get back a Ruby Hash, but
>> rather a Cocoa NSCFDictionary. Right before the return, it's a
>> hash....but when it gets back, it's an NSCFDictionary.
>
> Could you include the exact code you're using when calling
> getFormValues? The behaviour ought to be as you're hoping, but it
> won't if the method call is going via the Objective C bridge.
Here's a complete program, runnable on the command-line, that will
break. If you comment out the "private" line and the attr_accessor
line, it will work. It does not have the same problem with public or
protected attributes!
Weird...... Any thoughts?
require 'osx/cocoa'
class X < OSX::NSObject
private
attr_accessor :datamanager
def getHash
{}
end
def me
self
end
def selfGetHash
self.getHash
end
end
x = X.alloc.init
p x.getHash #=> {}
p x.me #=> #<X:0x812db2 class='X' id=0x12a02f0>
p x.selfGetHash #=> {}
p x.oc_me #=> #<X:0x812db2 class='X' id=0x12a02f0>
p x.oc_getHash #=> #<OSX::OCObject:0x80e596 class='NSCFDictionary'
id=0x12a9f30>
p x.oc_selfGetHash #=> #<OSX::OCObject:0x80d844
class='NSCFDictionary' id=0x12abc30>
steve
|
|
From: Jonathan P. <jp...@dc...> - 2005-08-22 20:20:34
|
On 22 Aug 2005, at 17:45, Steven Arnold wrote:
>
> When I call self.getFormValues, I do not get back a Ruby Hash, but
> rather a Cocoa NSCFDictionary. Right before the return, it's a
> hash....but when it gets back, it's an NSCFDictionary.
Could you include the exact code you're using when calling
getFormValues? The behaviour ought to be as you're hoping, but it
won't if the method call is going via the Objective C bridge.
The effects you're seeing should only occur if the method call goes
via the objective-c bridge. For normal method calls directly on a
ruby object when the target method is implemented in ruby, it
shouldn't get involved. The bridge is implemented by hooking into
method_missing, so it gets involved when the method can't be found in
ruby.
You can force the bridge to get involved by prefixing the method name
with 'oc_', which is a special case. Since a method with this name
doesn't exist, the Objective C bridge will get invoked, and it strips
the 'oc_' prefix. It converts arguments and return values to and from
Objective C, makes the Objective C call, which ends up getting routed
back to the ruby code.
For example:
class X < OSX::NSObject
def getHash
{}
end
def me
self
end
def selfGetHash
self.getHash
end
end
x = X.alloc.init
x.getHash #=> {}
x.me #=> #<X:0x812db2 class='X' id=0x12a02f0>
x.selfGetHash #=> {}
x.oc_me #=> #<X:0x812db2 class='X' id=0x12a02f0>
x.oc_getHash #=> #<OSX::OCObject:0x80e596 class='NSCFDictionary'
id=0x12a9f30>
x.oc_selfGetHash #=> #<OSX::OCObject:0x80d844 class='NSCFDictionary'
id=0x12abc30>
Can you confirm that the above code behaves as expected?
Thanks
Jonathan
|
|
From: Steven A. <st...@ne...> - 2005-08-22 16:45:36
|
Hello,
I am writing a dictionary application in RubyCocoa. I have an object
that looks like this:
class DictDelegate < OSX::NSObject
include OSX
ib_outlets :acceptsAction, :acceptsObject, :acceptsQuality, :affixPositi
on,
:affixProduces, :comments, :definition, :examples, :sea
rchBar,
:synonyms, :window, :word, :wordList, :wordtype, :condi
tions
def getFormValues
# Return a hash of the values of the form.
{'word'=>@word.stringValue.to_s,
'wordtype'=>@wordtype.stringValue.to_s,
'definition'=>@definition.string.to_s,
'comments'=>@comments.string.to_s,
'acceptsAction'=>@acceptsAction.state,
'acceptsObject'=>@acceptsObject.state,
'acceptsQuality'=>@acceptsQuality.state,
'affixPosition'=>@affixPosition.stringValue.to_s,
'affixProduces'=>@affixProduces.stringValue.to_s}
end
end
When I call self.getFormValues, I do not get back a Ruby Hash, but
rather a Cocoa NSCFDictionary. Right before the return, it's a
hash....but when it gets back, it's an NSCFDictionary.
It would be far more convenient for me to get back the actual object
I returned. The auto-conversion behavior is not convenient. Is
there a way to get around this? Is this a bug?
I am running the current CVS version of rubycocoa. I'm on Mac OS X
Tiger 10.4.2 on a dual 2.5GHz with four GB of RAM.
steve
|
|
From: kimura w. <ki...@us...> - 2005-08-15 13:00:58
|
Hi, This is a bug of 0.4.1 or earlier. This bug was fixed in CVS. http://sourceforge.net/mailarchive/forum.php?thread_id=6997917&forum_id=7197 Sun, 14 Aug 2005 17:56:02 +0100, Will Thimbleby wrote: >This is a simple case that keeps causing me problems. A ruby object >passed to Cocoa and back doesn't come back as a ruby object. But >worse its accessors don't return ruby objects either. Why does this >code not work? IIs there something I should be doing?? > > >puts arr.objectAtIndex(0) # <RBObject: 0x4e51f0> >puts arr.objectAtIndex(0).class # OSX::OCObject >puts arr.objectAtIndex(0).num.class # OSX::NSDecimalNumber > >puts "<10" if arr.objectAtIndex(0).num < 10 #crash > -- kimura wataru |