Re: IB3 and custom controls: problem with actions

2008-07-05 Thread Vitaly Ovchinnikov
Does anybody use custom controls? I just created new project with new
NIB, added construction like
@interface MyControl : NSControl {} @end
Opened NIB, placed Custom View object to the window, changed its type
to MyControl, right clicked there and I didn't see Sent Action
group. It doesn't look like an IB bug. Or it looks like a very big
bug, but nobody reported it here

I saw ClockControl demo project - it uses IB plugin for custom
control, but it's not a good idea to create IB plugins for each custom
control I use (and use in this project only).

On Fri, Jul 4, 2008 at 12:47 PM, Vitaly Ovchinnikov
[EMAIL PROTECTED] wrote:
 I restarted it few times with no result. The only thing I didn't try
 is to create a new NIB-file (really bad way since I have about 20
 forms there...)
 Still hope that some solution exists.

 On Fri, Jul 4, 2008 at 11:33 AM, Chris [EMAIL PROTECTED] wrote:

 I think I've seen this a few times in IB3. But I fiddled a bit, saved,
 restarted and then it was working as I expected. I wrote it off to a bug at
 the time.


 On 04/07/2008, at 4:19 PM, Vitaly Ovchinnikov wrote:

 Hello all,

 I'm porting my project from XCode 2.5 to 3.0 and have a big trouble
 with custom controls. I have some custom controls (subclassed from
 NSControl), that I use in Interface Builder to create GUI.  When I
 used IB 2.5, I placed Custom View object to the window, changed it's
 class and then I was able to Ctrl+Drag an action to controller.

 After upgrade to XCode 3.0 I found out that now it is impossible. Old
 links are still alive (marked with yellow triangles), but I can't
 create a new one. I don't see Sent action group by right-clicking my
 controls. If I perform Ctrl+Drag from my control to the controller -
 it doesn't highlited. But if I do the same for NSButton - all works
 fine.

 Did I miss something?

 Thank you.
 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 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:
 http://lists.apple.com/mailman/options/cocoa-dev/idou747%40gmail.com

 This email sent to [EMAIL PROTECTED]



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


multiple UndoManagers

2008-07-05 Thread Georg Seifert

Hello,

I have a rather complicated undo setting
My document Object has a Array of independent graphical items  
(containing some properties).


Each item should have its own undo/redo based of selection in the  
interface. So I select Item_1, modify it, select Item_2 and modify it,  
too. Then I want to be able to select item_1 again and undo its changes.


I know that this is very unusual and may confuse users but it needs to  
be this way.


I have a Instance of NSUndoManager in each of my items. But how do I  
tell the menu which undoManager is active (to display an appropriate  
actionName).


any suggestion is welcome.
Thanks in advance
Georg

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


IBTool and .XIB files

2008-07-05 Thread Sam Jew
Hi everyone,

I upgraded to iPhone SDK beta 8 and all of a sudden my project doesn't work.  
In fact, the examples don't work either.  
They all generate the same error message:

Something.xib could not be handled because ibtool cannot open files of this 
type.

Excuse me?  I thought ibtool was for this purpose alone!

Although my iPhone project stopped compiling as soon as I upgraded to beta 8, I 
suspect I might have precluded a solution in that I attempted to rewrite and 
copy over the IBCocoaTouchPlugin.plugin file but I fear I may have just shot 
myself in the foot!

I've tried reinstalling the new SDK to no avail.  Is there some way to 
reinstall an IBCocoaTouchPlugin.plugin?  Is there some way to reinstall ibtool? 
 Are either of these things even the issue or are there settings within XCode 
that I need to adjust?  Surely I should be able to at least compile simple 
example apps with the latest tools and SDKs!

Any help would be most appreciated as I am at my wit's end!

Thanks kindly in advance,
Sam



  
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Using deprecated methods

2008-07-05 Thread Keith Blount
Hi,

Something that has bothered me for ages in Cocoa, but which I've always put to 
one side, is how to handle certain deprecated methods when supporting more than 
one OS. In some instances it's as simple as checking at runtime which OS is 
being used and using the appropriate method accordingly, but I'm wondering here 
about the trickier instances. For instance:

I am currently overhauling printing in my application. I have a page layout 
accessory view and I now also want to add a print panel accessory view. My app 
runs on both Tiger and Leopard. -setAccessoryView: works on both Tiger and 
Leopard, for adding an accessory view to both NSPageLayout and NSPrintPanel. 
However, in both cases, -setAccessoryView: was (rather frustratingly in this 
case, I feel, as it worked fine) informally deprecated on Leopard. Instead, we 
are advised to use -addAccessoryViewController:, which uses an 
NSViewController. But the NSViewController class doesn't even exist on Tiger, 
so subclassing it and having it in the project will cause the app not to run on 
Tiger at all. I don't want a different build for both Tiger and Leopard, of 
course, So, what is the proper way of handling this? The path of least 
resistance is to use -setAccessoryView: and hope it doesn't get formally 
deprecated on Snow Leopard, and continues to work for a while
 despite its deprecated status. But that obviously isn't the *best* (or 
correct) way of doing things. Any alternative is going to be more complicated 
and involve having separate elements of code for Tiger and Leopard, which isn't 
ideal, but I would love to know the established way of handling this.

Sorry if this question is a little dumb to those of you experienced in 
maintaining apps over several OS releases; I would be very grateful for your 
advice, though.

Many thanks in advance and all the best,
Keith


  
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: IB3 and custom controls: problem with actions

2008-07-05 Thread Andreas Mayer


Am 05.07.2008 um 08:37 Uhr schrieb Vitaly Ovchinnikov:


I didn't see Sent Action
group. It doesn't look like an IB bug. Or it looks like a very big
bug, but nobody reported it here...


I couldn't find a way to add Sent Actions to a custom control either.

Just hook it up per code in awakeFromNib - and file a bug on IB if it  
bothers you.



Andreas
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread Jean-Daniel Dupas


Le 5 juil. 08 à 14:08, Keith Blount a écrit :


Hi,

Something that has bothered me for ages in Cocoa, but which I've  
always put to one side, is how to handle certain deprecated methods  
when supporting more than one OS. In some instances it's as simple  
as checking at runtime which OS is being used and using the  
appropriate method accordingly, but I'm wondering here about the  
trickier instances. For instance:


I am currently overhauling printing in my application. I have a page  
layout accessory view and I now also want to add a print panel  
accessory view. My app runs on both Tiger and Leopard. - 
setAccessoryView: works on both Tiger and Leopard, for adding an  
accessory view to both NSPageLayout and NSPrintPanel. However, in  
both cases, -setAccessoryView: was (rather frustratingly in this  
case, I feel, as it worked fine) informally deprecated on Leopard.  
Instead, we are advised to use -addAccessoryViewController:, which  
uses an NSViewController. But the NSViewController class doesn't  
even exist on Tiger, so subclassing it and having it in the project  
will cause the app not to run on Tiger at all.


What make you think so ? You cna perfectly use 10.5 only symbol and  
target 10.4 as long as you check that this symbol exist before your  
use it.


if (MyLeopardOnlyFunction)
MyLeopardOnlyFunction(foo, bar, other);

You just have to be sure that your properly configure your project,  
that is set SDK to th emax target version( 10.5) and set deployment  
target to the min version (10.4)


So you just have to do something like this:

if ([myPanel  
respondsToSelector:@selector(addAccessoryViewController:)] ) {

 // go the nsviewcontroller way
} else {
 // use the old way
}





smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Popup dismissal

2008-07-05 Thread Fabian
Hi,

I need a notification when the user dismisses a popup menu _without
having actually clicked on a menu item_. A clumsy way of doing this
would be to check if the mouse is hovering over the menu in
NSPopUpButtonCell's popUpDismissed method. This way I can detect if
the user cancelled the operation by clicking on some other UI element.
But, naturally, this doesn't work if the user dismissed the menu by
pressing the escape key (because the cursor will still be hovering
over the menu). Is there a better way to do this?

Thanks.
F.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread Keith Blount
Hi,

Thanks for your reply. My project is set up just as you suggest and in fact I 
do use checks to see whether selectors are available and use the newer methods 
or older methods where appropriate where I can. But in the case I was talking 
about, there is a whole class that is unavailable - NSViewController. So, to 
use the new method (-addAccessoryController:) I would first need to create a 
subclass of NSViewController and include this subclass in the project. But 
given that the superclass (NSViewController) would not be available on Tiger, 
this would cause it to stall on Tiger. So I would need some way not only of 
checking for a particular method, but also of ignoring a whole class/subclass 
on the Tiger version... Moreover, the .nib file holding the accessory view 
would need to be connected up differently depending on whether it was using an 
NSViewController or not, meaning that there would probably need to be two 
different .nibs - identical in looks but
 different in connections, one of which was ignored on Tiger, the other ignored 
on Leopard...

Hope that makes sense.

All the best,
Keith

- Original Message 
From: Jean-Daniel Dupas [EMAIL PROTECTED]
To: Keith Blount [EMAIL PROTECTED]
Cc: cocoa-dev@lists.apple.com
Sent: Saturday, July 5, 2008 1:26:17 PM
Subject: Re: Using deprecated methods


Le 5 juil. 08 à 14:08, Keith Blount a écrit :

 Hi,

 Something that has bothered me for ages in Cocoa, but which I've  
 always put to one side, is how to handle certain deprecated methods  
 when supporting more than one OS. In some instances it's as simple  
 as checking at runtime which OS is being used and using the  
 appropriate method accordingly, but I'm wondering here about the  
 trickier instances. For instance:

 I am currently overhauling printing in my application. I have a page  
 layout accessory view and I now also want to add a print panel  
 accessory view. My app runs on both Tiger and Leopard. - 
 setAccessoryView: works on both Tiger and Leopard, for adding an  
 accessory view to both NSPageLayout and NSPrintPanel. However, in  
 both cases, -setAccessoryView: was (rather frustratingly in this  
 case, I feel, as it worked fine) informally deprecated on Leopard.  
 Instead, we are advised to use -addAccessoryViewController:, which  
 uses an NSViewController. But the NSViewController class doesn't  
 even exist on Tiger, so subclassing it and having it in the project  
 will cause the app not to run on Tiger at all.

What make you think so ? You cna perfectly use 10.5 only symbol and  
target 10.4 as long as you check that this symbol exist before your  
use it.

if (MyLeopardOnlyFunction)
MyLeopardOnlyFunction(foo, bar, other);

You just have to be sure that your properly configure your project,  
that is set SDK to th emax target version( 10.5) and set deployment  
target to the min version (10.4)

So you just have to do something like this:

if ([myPanel  
respondsToSelector:@selector(addAccessoryViewController:)] ) {
  // go the nsviewcontroller way
} else {
  // use the old way
}



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread David Duncan

On Jul 5, 2008, at 5:08 AM, Keith Blount wrote:

I am currently overhauling printing in my application. I have a page  
layout accessory view and I now also want to add a print panel  
accessory view. My app runs on both Tiger and Leopard. - 
setAccessoryView: works on both Tiger and Leopard, for adding an  
accessory view to both NSPageLayout and NSPrintPanel. However, in  
both cases, -setAccessoryView: was (rather frustratingly in this  
case, I feel, as it worked fine) informally deprecated on Leopard.  
Instead, we are advised to use -addAccessoryViewController:, which  
uses an NSViewController. But the NSViewController class doesn't  
even exist on Tiger, so subclassing it and having it in the project  
will cause the app not to run on Tiger at all. I don't want a  
different build for both Tiger and Leopard, of course, So, what is  
the proper way of handling this? The path of least resistance is to  
use -setAccessoryView: and hope it doesn't get formally deprecated  
on Snow Leopard, and continues to work for a while
despite its deprecated status. But that obviously isn't the *best*  
(or correct) way of doing things. Any alternative is going to be  
more complicated and involve having separate elements of code for  
Tiger and Leopard, which isn't ideal, but I would love to know the  
established way of handling this.



To handle a case like this, you are going to have to create a bundle  
that you link against the 10.5 SDK and only load there. This bundle  
will contain your NSViewController subclass and allow you to  
conditionally call -setAccessoryView: on 10.4 and - 
addAccessoryViewController: on 10.5. This is a general pattern that  
you can use when you want to provide alternate functionality where it  
is a requirement to subclass and that subclass only exists on a newer  
version of the OS.


As for -setAccessoryView: (and other deprecated methods) there really  
isn't a case of formal vs informal deprecation - deprecated is  
deprecated. In this particular case, using -setAccessoryView: for  
example will disable the inline print preview, so you'll want to avoid  
calling it on 10.5.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread Keith Blount
Many thanks for your reply, much appreciated. Where can I find information on 
creating bundles and linking them only against a certain OS? I'm obviously 
using the wrong search terms in both the docs and in Cocoa-dev... Under the 
NSBundle documentation it explains how to get a class out of an existing bundle 
using -principleClass, but I can't see how to turn a class into a bundle, or 
how to link the bundle specifically against Leopard, for instance... Is there 
an example of how to do this somewhere?
Many thanks again and all the best,
Keith

- Original Message 
From: David Duncan [EMAIL PROTECTED]
To: Keith Blount [EMAIL PROTECTED]
Cc: cocoa-dev@lists.apple.com
Sent: Saturday, July 5, 2008 2:17:32 PM
Subject: Re: Using deprecated methods

On Jul 5, 2008, at 5:08 AM, Keith Blount wrote:

 I am currently overhauling printing in my application. I have a page  
 layout accessory view and I now also want to add a print panel  
 accessory view. My app runs on both Tiger and Leopard. - 
 setAccessoryView: works on both Tiger and Leopard, for adding an  
 accessory view to both NSPageLayout and NSPrintPanel. However, in  
 both cases, -setAccessoryView: was (rather frustratingly in this  
 case, I feel, as it worked fine) informally deprecated on Leopard.  
 Instead, we are advised to use -addAccessoryViewController:, which  
 uses an NSViewController. But the NSViewController class doesn't  
 even exist on Tiger, so subclassing it and having it in the project  
 will cause the app not to run on Tiger at all. I don't want a  
 different build for both Tiger and Leopard, of course, So, what is  
 the proper way of handling this? The path of least resistance is to  
 use -setAccessoryView: and hope it doesn't get formally deprecated  
 on Snow Leopard, and continues to work for a while
 despite its deprecated status. But that obviously isn't the *best*  
 (or correct) way of doing things. Any alternative is going to be  
 more complicated and involve having separate elements of code for  
 Tiger and Leopard, which isn't ideal, but I would love to know the  
 established way of handling this.


To handle a case like this, you are going to have to create a bundle  
that you link against the 10.5 SDK and only load there. This bundle  
will contain your NSViewController subclass and allow you to  
conditionally call -setAccessoryView: on 10.4 and - 
addAccessoryViewController: on 10.5. This is a general pattern that  
you can use when you want to provide alternate functionality where it  
is a requirement to subclass and that subclass only exists on a newer  
version of the OS.

As for -setAccessoryView: (and other deprecated methods) there really  
isn't a case of formal vs informal deprecation - deprecated is  
deprecated. In this particular case, using -setAccessoryView: for  
example will disable the inline print preview, so you'll want to avoid  
calling it on 10.5.
--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]


  
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Popup dismissal

2008-07-05 Thread Fabian
Never mind. I figured out I can detect action dismissal with a simple
boolean (actionDismissed = YES when receiving a
NSPopUpButtonWillPopUpNotification, actionDismissed = NO when
receiving a NSMenuWillSendActionNotification).


On Sat, Jul 5, 2008 at 2:46 PM, Fabian [EMAIL PROTECTED] wrote:
 Hi,

 I need a notification when the user dismisses a popup menu _without
 having actually clicked on a menu item_. A clumsy way of doing this
 would be to check if the mouse is hovering over the menu in
 NSPopUpButtonCell's popUpDismissed method. This way I can detect if
 the user cancelled the operation by clicking on some other UI element.
 But, naturally, this doesn't work if the user dismissed the menu by
 pressing the escape key (because the cursor will still be hovering
 over the menu). Is there a better way to do this?

 Thanks.
 F.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread Jean-Daniel Dupas


Le 5 juil. 08 à 15:46, Keith Blount a écrit :

Many thanks for your reply, much appreciated. Where can I find  
information on creating bundles and linking them only against a  
certain OS? I'm obviously using the wrong search terms in both the  
docs and in Cocoa-dev... Under the NSBundle documentation it  
explains how to get a class out of an existing bundle using - 
principleClass, but I can't see how to turn a class into a bundle,  
or how to link the bundle specifically against Leopard, for  
instance... Is there an example of how to do this somewhere?

Many thanks again and all the best,
Keith


In your project, create a new Cocoa Bundle Target (that will  
contains all Leopar specifics classes). Then set the SDK to 10.5 and  
deployment version to 10.5 for this target.
Include this new bundle in your application resources, and load it  
using NSBundle resource at runtime.





smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Using deprecated methods

2008-07-05 Thread Jean-Daniel Dupas


Le 5 juil. 08 à 15:56, Jean-Daniel Dupas a écrit :



Le 5 juil. 08 à 15:46, Keith Blount a écrit :

Many thanks for your reply, much appreciated. Where can I find  
information on creating bundles and linking them only against a  
certain OS? I'm obviously using the wrong search terms in both the  
docs and in Cocoa-dev... Under the NSBundle documentation it  
explains how to get a class out of an existing bundle using - 
principleClass, but I can't see how to turn a class into a bundle,  
or how to link the bundle specifically against Leopard, for  
instance... Is there an example of how to do this somewhere?

Many thanks again and all the best,
Keith


In your project, create a new Cocoa Bundle Target (that will  
contains all Leopar specifics classes). Then set the SDK to 10.5 and  
deployment version to 10.5 for this target.
Include this new bundle in your application resources, and load it  
using NSBundle resource at runtime.




I forget to mention one point. I guess your bundle (with your pronter  
view and specifi nib) will use some classes and functions from your  
application.
If this is the case, you will have to do workaround some minor issues.  
When you will try to link your bundle, the linker will says that your  
bundle is undefined symbols.
You can either specify to the linker where it should search for thoses  
symboles; in your application. To do this you use the Bundle Loader  
build setting.
Or you may say to the linker to resolve undefined symbol at runtime  
(use Other Linker Flags build setting to pass -undefined  
dynamic_lookup).




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: IB3 and custom controls: problem with actions

2008-07-05 Thread Vitaly Ovchinnikov
Thanks for the answer. I have submitted a bug.

On Sat, Jul 5, 2008 at 4:18 PM, Andreas Mayer [EMAIL PROTECTED] wrote:

 Am 05.07.2008 um 08:37 Uhr schrieb Vitaly Ovchinnikov:

 I didn't see Sent Action
 group. It doesn't look like an IB bug. Or it looks like a very big
 bug, but nobody reported it here...

 I couldn't find a way to add Sent Actions to a custom control either.

 Just hook it up per code in awakeFromNib - and file a bug on IB if it
 bothers you.


 Andreas
 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 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:
 http://lists.apple.com/mailman/options/cocoa-dev/vitaly.ovchinnikov%40gmail.com

 This email sent to [EMAIL PROTECTED]

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSURLConnection and buffering

2008-07-05 Thread Arvind Jain

 Date: Fri, 4 Jul 2008 19:22:30 -0400
 From: Michael Ash [EMAIL PROTECTED]
 Subject: Re: NSURLConnection and buffering
 To: Cocoa Developers cocoa-dev@lists.apple.com
 Message-ID:
[EMAIL PROTECTED]
 Content-Type: text/plain; charset=UTF-8

 On Fri, Jul 4, 2008 at 4:34 AM, Arvind Jain [EMAIL PROTECTED] wrote:
  I'm using NSURLConnection to download a web page which is served from a
  server that uses HTTP 1.1 and chunked encoding. The web page consists of
 2
  sections; the server sends the first section which is about 300 bytes
  immediately, and has to do some processing for 30 seconds before it sends
  the next chunk which is larger (10KB).
 
  I'd like to display the first 300 bytes immediately, but my delegate
 method
  connection::didReceiveData is not called until after the second chunk is
  sent by the server (that is 30 seconds later). It appears there is a
 minimum
  buffer size in the NSURLConnection class - it won't give the bytes to me
  until it has accumulated that many bytes.I verified this by increasing
 the
  size of the first chunk. If is is 2KB or so, then I get the
 didReceiveData
  call right after the server has sent the first chunk.
 
  I noticed that Safari on Macbook pro has the same behavior. It won't
 render
  the first chunk until after the second one is sent.
  Any way to tell NSURLConnection to not buffer and send me bytes
 immediately?

 Are you sure that the data is even being sent when you want it to be?
 Until you've verified that it's making it onto the network by looking
 at the traffic with a network sniffer, I would hesitate to start
 assigning blame and debugging anything.

 Mike



Yes the server has sent the bytes to the client. I did do a tcpdump to
verify. Also, Firefox was able to render the first chunk whereas Safari as
well as my application couldn't.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread Keith Blount
Thank you very much for your reply and help - very clear and much appreciated.
Many thanks,
Keith

- Original Message 
From: Jean-Daniel Dupas [EMAIL PROTECTED]
To: Jean-Daniel Dupas [EMAIL PROTECTED]
Cc: Keith Blount [EMAIL PROTECTED]; Cocoa Development 
cocoa-dev@lists.apple.com
Sent: Saturday, July 5, 2008 3:03:10 PM
Subject: Re: Using deprecated methods


Le 5 juil. 08 à 15:56, Jean-Daniel Dupas a écrit :


 Le 5 juil. 08 à 15:46, Keith Blount a écrit :

 Many thanks for your reply, much appreciated. Where can I find  
 information on creating bundles and linking them only against a  
 certain OS? I'm obviously using the wrong search terms in both the  
 docs and in Cocoa-dev... Under the NSBundle documentation it  
 explains how to get a class out of an existing bundle using - 
 principleClass, but I can't see how to turn a class into a bundle,  
 or how to link the bundle specifically against Leopard, for  
 instance... Is there an example of how to do this somewhere?
 Many thanks again and all the best,
 Keith

 In your project, create a new Cocoa Bundle Target (that will  
 contains all Leopar specifics classes). Then set the SDK to 10.5 and  
 deployment version to 10.5 for this target.
 Include this new bundle in your application resources, and load it  
 using NSBundle resource at runtime.


I forget to mention one point. I guess your bundle (with your pronter  
view and specifi nib) will use some classes and functions from your  
application.
If this is the case, you will have to do workaround some minor issues.  
When you will try to link your bundle, the linker will says that your  
bundle is undefined symbols.
You can either specify to the linker where it should search for thoses  
symboles; in your application. To do this you use the Bundle Loader  
build setting.
Or you may say to the linker to resolve undefined symbol at runtime  
(use Other Linker Flags build setting to pass -undefined  
dynamic_lookup).



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: c++ exceptions in objective c call stack

2008-07-05 Thread Jim Crafton
 You cannot throw C++ exceptions across Objective-C functions. If you want to
 catch this exception, you will have to catch it in drawRect, and decide
 there what to do with it.

The earlier emails seem to mention that for 64bit apps this will not
be a problem. Is that the case or did I misunderstand them?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread Michael Ash
On Sat, Jul 5, 2008 at 8:08 AM, Keith Blount [EMAIL PROTECTED] wrote:
 Hi,

 Something that has bothered me for ages in Cocoa, but which I've always put 
 to one side, is how to handle certain deprecated methods when supporting more 
 than one OS. In some instances it's as simple as checking at runtime which OS 
 is being used and using the appropriate method accordingly, but I'm wondering 
 here about the trickier instances.

Generally, just use them.

I think you're overstating the effects of having a method be
deprecated. It is not a big EJECT! warning that suddenly lights up.
It's more like a service engine soon light. You can keep driving
until the parts start to fall off the car, it's just better if you're
able to get it looked at sooner.

Likewise, deprecated just means that use of the method is
discouraged, particularly in new code. The reason that they are
deprecated and not simply removed is so that old code continues to
work. Generally deprecated code isn't removed for a very long time, if
ever. If you look at APIs that have been deprecated in the past,
they've failed to jump transitions that break binary compatibility
(like 64-bit), but otherwise stick around.

Sometimes, like in this particular case, the method is discouraged
because its use now has some sort of negative impact on the
application. In that case you should analyze how much work it will be
to take the dual-method approach described in this thread and whether
that work is worthwhile to overcome the negative impact.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Loading a different interface

2008-07-05 Thread John Joyce
In my application, I would like to give my users the option to choose  
various interface styles.
I've laid out my interface using a standard NSPanel as well as the HUD  
version. Both are suitable, but some users will prefer one over the  
other, of course.

Currently, I have both windows in one NIB.
Is there a way to choose which window is loaded from the NIB?
Is it possible to do this without losing the data in the document? (it  
is document based)
Would it be better/more practical to factor these into two different  
NIBs?


Also, on the same subject, is there a way to force a HUD window to  
display the zoom and minimize buttons?


Lastly, I have envisioned the possibility of simply having an info  
button like in Dashboard widgets and providing functionality similar  
to Dashboard widgets for flipping the window around to adjust the  
settings of the window. Does anybody already know of some open source  
example doing something similar?


cheers,
John Joyce
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Layer Backed Views and CoreAnimation neither animate nor stay in place

2008-07-05 Thread Uli Kusterer

On 27.06.2008, at 14:56, Chilton Webb wrote:
(1) If I specify that I want anything other than the main view to  
have a layer, that view will instantly 'pop' to the foreground in  
the window. However, its actual view remains in the same place in  
the view hierarchy.



 As far as I've seen so far, whenever a new layer is created, it is  
inserted in the front. The only way I've found to fix it is to set the  
zPosition of each view's layer manually. However, luckily that seems  
to work :-)


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


command line arguments with NSWorkspace openFile

2008-07-05 Thread Jim Crafton
Is it possible to use NSWorkspace to open a file and pass in command
line arguments? I can't see anything in the docs about this and I
haven't found anything with google either.

Thanks

Jim
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: c++ exceptions in objective c call stack

2008-07-05 Thread Scott Ribe
 The earlier emails seem to mention that for 64bit apps this will not
 be a problem. Is that the case or did I misunderstand them?

You understood correctly. The restriction I described is for 32-bit apps.

-- 
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: multiple UndoManagers

2008-07-05 Thread Quincey Morris


On Jul 5, 2008, at 04:07, Georg Seifert wrote:

My document Object has a Array of independent graphical items  
(containing some properties).


Each item should have its own undo/redo based of selection in the  
interface. So I select Item_1, modify it, select Item_2 and modify  
it, too. Then I want to be able to select item_1 again and undo its  
changes.


I know that this is very unusual and may confuse users but it needs  
to be this way.


I have a Instance of NSUndoManager in each of my items. But how do I  
tell the menu which undoManager is active (to display an  
appropriate actionName).


Implementing the window delegate method 'windowWillReturnUndoManager:'  
to return the correct undo manager should do what you want.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSTableView and rows of different type

2008-07-05 Thread Erik Elmgren

Hi

First some background:

We are in the process of porting a multi-platform application (ERP and 
CRM) to cocoa. (we have a carbon client today, but also many other 
platforms). Because of the multi platform aspect and large number 
windows (about 100k windows in total for all languages) we can not use 
interface builder for the windows.


My problem:

In many of our records (such as invoice or general ledger 
transaction) we have what we call matrices (invoice rows are a good 
example). Right now we have implemented them with a NSTableView and it 
works fairly OK.


In these matrices we have the possibility for special typed rows, such 
as a payment row for cash invoices. (you buy 8 items, and pay $300 
cash and $500 with one credit card, $500 with another, and then get 
$27.55 in change for example).


These typed rows need a different positioning of the data than the 
normal columns (they have e.g. labels in the row to explain what type of 
row it is).


I think I understand how to solve the display part by using 
tableView:dataCellForTableColumn:row: and supplying a full-width cell 
(custom subclass), and then painting the fields inside by drawing other 
cells. But how do I solve that some of these cells need to be editable 
by the user? Alternatively, is there any way to reposition the cells 
horizontally (and change their width) for a specific row?


RegardsErik
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: command line arguments with NSWorkspace openFile

2008-07-05 Thread Charles Steinman
--- On Sat, 7/5/08, Jim Crafton [EMAIL PROTECTED] wrote:

 Is it possible to use NSWorkspace to open a file and pass in
 command line arguments?

I assume you mean you want to run a program with arguments. If you're trying to 
run a command-line program, it would be better to use NSTask rather than 
NSWorkspace.

Cheers,
Chuck


  
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


IKImageView crop/rotate issues

2008-07-05 Thread Janusz Sidor
Hi,
I've been trying to use IKImageView, but have some issues:
1. After using rotate, image knows about changes but is still the same 
size as loaded, imageSize shows new size after rotate but not image 
itself. How can i take this picture with new size? There is nothing in 
documentation about that. Maybe it is also putted in pasteboard?
2. I'm not sure which pasteboard I should use to implement paste 
functionality to get picture after crop.
I've written as beneath to save changes but bestType returns empty. What 
mistake am I doing?
NSPasteboard *pb = [NSPasteboard generalPasteboard];
NSArray *pasteTypes = [NSArray arrayWithObjects:
NSTIFFPboardType, NSPICTPboardType, nil];
NSString *bestType = [pb availableTypeFromArray:pasteTypes];
if (bestType != nil)
{
NSData *data = [pb dataForType:bestType];
}
I'm deeply sorry if that is trivial, but realy I don't know how to solve 
it.

Kindly regards


Która z gwiazd ma fajniejszy dekolt? Kto powinien zrezygnować z
mini? Oglądaj, oceniaj, baw się!
Wejdź na http://klik.wp.pl/?adr=http%3A%2F%2Fhityczykity.plsid=403


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: c++ exceptions in objective c call stack

2008-07-05 Thread Uli Kusterer

On 05.07.2008, at 17:01, Jim Crafton wrote:
You cannot throw C++ exceptions across Objective-C functions. If  
you want to
catch this exception, you will have to catch it in drawRect, and  
decide

there what to do with it.


The earlier emails seem to mention that for 64bit apps this will not
be a problem. Is that the case or did I misunderstand them?


Well, define problem: Of course, most C++ code will not try to catch  
or re-throw anything but std::exception-based exceptions, so you might  
still get odd behaviour because there's an NSException* thrown, or  
it'll just show up as an unknown exception. But yeah, it won't trash  
your stack on 64-bit if you throw from C++ through ObjC or ObjC++. Of  
course, if you throw *anything* through straight C, it will still  
cause problems. But that's that way for any C++, ObjC or longjmp that  
marches through straight C code.


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: c++ exceptions in objective c call stack

2008-07-05 Thread Clark Cox
On Sat, Jul 5, 2008 at 10:11 AM, Uli Kusterer
[EMAIL PROTECTED] wrote:
 On 05.07.2008, at 17:01, Jim Crafton wrote:

 You cannot throw C++ exceptions across Objective-C functions. If you want
 to
 catch this exception, you will have to catch it in drawRect, and decide
 there what to do with it.

 The earlier emails seem to mention that for 64bit apps this will not
 be a problem. Is that the case or did I misunderstand them?

 Well, define problem: Of course, most C++ code will not try to catch or
 re-throw anything but std::exception-based exceptions, so you might still
 get odd behaviour because there's an NSException* thrown, or it'll just show
 up as an unknown exception.

If C++ code behaves oddly in the presence of unknown exceptions, then
that C++ code is broken. :)

 But yeah, it won't trash your stack on 64-bit
 if you throw from C++ through ObjC or ObjC++. Of course, if you throw
 *anything* through straight C, it will still cause problems. But that's that
 way for any C++, ObjC or longjmp that marches through straight C code.

-- 
Clark S. Cox III
[EMAIL PROTECTED]
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Layer Backed Views and CoreAnimation neither animate nor stay in place

2008-07-05 Thread David Duncan

On Jul 5, 2008, at 8:34 AM, Uli Kusterer wrote:


On 27.06.2008, at 14:56, Chilton Webb wrote:
(1) If I specify that I want anything other than the main view to  
have a layer, that view will instantly 'pop' to the foreground in  
the window. However, its actual view remains in the same place in  
the view hierarchy.


 As far as I've seen so far, whenever a new layer is created, it is  
inserted in the front. The only way I've found to fix it is to set  
the zPosition of each view's layer manually. However, luckily that  
seems to work :-)



You can use -insertSublayer:[atIndex: | below: | above:] to put a  
layer in a specific ordering in the layer tree. This is generally  
cheaper than changing the zPosition, as a change in zPosition forces  
the sublayer list to be depth sorted.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


auxiliary window doesn't show again after first show

2008-07-05 Thread Daniel Richman

Hi All,

I must be missing something blatantly obvious, but here goes: I made a 
Preferences window whose File's Owner is a custom class: 
PreferencesController, which is a subclass of NSWindowController. If you 
click on the Preferences menu item, the window is shown by


[prefController showWindow:self];

The first time you go to Preferences, the window and all the stuff on it 
work fine. But on subsequent attempts to open the window, nothing 
happens. What am I missing?


Thanks,
Daniel
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: c++ exceptions in objective c call stack

2008-07-05 Thread Uli Kusterer

On 05.07.2008, at 19:52, Clark Cox wrote:

If C++ code behaves oddly in the presence of unknown exceptions, then
that C++ code is broken. :)



 Isn't that how code always is? ;-)

Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: auxiliary window doesn't show again after first show

2008-07-05 Thread mmalc crawford


On Jul 5, 2008, at 11:05 AM, Daniel Richman wrote:

[prefController showWindow:self];
The first time you go to Preferences, the window and all the stuff  
on it work fine. But on subsequent attempts to open the window,  
nothing happens. What am I missing?



Is the Release When Closed flag set for the window?
If the window is shown immediately and the Visible at Launch flag is  
set, have you connected the 'window' outlet?


mmalc


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: multiple UndoManagers

2008-07-05 Thread Georg Seifert


My document Object has a Array of independent graphical items  
(containing some properties).


Each item should have its own undo/redo based of selection in the  
interface. So I select Item_1, modify it, select Item_2 and modify  
it, too. Then I want to be able to select item_1 again and undo its  
changes.


I know that this is very unusual and may confuse users but it needs  
to be this way.


I have a Instance of NSUndoManager in each of my items. But how do  
I tell the menu which undoManager is active (to display an  
appropriate actionName).


Implementing the window delegate method  
'windowWillReturnUndoManager:' to return the correct undo manager  
should do what you want.


This was very helpfull. I didn’t thought that 5 lines of code could  
help. ;)


But than I have just another question: If I select more than one  
object.  All the handling of the undos of the single object I can do  
in the undo/redo functions of my delegate. But how do I tell the menu  
that the is something to undo? I would return a dummy undoManager?  
How do I set this up?


For now I can live with it that undo only works with on object  
selected but it would be very convenient for the users to have it in  
the long term.


Many Thanks again
Georg___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Toolbar code in separate Controller?

2008-07-05 Thread John Love
Apple's SimpleToolbar code *is all* their MyDocument.m.  My app would like
to place the toolbar-specific code *in a separate Controller*, say
ToolbarController. This transfer does work to a limited extent, that is,
the toolbar does in fact appear at the top of the window, as it should.
However, *what does not work* is the enabling/disabling based on the
specified target .. all toolbar items are disabled.  Details are as follows:

*Within MyDocument.h*:

@interface MedicalDocument:NSDocument {
IBOutlet ToolbarController *iboToolbarCtrl;
 IBOutlet FileController*iboFileCtrl;
// etc.
}


*Within MyDocument.m*:

- (void) windowControllerDidLoadNib:(NSWindowController*)aController {
[super windowControllerDidLoadNib:aController];

// etc

[iboToolbarCtrl retainOutlets];

[iboToolbarCtrl setupToolbar];

// etc
}


*Within ToolbarController.h* – all of which is taken from SimpleToolbar
(except being in a separate Controller, versus all in MyDocument.m)

#import Cocoa/Cocoa.h
#import FileController.h

@interface ToolbarController:NSObject {
IBOutlet NSToolbarItem  *openSpreadsheetItem, *saveSpreadsheetItem,
*stopCalculationItem;
IBOutlet NSObject   *openItemOutlet, *saveItemOutlet,
*stopItemOutlet;
IBOutlet FileController *iboFileCtrl;
IBOutlet NSWindow   *iboDocWindow;
}

- (void) dealloc;
- (void) retainOutlets;
- (void) setupToolbar;
- (NSToolbarItem*) toolbar:(NSToolbar*)toolbar
   itemForItemIdentifier:(NSString*)itemIdent
   willBeInsertedIntoToolbar:(BOOL) willBeInserted;
- (NSArray*) toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar;
- (NSArray*) toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar;
- (void) toolbarWillAddItem:(NSNotification*)notif;
- (void) toolbarDidRemoveItem:(NSNotification*)notif;
- (BOOL) validateToolbarItem:(NSToolbarItem*)toolbarItem;
- (BOOL) validateMenuItem:(NSMenuItem*)item;
@end

As stated at the start, the toolbar does in fact appear where it's supposed
to .. *it's just that all the items are disabled??*

Within *ToolbarController.m*, my setupToolbar method is identical to
Apple's, namely:

- (void) setupToolbar {
NSToolbar *toolbar = [[[NSToolbar alloc]
initWithIdentifier:MyDocToolbarIdentifier] autorelease];

[toolbar setAllowsUserCustomization:YES];
[toolbar setAutosavesConfiguration:YES];
[toolbar setDisplayMode:NSToolbarDisplayModeIconOnly];

[toolbar setDelegate:self];

[iboDocWindow setToolbar:toolbar];
}


My:
*-** (NSToolbarItem*) toolbar:(NSToolbar*)toolbar
   itemForItemIdentifier:(NSString*)itemIdent
   willBeInsertedIntoToolbar:(BOOL) willBeInserted;*
*except, I have such things as*:
[toolbarItem setTarget:iboFileCtrl];
[toolbarItem setAction:@selector(saveSpreadsheet:)];

My:
*- (void) toolbarWillAddItem:(NSNotification*)notif;*
*except, I have such things as*:
[openSpreadsheetItem setTarget:iboFileCtrl];
[openSpreadsheetItem setAction:@selector(openSpreadsheet:)];
since FileController.m contains the method openSpreadsheet

Further on:
*-** (BOOL) validateToolbarItem:(NSToolbarItem*)toolbarItem* {
BOOL enable = NO;

if ([[toolbarItem itemIdentifier] isEqual:OpenDocToolbarItemIdentifier])
{
enable = YES;
}
else if ([[toolbarItem itemIdentifier]
isEqual:SaveDocToolbarItemIdentifier])
{
if (![iboFileCtrl fileSaved])   enable = YES;
}
else if ([[toolbarItem itemIdentifier]
isEqual:StopDocToolbarItemIdentifier])
{
if (![iboFileCtrl fileFinishedCalculation])   enable = YES;
}

return enable;
}


And even later:

*- (void) toolbaritemclicked:(NSToolbarItem*)toolbarItem* {

if ([[toolbarItem itemIdentifier] isEqual:OpenDocToolbarItemIdentifier])
{
[iboFileCtrl openSpreadsheet];
}
else if ([[toolbarItem itemIdentifier]
isEqual:SaveDocToolbarItemIdentifier])
{
[iboFileCtrl saveSpreadsheet];
}
else if ([[toolbarItem itemIdentifier]
isEqual:StopDocToolbarItemIdentifier])
{
[iboFileCtrl stopCalculation];
}

}

Thanks to the patience of Graham Cox and others, I have learned a great deal
about targets and delegates .. so, I pray that my error does not involve
these concepts .. so I can at least say that my ignorance is on new ground.

John Love
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: IBTool and .XIB files

2008-07-05 Thread Andrew Farmer

On 05 Jul 08, at 04:23, Sam Jew wrote:

Hi everyone,

I upgraded to iPhon---


iPhone development is still under NDA. Wait another week and things  
may change.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: multiple UndoManagers

2008-07-05 Thread Quincey Morris


On Jul 5, 2008, at 11:37, Georg Seifert wrote:

But than I have just another question: If I select more than one  
object.  All the handling of the undos of the single object I can do  
in the undo/redo functions of my delegate. But how do I tell the  
menu that the is something to undo? I would return a dummy  
undoManager? How do I set this up?


For now I can live with it that undo only works with on object  
selected but it would be very convenient for the users to have it in  
the long term.


But the real question is, if you have multiple objects selected, which  
is the desired effect of Undo? Undo the last operation in each  
selected object? Undo the most recent operation done in any of the  
selected objects? How will the user know what the effect of choosing  
Undo will be? Without knowing the context of the problem, it sort of  
sounds like a terrible idea. :)


If you must do something complicated, I suppose you could create an  
additional undo manager (the multiple selection undo manager). Each  
time a multiple selection is made, load this undo manager up with a  
series of special undo actions that represent whatever behavior you  
want to undoing to have, and return it via  
windowWillReturnUndoManager:. These special undo actions would be  
implemented as a series of invocations of undos to the individual undo  
managers, presumably.


Or something like that.

Keep in mind that getting redo to work right in all cases might be  
hard or impossible. NSWindow does something along this line, using 2  
undo managers, when you type into a text field in a document window  
whose document has its own undo manager. But NSWindow actually gets  
redo wrong in this situation.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Toolbar code in separate Controller?

2008-07-05 Thread Uli Kusterer


On 05.07.2008, at 21:05, John Love wrote:

Apple's SimpleToolbar code *is all* their MyDocument.m.  My app  
would like

to place the toolbar-specific code *in a separate Controller*, say
ToolbarController. This transfer does work to a limited extent,  
that is,
the toolbar does in fact appear at the top of the window, as it  
should.

However, *what does not work* is the enabling/disabling based on the
specified target .. all toolbar items are disabled.  Details are as  
follows:



To enable/disable the toolbar items, Cocoa uses the  
NSUserInterfaceValidation protocol, and asks each responder in the  
responder chain, beginning at the first responder. Have you inserted  
your toolbar controller in the responder chain so it actually gets  
asked whether these methods should be enabled?


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Output of NSHTTPCookieStorage to NSTableView

2008-07-05 Thread James Murdza
On Tue, Jul 1, 2008 at 3:29 AM, Chris Purcell [EMAIL PROTECTED] wrote:
 How would I return domain for example?

[cookie domain]

But you can retrieve a dictionary of all the properties of the cookie like this:
[cookie properties]

NSHTTPCookie Class Reference -
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSHTTPCookie_Class/Reference/Reference.html#//apple_ref/occ/instm/NSHTTPCookie/domain
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Focus Ring in NSBrowser Column

2008-07-05 Thread Jean-Daniel Dupas


Le 5 juil. 08 à 21:48, James Murdza a écrit :


- (BOOL)needsDisplay;
{
NSResponder* resp = nil;


Note that there's an extra semicolon on the first line.


This is a valid syntax in Obj-C. You can let the semicolon for method  
implementation.





smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Loading a different interface

2008-07-05 Thread Chris Hanson


On Jul 5, 2008, at 8:30 AM, John Joyce wrote:

In my application, I would like to give my users the option to  
choose various interface styles.
I've laid out my interface using a standard NSPanel as well as the  
HUD version. Both are suitable, but some users will prefer one over  
the other, of course.

Currently, I have both windows in one NIB.
Is there a way to choose which window is loaded from the NIB?
Is it possible to do this without losing the data in the document?  
(it is document based)
Would it be better/more practical to factor these into two different  
NIBs?


Yes.  Refactor your interface into two nibs, where each nib is owned  
by an NSWindowController rather than by an NSDocument subclass.  Then  
you can override -[NSDocument makeWindowControllers] in your  
NSDocument subclass to instantiate whichever NSWindowController is  
initially appropriate, and when you want to switch interface styles  
you can use -[NSDocument addWindowController:] and -[NSDocument  
removeWindowController:] to get rid of the old and add the new.


  -- Chris

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Bit maps from raw camera files

2008-07-05 Thread James Merkel
I notice there are now about 120 Digital camera raw formats supported  
by Mac OS X as of system 10.5.4.

I am trying to get a bit map from these camera files so I am using:

NSBitmapImageRep * imageBitMap = [NSBitmapImageRep  
imageRepWithContentsOfFile:theFile]


For some raw files (Nikon NEF and Canon CR2) I get a bit map. But for  
other files (Sony DSLR-A100 ARW file) I get a nil bit map.
On the other hand, I notice that the system does support the Sony raw  
file in some way, since for example:


[[NSImage alloc] initWithContentsOfFile:theFile] does produce an image.

So the question is how to go about reliably getting a bit map reliably  
form these camera raw files?


Thanks.

Jim Merkel
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: IB3 and custom controls: problem with actions

2008-07-05 Thread Vitaly Ovchinnikov
Ops, sorry. I read control instead of controller. Of course I have
enough IBAction's in my controller class. I can Ctrl+Drag from any
standard control (NSButton or something like this). But not from the
custom one.

More, if I subclass standard control (like NSImageView, for example) -
IB eats this and allows to Ctrl+Drag actions. But not for subclasses
of NSControl itself. I compared my controls declaration with NSButton
and others - no significant difference. It seems that is is a bug of
IB 3.0.

On Sun, Jul 6, 2008 at 12:47 AM, Chris Hanson [EMAIL PROTECTED] wrote:
 On Jul 3, 2008, at 11:19 PM, Vitaly Ovchinnikov wrote:

 After upgrade to XCode 3.0 I found out that now it is impossible. Old
 links are still alive (marked with yellow triangles), but I can't
 create a new one. I don't see Sent action group by right-clicking my
 controls. If I perform Ctrl+Drag from my control to the controller -
 it doesn't highlited. But if I do the same for NSButton - all works
 fine.

 That means Interface Builder doesn't know your controller implements those
 actions.

 The actions a control can send are not part of the control, but are part of
 whatever you are sending an action to.  Thus your controller needs to have
 those actions declared in a header file in your project (or in a framework
 referenced by your project) in order for Interface Builder to recognize
 them.

 What does the declaration of your controller look like?

  -- Chris



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Method Sees Populated Array As Empty

2008-07-05 Thread Mark Wales
Is there any reason why a method would read an array as empty when  
every other method has no problems accessing it?


I don't think so. More likely is that you are accessing an array  
that is either empty or nil. It's impossible to tell without seeing  
the code but my guess would be that you're not accessing the same  
instance variable in -dataOfType: like you do in the other places  
where it works as expected.



(Sorry, new to this list. Not sure if I should reply to you and CC:  
the list or just reply to the list)


That's what I figured at first, but I copied the same NSLog(@%@,  
[self arrayOfReferences]) into every other method, so I don't see how  
it could be accessing a different array. And if I check the array just  
before and then just after it is not empty - so it can't be empty  
because where would the data have gone to? It's very confusing, I can  
see no reason why it would happen.

Here's some of the code:

Header

@interface MyDocument : NSDocument
{


NSMutableArray *arrayOfReferences;
}

Main

- (id)init
{
self = [super init];
if (self) {

arrayOfReferences = [[NSMutableArray alloc] init];

}
return self;
}

- (void)addEntryWithType:(NSString *)theType//longer in actual  
version

{
	Reference *reference = [[Reference alloc] initWithType:theType];		// 
longer in actual version

[arrayOfReferences addObject:reference];
[textView refreshView];
}


- (IBAction)performSearch:(id)sender
{
	NSLog(@%@, [self arrayOfReferences]);			//		== Works fine, shows  
the array as populated before and after the dateOfType is done
	[textView setSearchString:[searchField stringValue]];		// 	== This  
function uses the arrayOfReferences, so it must be populated

}

- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
{
	NSLog(@%@, [self arrayOfReferences]);			//		== Shows the array as  
empty


if ( outError != NULL ) {
		*outError = [NSError errorWithDomain:NSOSStatusErrorDomain  
code:unimpErr userInfo:NULL];

}

// Create an NSData object
return [NSKeyedArchiver  
archivedDataWithRootObject:arrayOfReferences];   		== doesn't do  
anything, but that's because it thinks the array is empty

}



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Capture Window/View created through NSTask

2008-07-05 Thread Michael Moore
I'm hoping someone might be able to assist me with this question.

I have a Cocoa application, with an embedded command-line tool in the
Resources folder.  This tool is from an outside source, and I have no
source code available for it.  When launched, it creates its own window,
and displays a variety of content.  I launch this tool via NSTask
(utilizing NSPipe to communicate with the tool via STDIN, STDOUT, and
STDERR).  

What I am hoping to do is find a way to capture the NSWindow/NSView
created by the tool and embed it in a Custom View in my nib.  Is there a
way to do this?  

Many thanks,
Michael

--
MIchael A. Moore :: Terbium Software :: [EMAIL PROTECTED] ::
http://terbium.org
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSAppleScript - compileAndReturnError always breaks with EXC_BAD_ACCESS

2008-07-05 Thread Alex Wied

Greetings,

I have a trivial AppleScript that I would like to compile and run  
under Objective-C. When I try to compile or execute it via  
compileAndReturnError or executeAndReturnError I'm permanetly  
receiving a EXC_BAD_ACCESS.


Here's my code:

=== CODE START ===
- (IBAction) simpleScript:(id)sender
{
	NSAppleScript* theScript = [[NSAppleScript alloc] initWithSource:  
@beep 3];

if (theScript != NULL)
{
NSDictionary* errDict = NULL;
// execution of the following line ends with EXC
if (YES == [theScript compileAndReturnError: errDict])
{
NSLog(@compiled the script);
[theScript executeAndReturnError: errDict];
}
[theScript release];
}
}
=== CODE END ===

I did some research and found similar reports that suggested that this  
might be a threading or garbage collection issue. I'm calling the code  
in the main thread (i.e. no threading) and also disabled auto garbage  
collection - without success.


I also tried a variety of other NSAppleScript sample. Whatever I try,  
my debugger always ends up with a EXC_BAD_ACCESS.


The precise error message in the status bar of the debugger is:

GDB: Program received signal: EXC_BAD_ACCESS.

I'm running XCode 3.1 under Leopard 10.5.4.

Any thoughts what's going wrong here? Is this a known problem?

Any help is greatly appreciated!

Thanks
-Alex
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Guidelines for Cocoa frameworks supporting garbage collection?

2008-07-05 Thread Quincey Morris


On Jul 5, 2008, at 14:23, Bill Cheeseman wrote:


Here's a specific question: My frameworks contain classes that declare
instance variables derived from CFType. For example, CGEventRef and
AXUIElementRef. In reading the Instance variables topic in the Core
Foundation Variables section of the Garbage Collection Programming  
Guide,

I see the statement, If you declare a Core Foundation structure as an
instance variable, the compiler regards it only as an opaque structure
pointer, not as an object To indicate that a Core Foundation  
structure
should be treated as a collectable object, you use the __strong  
keyword.


The example given declares a CFType-derived object as an instance  
variable

in the interface part of a class like this:

  __strong CFDateRef myDate;

So, I guess my frameworks should declare ...

  __strong CGEventRef myEvent;
  __strong AXUIElementRef myUIElement;

... if I am going to advertise the frameworks as supporting both
retain/release and garbage collection. Is that right?


Just to emphasize what Chris said:

With GC on, the CFRetain/CFRelease really do retain and release the  
same as with GC off. That *might* suggest the idea that don't need  
__strong instance variables. However, with GC on (assuming you went  
ahead and called CFMakeCollectable), the __strong instance variables  
in effect sorta serve as the replacement for autorelease functionality.


So, in dual-mode code, a CF object will typically be kept alive by its  
reference count, maintained as usual in setter methods. Only after a  
CFRelease takes the reference count from 1 to 0 does the __strong  
reference matter: it will keep the object from (potentially)  
disappearing at once. Normally, autorelease has that protective effect.


The other thing worth noting is that, when GC is enabled, any CF  
object that is documented to be *returned* already autoreleased from a  
frameworks function is actually returned with a reference count of 1,  
so you still need to call CFMakeCollectable yourself in that case,  
even though you wouldn't follow it with a call to autorelease like you  
would in Chris's examples.


If I've said anything wrong here, I'm sure Chris will jump in and  
correct me. :)



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Method Sees Populated Array As Empty

2008-07-05 Thread Matt Neuburg
On Sat, 5 Jul 2008 22:36:07 +0100, Mark Wales [EMAIL PROTECTED]
said:
Hello,

I'm trying to get a document based app to save the contents of an
array (NSMutableArray *arrayOfReferences) that is declared and
initialised in the MyDocument.m. Whenever any method in MyDocument.m
or other classes tries to access the arrayOfReferences it has no
problems and everything works fine, except for when I use the

- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError

method to save. I've put an NSLog(%@, arrayOfReferences) at the
beginning of this method and the array comes out as empty, even though
with every other method it is populated as it should be.

Perhaps you are not referring to the actual arrayOfReferences. I presume
arrayOfReferences is an ivar? Then maybe there is something wrong with your
accessors or your memory management. Use debugging or logging to check that
this is really the object you think it is. Since you don't show any code,
it's hard to say more. m.

-- 
matt neuburg, phd = [EMAIL PROTECTED], http://www.tidbits.com/matt/
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSURLConnection timeoutInterval only works in multiples of 30 seconds

2008-07-05 Thread kanny96
Hi,



I am trying to do a periodic update based on the contents of a url, but when 
the website is down with 5** error, I would like to not wait more than a couple 
of seconds. So, I wrote the following code :




url = [NSURL ...];



updateTimer = [[NSTimer scheduledTimerWithTimeInterval:60.0 
target:self selector:@selector(update:)


  userInfo:nil repeats:YES] retain];


[updateTimer fire]; 






-(void)update:(id)sender


{   


NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url 
cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:5];


NSURLResponse *urlResponse;


NSLog(@ Before );


NSData *urlData = [NSURLConnection sendSynchronousRequest:urlRequest 
returningResponse:urlResponse error:error];


NSLog(@ After : Error = %@ ,error);

.


.


}




But when i run the app, the After statement with timed out message is 
logged after 30 seconds from the Before statement. When I set the 
timeoutInterval between 30.1 to 59.9, it is printed after 60 seconds and so on. 
I don't know how to get it to work in desired time intervals. Any help would be 
appreciated.





Thanks


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Capture Window/View created through NSTask

2008-07-05 Thread Jean-Daniel Dupas


Le 6 juil. 08 à 00:43, Michael Moore a écrit :


I'm hoping someone might be able to assist me with this question.

I have a Cocoa application, with an embedded command-line tool in the
Resources folder.  This tool is from an outside source, and I have no
source code available for it.  When launched, it creates its own  
window,

and displays a variety of content.  I launch this tool via NSTask
(utilizing NSPipe to communicate with the tool via STDIN, STDOUT, and
STDERR).

What I am hoping to do is find a way to capture the NSWindow/NSView
created by the tool and embed it in a Custom View in my nib.  Is  
there a

way to do this?

Many thanks,
Michael


If you mean create an image from the window contents, you may have a  
look at the SonOfGrab sample (http://developer.apple.com/samplecode/SonOfGrab/ 
 ) that contains some sample to grab the content of a any window  
(even in other processes). Note that it requires 10.5.




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: NSAppleScript - compileAndReturnError always breaks with EXC_BAD_ACCESS

2008-07-05 Thread Matt Neuburg
On Sun, 6 Jul 2008 00:44:19 +0200, Alex Wied [EMAIL PROTECTED] said:
Greetings,

I have a trivial AppleScript that I would like to compile and run
under Objective-C. When I try to compile or execute it via
compileAndReturnError or executeAndReturnError I'm permanetly
receiving a EXC_BAD_ACCESS.

Here's my code:

=== CODE START ===
- (IBAction) simpleScript:(id)sender
{
 NSAppleScript* theScript = [[NSAppleScript alloc] initWithSource:
@beep 3];
 if (theScript != NULL)
 {
  NSDictionary* errDict = NULL;
  // execution of the following line ends with EXC
  if (YES == [theScript compileAndReturnError: errDict])
  {
   NSLog(@compiled the script);
   [theScript executeAndReturnError: errDict];
  }
  [theScript release];
 }
}
=== CODE END ===

This probably won't help much, but I copied and pasted your code into Xcode
and it ran fine on every machine I've got... However, I don't have the
version of Xcode that you have which we're not allowed to mention. m.

-- 
matt neuburg, phd = [EMAIL PROTECTED], http://www.tidbits.com/matt/
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: garbage collection and NSConnection

2008-07-05 Thread mmalc crawford


On Jul 5, 2008, at 3:00 PM, Joan Lluch (casa) wrote:

However, let me copy an excerpt of the Cocoa documentation on the GC  
algorithm that Cocoa uses.


You haven't updated your documentation since the beginning of November  
last year.




begin excerpt
[...]
The collector runs exclusively on the main thread of the  
application. At no time are all threads stopped for a collection  
cycle, and each thread is stopped for as short a time as is  
possible. Threads may be blocked for a short time while all  
unreachable objects are formed into the garbage list and weak  
references zeroed. Only threads that have directly or indirectly  
performed an[NSThread self] operation are subject to garbage  
collection.



This is not correct for the current implementation of the collector:

The collector is both request and demand driven. The Cocoa  
implementation makes requests at appropriate times. You can also  
programmatically request consideration of a garbage collection cycle,  
and if a memory threshold has been exceeded a collection is run  
automatically.


The collector runs on its own thread in the application. At no time  
are all threads stopped for a collection cycle, and each thread is  
stopped for as short a time as is possible. It is possible for threads  
requesting collector actions to block during a critical section on the  
collector thread's part. Only threads that have directly or indirectly  
performed an [NSThread self] operation are subject to garbage  
collection.


The collector is generational (see “Write Barriers”)—most collections  
are very fast and recover significant amounts of recently-allocated  
memory, but not all possible memory. Full collections are also fast  
and do collect all possible memory, but are run less frequently, at  
times unlikely to impact user event processing, and may be aborted in  
the presence of new user events.


http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcArchitecture.html 



mmalc

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: garbage collection and NSConnection

2008-07-05 Thread Bill Bumgarner

On Jul 5, 2008, at 3:00 PM, Joan Lluch (casa) wrote:
Basically for performance reasons, the G. collector preffers to  
let memory usage grow (while it is still available) in order to  
avoid too many collections or to try that the user does not notice  
it, and in practice it generally succeeds at it. But you will  
definitely notice some annoying sporadic app response delays of half  
a second or so specially if your app is very complex and maintains  
lots of objects referencing each other in complex graphs.


Only if some of those objects force the main thread to block (which  
can happen as certain objects do require finalization on the main  
thread -- these are considered to be bugs and will be eliminated as  
time permits) or if you have written classes with complex finalizers  
that cause your secondary threads to block.


And it isn't that the collector prefers to let memory usage grow.
More so that the collector strives to achieve a balance between memory  
use, responsiveness, and CPU cycles consumed, with user responsiveness  
being the most heavily weighted of the three.


If there are ways for the collector to collect more efficiently  
without impacting user responsiveness, said ways will be implemented


b.bum



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Key equivalents for an action without a visible object item

2008-07-05 Thread Kanny
Is it possible to define a key-equivalent for an action like in NSMenuItem but 
without any visible object ? 



The situation is like this: I have a NSTextField in nib file of my 
Application-Menu-less menubar app. I want it to receive Command-v for 'paste', 
but since I don't have/want a menuItem to connect to FirstResponder's paste 
method, it doesn't react in any way to Command-v. However the textfield is able 
to receive paste method by Control-clicking and selecting from the system-wide 
contextual menu. 




I tried to look for NSKeyBindingManager, but there isn't any documentation for 
that. 




Alternately, is there a method to capture the key-strokes while in the 
textfield without having to define a custom class of NSResponder ?






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Key equivalents for an action without a visible object item

2008-07-05 Thread Michael Ash
On Sat, Jul 5, 2008 at 8:14 PM, Kanny [EMAIL PROTECTED] wrote:
 Is it possible to define a key-equivalent for an action like in NSMenuItem 
 but without any visible object ?

 The situation is like this: I have a NSTextField in nib file of my 
 Application-Menu-less menubar app. I want it to receive Command-v for 
 'paste', but since I don't have/want a menuItem to connect to 
 FirstResponder's paste method, it doesn't react in any way to Command-v. 
 However the textfield is able to receive paste method by Control-clicking and 
 selecting from the system-wide contextual menu.

I don't know what a menubar app is, but if it's anything like an
LSUIElement app then you can just create the menu item like you
normally would. The menu bar doesn't appear, but any time the app is
frontmost the key equivalents still function.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Keyboard Shortcut for Stop

2008-07-05 Thread Alex Wait
It has the solid white up arrow, the apple/command symbol and what looks
like the right arrow.

I press these three keys to no avail. What am I doing wrong?

-- 
If you can't be kind, at least have the decency to be vague.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: IBTool and .XIB files

2008-07-05 Thread Sam Jew


On 05 Jul 08, at 04:23, Sam Jew wrote:
 Hi everyone,

 I upgraded to iPhon---

iPhone development is still under NDA. Wait another week and things  
may change.



Evidently the existence of this bug means I'm not doing any development for 
iPhone. 

I've seen the NDA excuse trotted out in other forums but don't find it 
particularly satisfying.  

From the license agreement: Confidential Information, however, does not 
include: (a) information
that is now or subsequently becomes generally available to the public
through no fault or breach on your part; 

I'm sure this qualifies as I can't even compile a new blank project for the 
same reason.  (Failure Reason: ibtool cannot open files of this type.  
(.xib))   I also get the same error when attempting to open up any of the .xibs 
in Interface Builder.

Even running ibtool from the Unix command line (not iPhone development) 
produces the following:

Macintosh:Metronome + Recording!!! samueljew$ ibtool --upgrade MainWindow.xib
?xml version=1.0 encoding=UTF-8?
!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN 
http://www.apple.com/DTDs/PropertyList-1.0.dtd;
plist version=1.0
dict
keycom.apple.ibtool.errors/key
array
dict
keydescription/key
string“MainWindow.xib” could not be handled because ibtool cannot 
open files of this type./string
keyfailure-reason/key
stringibtool cannot open files of this type./string
/dict
/array
/dict
/plist

Therefore, there's a number of areas where this particular issue shouldn't fall 
under the iPhone NDA, being apparently not specific to the iPhone.

Now when you say wait a week, is this a known technical issue that  Apple is 
working on and will have a solution for in a week?  And / or that in a week's 
time the NDA will be modified so people will have cause to be less paranoid 
about discussing situations like this?



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Output of NSHTTPCookieStorage to NSTableView

2008-07-05 Thread Michael Ash
On Sun, Jun 29, 2008 at 12:46 AM, Chris Purcell [EMAIL PROTECTED] wrote:
 Hello,
 Not sure where my problem is I've tried a few things and no success.  I am
 trying to output NSHTTPCookieStorage *cookies array to a table view.
  Whenever I call the objectValueForTableColumn:row method the app errors
 out, but if I leave it out the app launches displaying the correct number of
 rows with nothing in it (as expected since I left out the other method).

 Here is the code to get the cookies array:

NSHTTPCookieStorage* sharedCookieStorage = [NSHTTPCookieStorage
 sharedHTTPCookieStorage];
cookies = [sharedCookieStorage cookies] ;

 Here is the code to output the data to the table view:

 - (int)numberOfRowsInTableView:(NSTableView *)tableView
 {
return [cookies count];
 }

Please read over the guide to Cocoa memory management:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html

In particular, if you're going to use the cookies array after the
method where you fetch it, you must retain it.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Keyboard Shortcut for Stop

2008-07-05 Thread Andrew Farmer

On 05 Jul 08, at 18:33, Alex Wait wrote:
It has the solid white up arrow, the apple/command symbol and what  
looks

like the right arrow.

I press these three keys to no avail. What am I doing wrong?


More of an XCode question than a Cocoa question, but the symbol you're  
looking at is return, not right arrow.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: IBTool and .XIB files

2008-07-05 Thread Andrew Farmer

On 05 Jul 08, at 18:39, Sam Jew wrote:

On 05 Jul 08, at 04:23, Sam Jew wrote:

Hi everyone,

I upgraded to iPhon---


iPhone development is still under NDA. Wait another week and things
may change.


Evidently the existence of this bug means I'm not doing any  
development for iPhone.


I've seen the NDA excuse trotted out in other forums but don't find  
it particularly satisfying.


I don't find it particularly satisfying either. However, the list  
moderators have repeatedly stated that discussion of iPhone  
development is completely off-limits on this list, and I'm really in  
no position to dispute that.


I'm sure this qualifies as I can't even compile a new blank project  
for the same reason.  (Failure Reason: ibtool cannot open files  
of this type.  (.xib))   I also get the same error when attempting  
to open up any of the .xibs in Interface Builder.


Does the same issue occur with newly created Cocoa XIBs, or is it  
specific to the other kind? For what it's worth, I wasn't able to  
reproduce your issue with a few newly created XIBs, both of the Cocoa  
variety and of the kind we can't talk about. My best guess is that  
what you're seeing is a regression of some sort in the beta SDK you're  
using, which you should probably report to Apple.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread Charles Srstka

On Jul 5, 2008, at 10:43 AM, Uli Kusterer wrote:


On 05.07.2008, at 15:17, David Duncan wrote:
To handle a case like this, you are going to have to create a  
bundle that you link against the 10.5 SDK and only load there. This  
bundle will contain your NSViewController subclass and allow you to  
conditionally call -setAccessoryView: on 10.4 and - 
addAccessoryViewController: on 10.5. This is a general pattern that  
you can use when you want to provide alternate functionality where  
it is a requirement to subclass and that subclass only exists on a  
newer version of the OS.



Or rather, you'll want to do this in a more OO approach, i.e.  
abstract your custom print panel stuff away into a class. The base  
class is linked into your app, and the loadable bundles implement  
subclasses of these. Your app simply uses these classes, and they  
take care of using view controllers etc. as needed.


You'd just load the appropriate bundle and instantiate its main  
class, then hand it the appropriate views or whatever makes sense.


Alternately, you could also implement your own version of  
NSViewController and the viewcontroller-based accessory view  
methods, and just load them on 10.4 to provide backwards  
compatibility, while your code can effectively assume it always uses  
the 10.5 APIs.



I don't know how actually advisable this would be, but if your  
subclass can work decently well with or without being a subclass of  
NSViewController, you might be able to set the superclass to something  
like NSObject and then do something like this in the implementation:


#import objc/runtime.h

+ (void)load {
struct objc_class *class = (struct objc_class *)[self class];
Class superclass = NSClassFromString(@NSViewController);

if(superclass != NULL) {
class-super_class = superclass;
}
}

On Leopard, this would end up swapping the class's superclass to  
NSViewController, whereas on Tiger superclass would be NULL and you'd  
still be a subclass of NSObject. Your object would of course need to  
be able to handle both situations.


Gotta love Objective-C. However, the disclaimer is that I've never  
actually done something so drastic as swapping a superclass in my own  
code, so I don't know if this will have any evil and/or unexpected  
side effects, nor whether this is actually a good thing to be doing or  
not.


Charles
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Bit maps from raw camera files

2008-07-05 Thread James Merkel
Will look into CGImageRef using ImageIO. However, I found that if I  
use: imageRepsWithContentsOfFile: rather than  
imageRepWithContentsOfFile: I can get a bit map from all raw files  
that are supported by OS X. (At least for the raw files I have checked  
so far). The method  imageRepsWithContentsOfFile returns an array of  
file reps, so the following works:


NSBitmapImageRep * imageBitMap = nil;
NSArray * repsArray;
repsArray = [NSBitmapImageRep imageRepsWithContentsOfFile:theFile];

if([repsArray lastObject] != nil) {
imageBitMap = [repsArray objectAtIndex:0];
}

Jim Merkel


On Sat, 05 Jul 2008 14:16:46 -0700 Chris Hanson wrote:

On Jul 5, 2008, at 2:00 PM, James Merkel wrote:

So the question is how to go about reliably getting a bit map
reliably form these camera raw files?


Try getting a CGImageRef using ImageIO.


On Jul 5, 2008, at 2:00 PM, James Merkel wrote:

I notice there are now about 120 Digital camera raw formats supported
by Mac OS X as of system 10.5.4.
I am trying to get a bit map from these camera files so I am using:

NSBitmapImageRep * imageBitMap = [NSBitmapImageRep
imageRepWithContentsOfFile:theFile]

For some raw files (Nikon NEF and Canon CR2) I get a bit map. But for
other files (Sony DSLR-A100 ARW file) I get a nil bit map.
On the other hand, I notice that the system does support the Sony raw
file in some way, since for example:

[[NSImage alloc] initWithContentsOfFile:theFile] does produce an  
image.


So the question is how to go about reliably getting a bit map reliably
form these camera raw files?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Highlight Layer on Mouseover

2008-07-05 Thread Mike Rossetti
I've been putting together a drawing package using layers and having a  
terrific time!  But I'd appreciate a bit of guidance on the  
recommended approach for highlighting a layer as the mouse moves over  
the layer.  This is intended to give the user positive feedback as to  
which drawing element the mouse is actually hovering over.  There is a  
bezier path describing the boundaries of the drawing object.  A nice  
bloom highlight around the boundaries of the path would be perfect.   
Perhaps it could even have a mild 'throb'.


Obviously, the containing view has to handle the mouse movement  
detection--layers don't get events.  At first I was thinking the view  
could set a 'hovering' property on the layer and have an action take  
care of the animation but then realized that actions are probably most  
appropriate for transitions, and this is more of  a 'state'.


Currently, I'm thinking that the master view would just tell the  
appropriate layer (a specialization of CALayer) that's it's being  
hovered and the layer would add the highlighting (probably a sublayer  
with a copy of the bezier path which is simply drawn).  Alternately,  
the view could just add the sublayer and let it determine its  
superlayer's path.


Is this the right approach or is there a better way?

Thanks,
Mike

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread James Merkel

On Sat, 5 Jul 2008 05:08:45 -0700 (PDT) Keith Blount wrote:

Hi,

Something that has bothered me for ages in Cocoa, but which I've  
always put to one side, is how to handle certain deprecated methods  
when supporting more than one OS. In some instances it's as simple  
as checking at runtime which OS is being used and using the  
appropriate method accordingly, but I'm wondering here about the  
trickier instances. For instance:


I am currently overhauling printing in my application. I have a page  
layout accessory view and I now also want to add a print panel  
accessory view. My app runs on both Tiger and Leopard. - 
setAccessoryView: works on both Tiger and Leopard, for adding an  
accessory view to both NSPageLayout and NSPrintPanel. However, in  
both cases, -setAccessoryView: was (rather frustratingly in this  
case, I feel, as it worked fine) informally deprecated on Leopard.  
Instead, we are advised to use -addAccessoryViewController:, which  
uses an NSViewController. ...


This brings up another question. Is -setAccessoryView:  deprecated  
across the board or just for NSPageLayout and NSPrintPanel? I just  
added an accessory view to an NSSavePanel. There wasn't anything in  
the NSSavePanel docs that said -setAccessoryView: was deprecated there.


Thanks,

Jim Merkel
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: multiple UndoManagers

2008-07-05 Thread Graham Cox
I've done a lot of stuff recently with Undo in my DrawKit project,  
which sounds a little like what you are doing also. I have to say,  
having one undo manager per object sounds like a recipe for confusion.  
It's just not how undo is intended to work, and not how users expect  
Undo to work.


In DK, I have one undo manager per document which is the common model,  
and all undo operations for any object go to the same UM. Normally,  
you do not select the target for the undo manager when *undoing* - the  
target is recorded when *doing*. Then when the user invokes undo it  
just backtracks through all the operations you did - it knows what the  
target object is for each op, you shouldn't need to select it. Where  
you can interactively select objects (as in DK), the undo manager also  
records the selection state, but only along with any actual data  
changes made - simply changing the selection isn't normally recorded  
as an undoable task in itself. Then when the user undoes several  
things, the selection state also backtracks with it, so it's clear  
(and automatic) what object was affected by the undo.


By having one undo manager, it's also easy to manage the text in the  
undo menu item to say what is going to be undone. Only by using the  
undo manager in this expected way is this as easy as this - doing it  
your way you'll have to force a menu change every time your selection  
changes, which is probably possible, but definitely not the expected  
way to do it. You say it needs to be this way but why? It's so  
bizarre it's unlikely to win any friends amongst your app's users, and  
surely, doing it the conventional way is a much easier programming  
task too?


cheers, Graham



On 5 Jul 2008, at 9:07 pm, Georg Seifert wrote:


Hello,

I have a rather complicated undo setting
My document Object has a Array of independent graphical items  
(containing some properties).


Each item should have its own undo/redo based of selection in the  
interface. So I select Item_1, modify it, select Item_2 and modify  
it, too. Then I want to be able to select item_1 again and undo its  
changes.


I know that this is very unusual and may confuse users but it needs  
to be this way.


I have a Instance of NSUndoManager in each of my items. But how do I  
tell the menu which undoManager is active (to display an  
appropriate actionName).


any suggestion is welcome.
Thanks in advance
Georg

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


[Moderator] Re: IBTool and .XIB files

2008-07-05 Thread Scott Anguish

Whether you find the NDA satisfying or not isn't terribly relevant.

Discussion of the iPhone SDK is NOT allowed here.

Repeated and flagrant violations such as this are forwarded to WWDR  
for followup.


scott
moderator


On Jul 5, 2008, at 9:39 PM, Sam Jew wrote:




On 05 Jul 08, at 04:23, Sam Jew wrote:

Hi everyone,

I upgraded to iPhon---



iPhone development is still under NDA. Wait another week and things
may change.




Evidently the existence of this bug means I'm not doing any  
development for iPhone.


I've seen the NDA excuse trotted out in other forums but don't find  
it particularly satisfying.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Method Sees Populated Array As Empty

2008-07-05 Thread Graham Cox


On 6 Jul 2008, at 8:29 am, Mark Wales wrote:


@interface MyDocument : NSDocument

{


NSMutableArray *arrayOfReferences;
}





	NSLog(@%@, [self arrayOfReferences]);			//		== Shows the array  
as empty




Do you actually have an accessor method for arrayOfReferences? If not,  
referring to the ivar using [self arrayOfReferences] isn't correct.  
The fact it appears to work in some cases may be a blind fluke.


You need a method:

- (NSArray*)arrayOfReferences
{
return arrayOfReferences;
}

or just refer directly to the ivar:

NSLog(@%@, arrayOfReferences);




hth,


Graham
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Using deprecated methods

2008-07-05 Thread Scott Anguish


On Jul 6, 2008, at 12:25 AM, James Merkel wrote:


On Sat, 5 Jul 2008 05:08:45 -0700 (PDT) Keith Blount wrote:

Hi,

Something that has bothered me for ages in Cocoa, but which I've  
always put to one side, is how to handle certain deprecated methods  
when supporting more than one OS. In some instances it's as simple  
as checking at runtime which OS is being used and using the  
appropriate method accordingly, but I'm wondering here about the  
trickier instances. For instance:


I am currently overhauling printing in my application. I have a  
page layout accessory view and I now also want to add a print panel  
accessory view. My app runs on both Tiger and Leopard. - 
setAccessoryView: works on both Tiger and Leopard, for adding an  
accessory view to both NSPageLayout and NSPrintPanel. However, in  
both cases, -setAccessoryView: was (rather frustratingly in this  
case, I feel, as it worked fine) informally deprecated on Leopard.  
Instead, we are advised to use -addAccessoryViewController:, which  
uses an NSViewController. ...


This brings up another question. Is -setAccessoryView:  deprecated  
across the board or just for NSPageLayout and NSPrintPanel? I just  
added an accessory view to an NSSavePanel. There wasn't anything in  
the NSSavePanel docs that said -setAccessoryView: was deprecated  
there.



Deprecation is noted in the reference for a particular class. A  
deprecation such as this one will only be relevant to that class, and  
subclasses.


So, no, it isn't deprecated.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Guidelines for Cocoa frameworks supporting garbage collection?

2008-07-05 Thread Chris Hanson

On Jul 5, 2008, at 3:52 PM, Quincey Morris wrote:

The other thing worth noting is that, when GC is enabled, any CF  
object that is documented to be *returned* already autoreleased from  
a frameworks function is actually returned with a reference count of  
1, so you still need to call CFMakeCollectable yourself in that  
case, even though you wouldn't follow it with a call to autorelease  
like you would in Chris's examples.


I don't believe this is the case.  Can you give an example of a  
framework method that's documented to return an autoreleased CF object?


I would assume that the result of such a method has already had  
CFMakeCollectable called on it, making doing so unnecessary.


  -- Chris

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]