Re: Dev tools private frameworks.
Re: Dev tools private frameworks.
- Subject: Re: Dev tools private frameworks.
- From: Eloy Duran <email@hidden>
- Date: Fri, 30 Nov 2007 13:43:32 +0100
Hi all,
Just to let you all know.
I don't necessarily need to use these frameworks, any suggestions on
how to add actions/outlets to a class in a v3 nib a very welcome.
I know I can alter the designable.nib file and add actions/outlets, so
what I'm asking is if people know other "cleaner" ways.
Also, just to double check that I didn't overlook it, it's impossible
to change classes with ibtool right?
Cheers,
Eloy
On 29 nov 2007, at 17:30, Eloy Duran wrote:
Hi Shawn,
I would like to be able to add/remove classes and outlets to a nib/
xib.
(And at some point instantiation would also be nice, but not
important.)
And I would like to be able to add file objects to a xcode project.
The reason I want these "evil" things, is for our project Rucola (http://rucola.rubyforge.org
).
Atm we use regular plist manipulation to add classes to nibs when
they are generated.
But I would really like to be able to use the frameworks that do
this instead of direct manipulation.
I hope that makes it a bit more clear why I would want to do such a
thing?
Anyways, in the meantime I figured out that I want to load a
IBDocument and it implements the readFromFileWrapper:ofType:error:
method.
This is the simple test code:
=====================
require 'osx/cocoa'
OSX.require_framework '/Developer/Library/Frameworks/
InterfaceBuilderKit.framework'
OSX.require_framework '/Developer/Library/PrivateFrameworks/
DevToolsFoundation.framework'
path = File.expand_path("~/Desktop/test.xib")
url = OSX::NSURL.URLWithString(path)
wrapper = OSX::NSFileWrapper.alloc.initWithPath(path)
#p OSX::IBDocument.readableTypes
doc = OSX::IBDocument.alloc.init
doc.readFromFileWrapper_ofType_error(wrapper,
'com.apple.interfacebuilder.document.cocoa')
=====================
Running this leads to:
2007-11-29 17:15:00.562 ruby[6142:10b] Assertion Failure: obj
2007-11-29 17:15:00.563 ruby[6142:10b] File: /SourceCache/
InterfaceBuilder/InterfaceBuilder-629/Framework/Utilities/
IBFoundationAdditions.m
2007-11-29 17:15:00.565 ruby[6142:10b] Line: 777
2007-11-29 17:15:00.653 ruby[6142:10b] Backtrace:
1. InterfaceBuilderKit 0x019c8ef6 [IBLibraryController
createDetailedDescriptionFromTemplate:]
2. InterfaceBuilderKit 0x019d88b0 [IBDocument
resolvePluginDependencies:error:]
3. InterfaceBuilderKit 0x019d7734 [IBDocument
decodeDesignableNibWithCoder:]
4. InterfaceBuilderKit 0x019d5da7 [IBDocument
readFromFileWrapper:ofType:error:]
5. libffi.dylib 0x902401dd ffi_call_SYSV
6. libffi.dylib 0x90240771 ffi_call
7. RubyCocoa 0x001a8aec rb_ffi_dispatch
8. RubyCocoa 0x00193cc5 objcptr_s_new_with_cptr
9. RubyCocoa 0x00194726 objcptr_s_new_with_cptr
10. libruby.1.dylib 0x000d10b7 rb_with_disable_interrupt
11. libruby.1.dylib 0x000da636 rb_eval_string_wrap
12. libruby.1.dylib 0x000db24a rb_eval_string_wrap
13. libruby.1.dylib 0x000d84c5 rb_eval_string_wrap
14. libruby.1.dylib 0x000d8e92 rb_eval_string_wrap
15. libruby.1.dylib 0x000d7574 rb_eval_string_wrap
16. libruby.1.dylib 0x000dae3c rb_eval_string_wrap
17. libruby.1.dylib 0x000db24a rb_eval_string_wrap
18. libruby.1.dylib 0x000e2231 rb_Array
19. libruby.1.dylib 0x000db184 rb_eval_string_wrap
20. libruby.1.dylib 0x000d84c5 rb_eval_string_wrap
21. libruby.1.dylib 0x000d829e rb_eval_string_wrap
22. libruby.1.dylib 0x000e7388 rb_load_protect
23. libruby.1.dylib 0x000e73b9 ruby_exec
24. libruby.1.dylib 0x000e73e5 ruby_run
25. ruby 0x00001fff main
26. ruby 0x00001fa6 start
2007-11-29 17:15:00.653 ruby[6142:10b] No object for
"com.apple.InterfaceBuilder.CocoaFramework" key.
So not there yet :)
Cheers,
Eloy
On 29 nov 2007, at 16:52, Shawn Erickson wrote:
On Nov 29, 2007, at 5:12 AM, Eloy Duran wrote:
Hello cocoa-dev,
I was wondering if anyone here has some experience using the
private frameworks that come
with the dev tools or pointers/online docs?
Specifically I would like to be able to open a nib, add a class
and/or outlets/actions.
You want to do the above to what? For what purpose? I think we need
more information to give you a helpful response.
Anyway if a framework is "private" you should use it for anything
other then research and fun... don't release a product based on it.
Also consider that you may not have the right to ship the framework
(assuming it isn't part of the OS).
-Shawn
_______________________________________________
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