|
From: Tim P. <he...@ti...> - 2007-06-26 16:14:46
|
Hey Jon
Thanks for getting back to me. So if i add in the
kvc_accessor :server
declaration in my MyDocument.rb file, how would I access this as? As
my document is obviously already instantiated I wouldn't want to
create a new object as that would cause error. Unless the second
object I create subclass from NSManagedObject and I bind it within IB
to set the managedObjectContext to be the main object controller?
Perhaps I should be looking for an answer to my problem using
bindings rather than straight code as I know it. When you write
kvc_accessor what is that actually doing in the background?
Thanks
Tim
On 26 Jun 2007, at 13:57, Jon Baer wrote:
> From my understanding (ala bindings), you would make the @server
> object a kvc_accessor and access it via a key path.
>
> server.serverAddress
>
> Of course Im just guessing but Ive recently had to do a multi-level
> situation where I needed access in .nib for something else and went
> through a few more binding tutorials to understand what was
> happening. Im @ the point where Id like to dynamically setup all
> bindings @ runtime.
>
> - Jon
>
> On Jun 26, 2007, at 4:37 AM, Tim Perrett wrote:
>
>> Hey all
>>
>> I have managed to fix my core data problems which i previously posted
>> about (yay) but I am now working with my entitys and due to some lack
>> in my understanding struggling to actually access the data
>> programatically.
>>
>> I can access table attributes in MyDocument.rb with something like
>> this:
>>
>> @server.valueForKey('serverAddress')
>>
>> But what I want to do is access those values from another class, how
>> would I do this? I have read about KVC accessors and things but are
>> they even what I need? I would like this second class to handle all
>> the task processing and the ib_outlets and so on. This would mean
>> instantiating it in the nib in order to link the outlets, which
>> brings me back round to how can I then access items on my other
>> object?
>>
>> Thanks
>>
>> Tim
>>
>> ---------------------------------------------------------------------
>> -
>> ---
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Rubycocoa-talk mailing list
>> Rub...@li...
>> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk
>
>
> ----------------------------------------------------------------------
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Rubycocoa-talk mailing list
> Rub...@li...
> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk
>
|