valueForKeyPath: not found in protocol

2010-11-16 Thread Remco Poelstra
Hi,

I've somewhat the same problem as a recent thread, but I can't fix it with what 
was suggested in that thread.
I've to following class:
#import Foundation/Foundation.h
#import AudionetCommand.h
#import AudionetQueueDelegateProtocol.h
@interface AudionetCommandQueue : NSObject {
id AudionetQueueDelegate delegate;
}

@property (nonatomic, assign) id AudionetQueueDelegate delegate;
- (void) enqueueCommand:(AudionetCommand *)command;
@end
@implementation AudionetCommandQueue
@synthesize delegate;
- (void) enqueueCommand:(AudionetCommand *)command {
  //Lots of code
  if ([[delegate valueForKeyPath:@audionetDevices.address] isEqual: []]) {};
}
@end

I get the warning that valueForKeyPath: is not found in the protocols. If I 
change the instance variable to id AudionetQueueDelegate,NSKeyValueCoding, I 
get the error that the NSKeyValueCoding protocol can not be found. If I also 
#import NSKeyValueCodingProtocol.h than that header file is not found.
How can I fix this?

Kind regards,

Remco Poelstra

___

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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Gideon King
AFAIK, when something is referenced as a protocol like that, the *only* methods 
it knows about are the ones in the protocol. If you just cast the delegate to 
type id, you should be OK (I have encountered similar situations where this 
solution worked)

[(id)delegate valueForKeyPath:...

HTH

Gideon

On 16/11/2010, at 8:35 PM, Remco Poelstra wrote:

 Hi,
 
 I've somewhat the same problem as a recent thread, but I can't fix it with 
 what was suggested in that thread.
 I've to following class:
 #import Foundation/Foundation.h
 #import AudionetCommand.h
 #import AudionetQueueDelegateProtocol.h
 @interface AudionetCommandQueue : NSObject {
   id AudionetQueueDelegate delegate;
 }
 
 @property (nonatomic, assign) id AudionetQueueDelegate delegate;
 - (void) enqueueCommand:(AudionetCommand *)command;
 @end
 @implementation AudionetCommandQueue
 @synthesize delegate;
 - (void) enqueueCommand:(AudionetCommand *)command {
  //Lots of code
  if ([[delegate valueForKeyPath:@audionetDevices.address] isEqual: []]) {};
 }
 @end
 
 I get the warning that valueForKeyPath: is not found in the protocols. If I 
 change the instance variable to id AudionetQueueDelegate,NSKeyValueCoding, 
 I get the error that the NSKeyValueCoding protocol can not be found. If I 
 also #import NSKeyValueCodingProtocol.h than that header file is not found.
 How can I fix this?
 
 Kind regards,
 
 Remco Poelstra
 
___

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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Remco Poelstra
That works indeed. I hoped there was a more elegant solution.

Kind regards,

Remco Poelstra

Op 16 nov 2010, om 11:43 heeft Gideon King het volgende geschreven:

 AFAIK, when something is referenced as a protocol like that, the *only* 
 methods it knows about are the ones in the protocol. If you just cast the 
 delegate to type id, you should be OK (I have encountered similar situations 
 where this solution worked)
 
 [(id)delegate valueForKeyPath:...
 
 HTH
 
 Gideon
 
 On 16/11/2010, at 8:35 PM, Remco Poelstra wrote:
 
 Hi,
 
 I've somewhat the same problem as a recent thread, but I can't fix it with 
 what was suggested in that thread.
 I've to following class:
 #import Foundation/Foundation.h
 #import AudionetCommand.h
 #import AudionetQueueDelegateProtocol.h
 @interface AudionetCommandQueue : NSObject {
  id AudionetQueueDelegate delegate;
 }
 
 @property (nonatomic, assign) id AudionetQueueDelegate delegate;
 - (void) enqueueCommand:(AudionetCommand *)command;
 @end
 @implementation AudionetCommandQueue
 @synthesize delegate;
 - (void) enqueueCommand:(AudionetCommand *)command {
 //Lots of code
 if ([[delegate valueForKeyPath:@audionetDevices.address] isEqual: []]) {};
 }
 @end
 
 I get the warning that valueForKeyPath: is not found in the protocols. If I 
 change the instance variable to id AudionetQueueDelegate,NSKeyValueCoding, 
 I get the error that the NSKeyValueCoding protocol can not be found. If I 
 also #import NSKeyValueCodingProtocol.h than that header file is not found.
 How can I fix this?
 
 Kind regards,
 
 Remco Poelstra
 

___

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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Roland King
Or use 

NSObject* protocol  

Instead of id. Assuming that all the objects are NSObjects. 



On Nov 16, 2010, at 18:43, Gideon King gid...@novamind.com wrote:

 AFAIK, when something is referenced as a protocol like that, the *only* 
 methods it knows about are the ones in the protocol. If you just cast the 
 delegate to type id, you should be OK (I have encountered similar situations 
 where this solution worked)
 
 [(id)delegate valueForKeyPath:...
 
 HTH
 
 Gideon
 
 On 16/11/2010, at 8:35 PM, Remco Poelstra wrote:
 
 Hi,
 
 I've somewhat the same problem as a recent thread, but I can't fix it with 
 what was suggested in that thread.
 I've to following class:
 #import Foundation/Foundation.h
 #import AudionetCommand.h
 #import AudionetQueueDelegateProtocol.h
 @interface AudionetCommandQueue : NSObject {
id AudionetQueueDelegate delegate;
 }
 
 @property (nonatomic, assign) id AudionetQueueDelegate delegate;
 - (void) enqueueCommand:(AudionetCommand *)command;
 @end
 @implementation AudionetCommandQueue
 @synthesize delegate;
 - (void) enqueueCommand:(AudionetCommand *)command {
 //Lots of code
 if ([[delegate valueForKeyPath:@audionetDevices.address] isEqual: []]) {};
 }
 @end
 
 I get the warning that valueForKeyPath: is not found in the protocols. If I 
 change the instance variable to id AudionetQueueDelegate,NSKeyValueCoding, 
 I get the error that the NSKeyValueCoding protocol can not be found. If I 
 also #import NSKeyValueCodingProtocol.h than that header file is not found.
 How can I fix this?
 
 Kind regards,
 
 Remco Poelstra
 
 ___
 
 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/rols%40rols.org
 
 This email sent to r...@rols.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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Remco Poelstra
More elegant indeed :). I thought delegates had to be of type id.

Kind regards,

Remco Poelstra

Op 16 nov 2010, om 11:57 heeft Roland King het volgende geschreven:

 Or use 
 
 NSObject* protocol  
 
 Instead of id. Assuming that all the objects are NSObjects. 
 
 
 
 On Nov 16, 2010, at 18:43, Gideon King gid...@novamind.com wrote:
 
 AFAIK, when something is referenced as a protocol like that, the *only* 
 methods it knows about are the ones in the protocol. If you just cast the 
 delegate to type id, you should be OK (I have encountered similar situations 
 where this solution worked)
 
 [(id)delegate valueForKeyPath:...
 
 HTH
 
 Gideon
 
 On 16/11/2010, at 8:35 PM, Remco Poelstra wrote:
 
 Hi,
 
 I've somewhat the same problem as a recent thread, but I can't fix it with 
 what was suggested in that thread.
 I've to following class:
 #import Foundation/Foundation.h
 #import AudionetCommand.h
 #import AudionetQueueDelegateProtocol.h
 @interface AudionetCommandQueue : NSObject {
   id AudionetQueueDelegate delegate;
 }
 
 @property (nonatomic, assign) id AudionetQueueDelegate delegate;
 - (void) enqueueCommand:(AudionetCommand *)command;
 @end
 @implementation AudionetCommandQueue
 @synthesize delegate;
 - (void) enqueueCommand:(AudionetCommand *)command {
 //Lots of code
 if ([[delegate valueForKeyPath:@audionetDevices.address] isEqual: []]) {};
 }
 @end
 
 I get the warning that valueForKeyPath: is not found in the protocols. If I 
 change the instance variable to id 
 AudionetQueueDelegate,NSKeyValueCoding, I get the error that the 
 NSKeyValueCoding protocol can not be found. If I also #import 
 NSKeyValueCodingProtocol.h than that header file is not found.
 How can I fix this?
 
 Kind regards,
 
 Remco Poelstra
 
 ___
 
 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/rols%40rols.org
 
 This email sent to r...@rols.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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Mark Wright
Your AudionetQueueDelegate protocol is probably not inheriting from  
NSObject (the protocol) so it warns that valueForKeyPath: is not  
found.  It'll also probably complain about methods like  
respondsToSelector: which is also part of the NSObject protocol.


You need to write your protocol declaration in  
AudionetQueueDelegateProtocol.h as:



@protocol AudionetQueueDelegate NSObject
...
@end


Then it should silence the warnings and no casting is required (which  
is not the correct solution in this case I believe).






On 16 Nov 2010, at 10:35:31, Remco Poelstra wrote:


Hi,

I've somewhat the same problem as a recent thread, but I can't fix  
it with what was suggested in that thread.

I've to following class:
#import Foundation/Foundation.h
#import AudionetCommand.h
#import AudionetQueueDelegateProtocol.h
@interface AudionetCommandQueue : NSObject {
id AudionetQueueDelegate delegate;
}

@property (nonatomic, assign) id AudionetQueueDelegate delegate;
- (void) enqueueCommand:(AudionetCommand *)command;
@end
@implementation AudionetCommandQueue
@synthesize delegate;
- (void) enqueueCommand:(AudionetCommand *)command {
 //Lots of code
 if ([[delegate valueForKeyPath:@audionetDevices.address] isEqual:  
[]]) {};

}
@end

I get the warning that valueForKeyPath: is not found in the  
protocols. If I change the instance variable to id  
AudionetQueueDelegate,NSKeyValueCoding, I get the error that the  
NSKeyValueCoding protocol can not be found. If I also #import  
NSKeyValueCodingProtocol.h than that header file is not found.

How can I fix this?

Kind regards,

Remco Poelstra

___

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/blue.buconero%40virgin.net

This email sent to blue.bucon...@virgin.net


___

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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Remco Poelstra
Op 16 nov 2010, om 12:18 heeft Mark Wright het volgende geschreven:

 Your AudionetQueueDelegate protocol is probably not inheriting from 
 NSObject (the protocol) so it warns that valueForKeyPath: is not found.  
 It'll also probably complain about methods like respondsToSelector: which is 
 also part of the NSObject protocol.
 
 You need to write your protocol declaration in 
 AudionetQueueDelegateProtocol.h as:
 
 
 @protocol AudionetQueueDelegate NSObject
 ...
 @end
 
 
 Then it should silence the warnings and no casting is required (which is not 
 the correct solution in this case I believe).


That does not seem to work.
I now have:
#import UIKit/UIKit.h
@protocol AudionetQueueDelegate NSObject
@end

But then the warning returns. (Having set the delegate to id 
AudionetQueueDelegate again).

Kind regards,

Remco Poelstra

___

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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Roland King
Yes that wont work, which is why I said NSObject* protocol instead of 
idNSObject,protocol

valueForKeyPath: is not defined in the NSObject protocol, but is defined on 
NSObject itself which is why it works. 



On Nov 16, 2010, at 19:27, Remco Poelstra re...@beryllium.net wrote:

 Op 16 nov 2010, om 12:18 heeft Mark Wright het volgende geschreven:
 
 Your AudionetQueueDelegate protocol is probably not inheriting from 
 NSObject (the protocol) so it warns that valueForKeyPath: is not found.  
 It'll also probably complain about methods like respondsToSelector: which is 
 also part of the NSObject protocol.
 
 You need to write your protocol declaration in 
 AudionetQueueDelegateProtocol.h as:
 
 
 @protocol AudionetQueueDelegate NSObject
 ...
 @end
 
 
 Then it should silence the warnings and no casting is required (which is not 
 the correct solution in this case I believe).
 
 
 That does not seem to work.
 I now have:
 #import UIKit/UIKit.h
 @protocol AudionetQueueDelegate NSObject
 @end
 
 But then the warning returns. (Having set the delegate to id 
 AudionetQueueDelegate again).
 
 Kind regards,
 
 Remco Poelstra
 
 ___
 
 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/rols%40rols.org
 
 This email sent to r...@rols.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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Mark Wright


On 16 Nov 2010, at 11:27:22, Remco Poelstra wrote:


Op 16 nov 2010, om 12:18 heeft Mark Wright het volgende geschreven:

Your AudionetQueueDelegate protocol is probably not inheriting from  
NSObject (the protocol) so it warns that valueForKeyPath: is not  
found.  It'll also probably complain about methods like  
respondsToSelector: which is also part of the NSObject protocol.


You need to write your protocol declaration in  
AudionetQueueDelegateProtocol.h as:



@protocol AudionetQueueDelegate NSObject
...
@end


Then it should silence the warnings and no casting is required  
(which is not the correct solution in this case I believe).



That does not seem to work.
I now have:
#import UIKit/UIKit.h
@protocol AudionetQueueDelegate NSObject
@end

But then the warning returns. (Having set the delegate to id  
AudionetQueueDelegate again).


Kind regards,

Remco Poelstra



Yes, apologies for that, valueForKeyPath: (et al) is not part of the  
NSObject protocol.
It's part of the NSKeyValueCodingProtocol which is a category on  
NSObject (an 'informal protocol') so maybe Roland's suggestion is the  
best here:


NSObject AudionetQueueDelegate *delegate;

That also means the NSObject protocol inheritance isn't needed anymore  
since it's now typed as an NSObject...


___

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 arch...@mail-archive.com


Get current caret position

2010-11-16 Thread eveningnick eveningnick
Hello
I a wondering, if it is possible to get the current screen position of
a text cursor (text caret) using Cocoa? It is possible to do that in
Windows system (GetCaretPos), maybe Mac allows some similar
functionality?
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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Sherm Pendley
On Tue, Nov 16, 2010 at 6:27 AM, Remco Poelstra re...@beryllium.net wrote:

 Op 16 nov 2010, om 12:18 heeft Mark Wright het volgende geschreven:

  You need to write your protocol declaration in
 AudionetQueueDelegateProtocol.h as:
 
  @protocol AudionetQueueDelegate NSObject

 That does not seem to work.
 I now have:
 #import UIKit/UIKit.h
 @protocol AudionetQueueDelegate NSObject
 @end

 But then the warning returns.


Mark had the right idea, but the wrong protocol. You need to inherit from
the NSKeyValueCoding protocol, not NSObject.

sherm--

-- 
Cocoa programming in Perl:
http://camelbones.sourceforge.net
___

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 arch...@mail-archive.com


Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Sherm Pendley
On Tue, Nov 16, 2010 at 7:28 AM, Sherm Pendley sherm.pend...@gmail.comwrote:

 On Tue, Nov 16, 2010 at 6:27 AM, Remco Poelstra re...@beryllium.netwrote:

 Op 16 nov 2010, om 12:18 heeft Mark Wright het volgende geschreven:

  You need to write your protocol declaration in
 AudionetQueueDelegateProtocol.h as:
 
  @protocol AudionetQueueDelegate NSObject

 That does not seem to work.
 I now have:
 #import UIKit/UIKit.h
 @protocol AudionetQueueDelegate NSObject
 @end

 But then the warning returns.


 Mark had the right idea, but the wrong protocol. You need to inherit from
 the NSKeyValueCoding protocol, not NSObject.


Never mind, I just read Mark's followup. Since NSKeyValueCoding is an
informal protocol, your formal protocol can't inherit from it. :-(

sherm--

-- 
Cocoa programming in Perl:
http://camelbones.sourceforge.net
___

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 arch...@mail-archive.com


Re: Get current caret position

2010-11-16 Thread Graham Cox

On 16/11/2010, at 11:26 PM, eveningnick eveningnick wrote:

 I a wondering, if it is possible to get the current screen position of
 a text cursor (text caret) using Cocoa? It is possible to do that in
 Windows system (GetCaretPos), maybe Mac allows some similar
 functionality?


The text caret doesn't have a single, global position. It is really the 
position of the text selection within an active text view when the selection 
length is zero. If you want to know which logical characters the insertion 
point is at in a given text view, that's easy to find - just get the selection 
range and the location field is the position of interest. The text system has 
methods to convert the logical character position to a view position and from 
there to a screen position, but why do you want that? In other words, what are 
you really trying to do?

--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 arch...@mail-archive.com


Re: Get current caret position

2010-11-16 Thread eveningnick eveningnick
 The text caret doesn't have a single, global position. It is really the 
 position of the text selection within an active text view when the selection 
 length is zero. If you want to know which logical characters the insertion 
 point is at in a given text view, that's easy to find - just get the 
 selection range and the location field is the position of interest. The text 
 system has methods to convert the logical character position to a view 
 position and from there to a screen position, but why do you want that? In 
 other words, what are you really trying to do?


Hello, Graham
Basically i want to get the text caret position in Word 2011 active
document window. I want to place a popup window on that location.
Microsoft Word 2011 SDK is not available to public (i am not even sure
if this SDK includes such a GetCaretPosition() function, most likely
that the answer is No).
Thus i was thinking that as long as Word 2011 is a cocoa application,
its document is most likely something like a modified text field (not
sure though) and i could get that position (at least, relatively to
the main window's pos).
(there's a built in Visual Basic function called Get text selection
position relatively to page, but that there is no way to determine
that page's location)
Would that be possible to achive using cocoa framework's means?
Thanks,
George
___

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 arch...@mail-archive.com


Re: Get current caret position

2010-11-16 Thread Vincent Habchi
Le 16 nov. 2010 à 15:18, eveningnick eveningnick a écrit :

 Basically i want to get the text caret position in Word 2011 active
 document window. I want to place a popup window on that location.
 Microsoft Word 2011 SDK is not available to public (i am not even sure
 if this SDK includes such a GetCaretPosition() function, most likely
 that the answer is No).
 Thus i was thinking that as long as Word 2011 is a cocoa application,
 its document is most likely something like a modified text field (not
 sure though) and i could get that position (at least, relatively to
 the main window's pos).

I am unsure Word 2011 is a Cocoa application. It might be Carbon based.
Also, I don't know if Cocoa allows you to figure out other applications window 
parameters.
Vincent

___

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 arch...@mail-archive.com


Re: Get current caret position

2010-11-16 Thread eveningnick eveningnick
 Hi George,
 What you want to do would is within another's application.
 Any public hooks/APIs could be used...
 In this case VB and AppleScript.
 For deeper, Cocoa-based integration, you would probably need to work with 
 Microsoft.
 Couldn't hurt to try contacting them...

 The means mentioned earlier are from within your own application.

 You might also look into building an app/tool as a Service...

Hi John
Thanks for the answer
The problem is that AppleScript allows to discover the caret's
position only relatively to the page's left-top corner, while there is
no way to determine that page's left-top corner absolute position.
Thus, i can't place my popup window where the caret is located. I am
pretty sure, Visual Basic doesn't give much more possibilities (AFAIK,
VB and AS operate on the same core API, which is closed to public).

And about For deeper, Cocoa-based integration, you would probably
need to work with Microsoft.
What do you mean by working with Microsoft? I am not sure, but as far
as i know, they don't give out this low level API to 3d party
developers? And how could i contact them?
Perhaps some of Microsoft Office developers are looking through this
mailing list. Is there a place where i could find information about
who and on what conditions could get that mac:Office Word SDK APIs?

You might also look into building an app/tool as a Service...
but what advantages does building as service has comparing to an
ordinary external Cocoa application?

Thanks,
George
___

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 arch...@mail-archive.com


Re: [iPhone] Toolbar button and Touch Down

2010-11-16 Thread Matt Neuburg
On Mon, 15 Nov 2010 10:02:44 -0800, Jonathon Kuo 
newsli...@autonomy.caltech.edu said:
Interesting idea, probably a little beyond me. :) 

Nonsense. This is perfectly standard and easy. A UIButton can send an action 
message on TouchDown. It makes no difference that the UIButton is inside a 
UIBarButton. How much plainer can it be? m.

On Nov 12, 2010, at 8:53 PM, Dave DeLong wrote:
 
 What about initing a barButtonItem with a custom view (that view being a 
 UIButton that has the target/action set on the appropriate touch down inside 
 [the end zone! - sorry, couldn't resist]), and then setting the 
 target/action of the barButtonItem itself to nil?

--
matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings___

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 arch...@mail-archive.com


Garbage Collection, Standard Out, NSTask

2010-11-16 Thread Jon Gilkison
Below is a simple test application that launches a process and logs the output 
as it runs.
 
It works as expected when the app is set to no garbage collection, but as soon 
as I turn on garbage collection, the following notifications stop working:
 
- NSTaskDidTerminateNotification
- NSFileHandleReadCompletionNotification
 
It's been stumping me for a few days.
 
The sample app and source is at:
 
http://sessionsplus.com/TaskTester.zip
 
Thanks!
 
Jon.___

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 arch...@mail-archive.com


Re: Get current caret position

2010-11-16 Thread Scott Ribe
On Nov 16, 2010, at 7:18 AM, eveningnick eveningnick wrote:

 Thus i was thinking that as long as Word 2011 is a cocoa application,
 its document is most likely something like a modified text field (not
 sure though) and i could get that position (at least, relatively to
 the main window's pos).

Extremely unlikely that MS Word uses anything at all like a modified Cocoa text 
field.

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.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 arch...@mail-archive.com


Re: [iPhone] Toolbar button and Touch Down

2010-11-16 Thread Jonathon Kuo
On Nov 16, 2010, at 9:12 AM, Matt Neuburg wrote:

 On Mon, 15 Nov 2010 10:02:44 -0800, Jonathon Kuo 
 newsli...@autonomy.caltech.edu said:
 Interesting idea, probably a little beyond me. :) 
 
 Nonsense. This is perfectly standard and easy. A UIButton can send an action 
 message on TouchDown. It makes no difference that the UIButton is inside a 
 UIBarButton. How much plainer can it be? m.

I agree: that's how I expected it to work, too, but that's not how it does work 
(Xcode 3.2.4). If I drag a Round Rect Button onto the Toolbar, it instantly 
gets promoted to a UIBarButtonItem (really!), and I can't set Touch Down on 
it, nor can I change the class of it in IB. That's why I'm confused...

___

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 arch...@mail-archive.com


Re: [iPhone] Toolbar button and Touch Down

2010-11-16 Thread Dave DeLong
Which means you'd probably have to do it programmatically, or just have an 
IBOutlet to the UIButton inside the UIBarButtonItem.

Dave

On Nov 16, 2010, at 10:26 AM, Jonathon Kuo wrote:

 On Nov 16, 2010, at 9:12 AM, Matt Neuburg wrote:
 
 On Mon, 15 Nov 2010 10:02:44 -0800, Jonathon Kuo 
 newsli...@autonomy.caltech.edu said:
 Interesting idea, probably a little beyond me. :) 
 
 Nonsense. This is perfectly standard and easy. A UIButton can send an action 
 message on TouchDown. It makes no difference that the UIButton is inside a 
 UIBarButton. How much plainer can it be? m.
 
 I agree: that's how I expected it to work, too, but that's not how it does 
 work (Xcode 3.2.4). If I drag a Round Rect Button onto the Toolbar, it 
 instantly gets promoted to a UIBarButtonItem (really!), and I can't set 
 Touch Down on it, nor can I change the class of it in IB. That's why I'm 
 confused...
___

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 arch...@mail-archive.com


Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Adam Swift

On Nov 12, 2010, at 10:51 AM, Jerry Krinock wrote:

 When implementing this method:
 
-createDestinationInstancesForSourceInstance:entityMapping:manager:error:
 
 in a subclass of NSEntityMigrationPolicy, one typically loops through 
 attributes of the given source instance, does whatever migration logic is 
 desired, and then sets the results as attributes of a new destination 
 instance.
 
 Some time ago, I learned that one does not want to invoke the -foo and 
 setFoo: accessors in this method, because, duh, the invoked methods may no 
 longer exist in the current implementation of the managed object.  Life has 
 improved since I've been careful to leave the objects typed as unsubclassed 
 NSManagedObject instances, which forces me to use -valueForKey: and 
 -setValue:forKey:.
 
 But wait, there's more.  Although these source objects log their type as Baz 
 or whatever, they do not respond to Baz subclass methods, only 
 NSManagedObject methods.  They are like the proxy objects that are sometimes 
 delivered by KVO.  It's rather confusing to see an exception such as -[Baz 
 foo]: unrecognized selector when your implementation of Baz clearly has a 
 -foo, but it makes sense when you stop to consider what's going on.  
 Migration is sandboxxed.  The system only has the old store to work with; not 
 the old class.  Because the entity and apparently the class are stored in the 
 store, it knows that the object is a Baz instance, but it does not know any 
 of the old Baz behaviors.
 
 The implication of this is that even -valueForKey: and -setValue:forKey: will 
 fail if the -foo or -setFoo: accessors (which the system runs in their stead) 
 have been overridden to perform business logic which invoke other subclass 
 methods.  Unrecognized selector exceptions are raised when these other 
 subclass methods are invoked.
 
 Now, one does not generally want an app's regular business logic to be run 
 during a migration anyhow; any business logic should be implemented within 
 the migration sandbox.  Therefore, it seems that, as a general rule, in 
 -createDestinationInstancesForSourceInstance, one should access 
 properties only via the primitive accessors -primitiveValueForKey: and 
 -setPrimitiveValue:forKey:.
 
 At least I seem to have solved this morning's little programming challenge by 
 adding Primitive to the accessors which were raising exceptions.
 
 Should I go through all of my 
 -createDestinationInstancesForSourceInstance implementations and change 
 all accessors to the primitive accessors?  I can't find any discussion of the 
 lameness of the source instances in the Core Data Model Versioning and Data 
 Migration Programming Guide, and the phrase Primitive does not even appear 
 in that document.
 
That the objects will be fetched as NSManagedObjects is documented in the 
versioning  migration guide here Three-Stage Migration.  You should be able to 
use the standard KVC accessors during migration, NSManagedObjects will respond 
to the foo/setFoo: accessors for properties defined in your managed object 
model - the accessors will perform better than valueForKey/setValue:forKey: 
(see Dynamically-Generated Accessor Methods)

 Thanks,
 
 Jerry Krinock
 
 ___
 
 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/aswift%40apple.com
 
 This email sent to asw...@apple.com

___

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 arch...@mail-archive.com


Re: Get current caret position

2010-11-16 Thread Kyle Sluder
On Tue, Nov 16, 2010 at 4:26 AM, eveningnick eveningnick
eveningn...@gmail.com wrote:
 Hello
 I a wondering, if it is possible to get the current screen position of
 a text cursor (text caret) using Cocoa? It is possible to do that in
 Windows system (GetCaretPos), maybe Mac allows some similar
 functionality?

You're enumerating Word's windows and calling GetCaretPos on its text
view? Mac OS X does not let you do that. The closest you can get is
through the Accessibility framework: apps expose an object hierarchy
to the accessibility system that other apps can use to manipulate the
user interface. However, this is optional both from the app
developer's point of view as well as that of the user (the user needs
to turn on access for assistive devices).

IIRC, Word 2011 re-instated VBA support. Perhaps you can use this
interface to accomplish your goals?

--Kyle Sluder
___

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 arch...@mail-archive.com


Re: Garbage Collection, Standard Out, NSTask

2010-11-16 Thread Bill Bumgarner
The issue [I'd bet -- don't have time to dive deep] is that you don't have a 
strong reference to the Tasker instance.

Since notification observers don't hold strong references to observers, either, 
the garbage collector sees Tasker as garbage and collects it.

You could fix this any number of ways; 

- keep a reference to the Tasker instance as an iVar
- keep a global set around of active taskers and have 'em remove themselves 
when they are done
- use CFRetain or the NSGarbageCollector API to tell the collector not to 
collect the tasker before done.

b.bum
___

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 arch...@mail-archive.com


Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Adam Swift
And now with functional links... sigh

On Nov 12, 2010, at 10:51 AM, Jerry Krinock wrote:

 When implementing this method:
 
   -createDestinationInstancesForSourceInstance:entityMapping:manager:error:
 
 in a subclass of NSEntityMigrationPolicy, one typically loops through 
 attributes of the given source instance, does whatever migration logic is 
 desired, and then sets the results as attributes of a new destination 
 instance.
 
 Some time ago, I learned that one does not want to invoke the -foo and 
 setFoo: accessors in this method, because, duh, the invoked methods may no 
 longer exist in the current implementation of the managed object.  Life has 
 improved since I've been careful to leave the objects typed as unsubclassed 
 NSManagedObject instances, which forces me to use -valueForKey: and 
 -setValue:forKey:.
 
 But wait, there's more.  Although these source objects log their type as Baz 
 or whatever, they do not respond to Baz subclass methods, only 
 NSManagedObject methods.  They are like the proxy objects that are sometimes 
 delivered by KVO.  It's rather confusing to see an exception such as -[Baz 
 foo]: unrecognized selector when your implementation of Baz clearly has a 
 -foo, but it makes sense when you stop to consider what's going on.  
 Migration is sandboxxed.  The system only has the old store to work with; not 
 the old class.  Because the entity and apparently the class are stored in the 
 store, it knows that the object is a Baz instance, but it does not know any 
 of the old Baz behaviors.
 
 The implication of this is that even -valueForKey: and -setValue:forKey: will 
 fail if the -foo or -setFoo: accessors (which the system runs in their stead) 
 have been overridden to perform business logic which invoke other subclass 
 methods.  Unrecognized selector exceptions are raised when these other 
 subclass methods are invoked.
 
 Now, one does not generally want an app's regular business logic to be run 
 during a migration anyhow; any business logic should be implemented within 
 the migration sandbox.  Therefore, it seems that, as a general rule, in 
 -createDestinationInstancesForSourceInstance, one should access 
 properties only via the primitive accessors -primitiveValueForKey: and 
 -setPrimitiveValue:forKey:.
 
 At least I seem to have solved this morning's little programming challenge by 
 adding Primitive to the accessors which were raising exceptions.
 
 Should I go through all of my 
 -createDestinationInstancesForSourceInstance implementations and change 
 all accessors to the primitive accessors?  I can't find any discussion of the 
 lameness of the source instances in the Core Data Model Versioning and Data 
 Migration Programming Guide, and the phrase Primitive does not even appear 
 in that document.
 
That the objects will be fetched as NSManagedObjects is documented in the 
versioning  migration guide here:


http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/vmMigrationProcess.html#//apple_ref/doc/uid/TP40005508-SW8

You should be able to use the standard KVC accessors during migration, 
NSManagedObjects will respond to the foo/setFoo: accessors for properties 
defined in your managed object model - the accessors will perform better than 
valueForKey/setValue:forKey: 


http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW9

 Thanks,
 
 Jerry Krinock
 
 ___
 
 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/aswift%40apple.com
 
 This email sent to asw...@apple.com


___

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 arch...@mail-archive.com


Re: Garbage Collection, Standard Out, NSTask

2010-11-16 Thread Quincey Morris
On Nov 16, 2010, at 09:17, Jon Gilkison wrote:

 Below is a simple test application that launches a process and logs the 
 output as it runs.
 
 It works as expected when the app is set to no garbage collection, but as 
 soon as I turn on garbage collection, the following notifications stop 
 working:
 
 - NSTaskDidTerminateNotification
 - NSFileHandleReadCompletionNotification

You can figure this out by working backwards.

With GC enabled, the default notification center maintains only a weak 
reference to observers registered to it. So, if you're not getting 
notifications then it's likely the observer has been garbage collected too soon.

Since the notification center isn't responsible for maintaining a strong 
reference to your observer object, what is? Well, nothing. You allocate the 
object in the app delegate, but you don't stash the result anywhere.

That means your object is subject to garbage collection at *any* time after its 
creation. When that happens depends on when the GC thread actually runs.

Likely the problem is somewhat masked in this case, because you're starting a 
non-Cocoa process, which is going to keep executing until either it finishes 
normally, or it crashes because a resource you allocated for it disappears 
after garbage collection. If you haven't seen a crash yet you've possibly just 
been lucky.

Note that your code was always wrong because you were leaking the observer 
object. It just didn't matter until GC fixed the leak for you.

So the short answer is probably that your application delegate should keep a 
strong reference to your observer object until the external task ends.


___

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 arch...@mail-archive.com


Re: Is App in Resources App Bundle Evil?

2010-11-16 Thread kalexm

Am 15.11.2010 um 04:43 schrieb Kyle Sluder:

 On Sun, Nov 14, 2010 at 9:55 AM, kalexm kal...@gmail.com wrote:
 Hello all,
 
 I'm new to the list and somewhat new to OSX (not iphone!) development. I 
 spent ten years most of my time in java so it was a hurdle..
 
 I am currently developing an app (APP-A) which does PDF manipulation. I have 
 a second app (APP-B), that provides a PDF Viewer which is older.
 APP-A depends on APP-B as it uses APP-B for viewing manipulated PDFs. APP-B 
 is independent from APP-A.
 I could put both apps into Applications. But if a User don't know what APP-B 
 is for as he might only wan't APP-A but didn't see the dependency, he might 
 delete APP-B and APP-A cannot work properly anymore.
 
 To solve this I put APP-B into the resources of APP-A, and it works to launch 
 the app from this directory. I have not found any documentation from apple or 
 mailing-lists if this is unwanted, problematic or somewhat evil!? The launchd 
 finds the 'hidden' APP-B and behaves as expected...
 
 Is this allowed and recommendable, or how could I solve this alternatively 
 and I don't want to merge the apps!?
 
 The code signing in-depth technote (TN2206) advises against using Resources 
 for this. It suggests putting the helper app bundles in the Contents folder, 
 and single-file helper binaries directly inside Contents/MacOS. 
 http://developer.apple.com/library/mac/#technotes/tn2007/tn2206.html%23TNTAG19
 
 --Kyle Sluder

Sorry, I forgot 'reply-all'

Yeah that was the source I was looking for. I've inserted a copy build phase. I 
managed to put APP-B everywhere but not directly under Contents. I do it now by 
a shellscript that I run after building. But this could'nt be the final 
solution...

I put together some code, but it crashes. As I couldn't simply attach the 
debugger (as the bash needs to copy it in the right position..) debugging is 
complicated...


CFURLRef appURL;
CFBundleRef bundle = CFBundleGetMainBundle();
NSString *app = @B.app;
appURL = CFBundleCopyAuxiliaryExecutableURL(bundle,(CFStringRef)app);
if (appURL != NULL) {
FSRef applicationRef;
CFURLGetFSRef(appURL, applicationRef);
FSRef fileRef;
CFURLGetFSRef(pDFDocumentURL, fileRef);
LSLaunchFSRefSpec   launchSpec = { applicationRef, 1, 
fileRef, NULL, kLSLaunchDefaults, NULL };
OSStatus err = LSOpenFromRefSpec(launchSpec, NULL);
if (err != kLSApplicationNotFoundErr) {
//do something...
}
}
CFRelease(appURL);

best,___

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 arch...@mail-archive.com


Re: Garbage Collection, Standard Out, NSTask

2010-11-16 Thread Jon Gilkison
That was it, though further up the chain.  The object that created/owned the 
task was being GC'd away.

Thanks Bill and Quincy!

On Nov 16, 2010, at 12:53 PM, Bill Bumgarner wrote:

 The issue [I'd bet -- don't have time to dive deep] is that you don't have a 
 strong reference to the Tasker instance.
 
 Since notification observers don't hold strong references to observers, 
 either, the garbage collector sees Tasker as garbage and collects it.
 
 You could fix this any number of ways; 
 
 - keep a reference to the Tasker instance as an iVar
 - keep a global set around of active taskers and have 'em remove themselves 
 when they are done
 - use CFRetain or the NSGarbageCollector API to tell the collector not to 
 collect the tasker before done.
 
 b.bum

___

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 arch...@mail-archive.com


Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Jerry Krinock

On 2010 Nov 16, at 09:48, Adam Swift wrote:

 That the objects will be fetched as NSManagedObjects is documented in the 
 versioning  migration guide … Three-Stage Migration.

Thank you, Adam.  I see that it says the class of all entities is changed to 
NSManagedObject.  However, I think that I'm probably not alone in wondering 
exactly what it means to ** change the class of an entity ** , and the 
programming implications of it, which I learned when exceptions were raised.

 You should be able to use the standard KVC accessors during migration, 
 NSManagedObjects will respond to the foo/setFoo: accessors for properties 
 defined in your managed object model - 

Yes, unless, as I found, accessors have been overridden, and the overrides 
invoke methods which are not defined in NSManagedObject.  

 the accessors will perform better than valueForKey/setValue:forKey: (see 
 Dynamically-Generated Accessor Methods)

Well, since migration only happens once in a lifetime of a database, I'm not 
too worried about it, unless it falls to zero, which is what happens when a 
method does not respond to selector exception is raised :(

___

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 arch...@mail-archive.com


Re: [iPhone] Toolbar button and Touch Down

2010-11-16 Thread Jon Sigman
Yeah, UIToolbars are odd beasts. Try this out: place a UISwitch in a toolbar, 
hook it up to an IBAction, and you get... nothing. It switches from ON to OFF 
and back, but the action never fires. Bug? Feature? Not exactly 'standard and 
easy' imho. Maybe the 'next major release' will address this.




From: Jonathon Kuo newsli...@autonomy.caltech.edu
To: Matt Neuburg m...@tidbits.com
Cc: cocoa-dev@lists.apple.com
Sent: Tue, November 16, 2010 9:26:40 AM
Subject: Re: [iPhone] Toolbar button and Touch Down

On Nov 16, 2010, at 9:12 AM, Matt Neuburg wrote:

 On Mon, 15 Nov 2010 10:02:44 -0800, Jonathon Kuo 
newsli...@autonomy.caltech.edu said:
 Interesting idea, probably a little beyond me. :) 
 
 Nonsense. This is perfectly standard and easy. A UIButton can send an action 
message on TouchDown. It makes no difference that the UIButton is inside a 
UIBarButton. How much plainer can it be? m.

I agree: that's how I expected it to work, too, but that's not how it does work 
(Xcode 3.2.4). If I drag a Round Rect Button onto the Toolbar, it instantly 
gets 
promoted to a UIBarButtonItem (really!), and I can't set Touch Down on it, 
nor 
can I change the class of it in IB. That's why I'm confused...

___

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/rf_egr%40yahoo.com

This email sent to rf_...@yahoo.com



  
___

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 arch...@mail-archive.com


Third Party Material

2010-11-16 Thread Richard Somers
I just noticed that Apple's Keynote, Pages, and Numbers '08  
applications acknowledge the following material.


Mike Ferris – (MOKit) Portions Copyright © 1996-2002 Mike Ferris. All  
Rights Reserved.


Kurt Revis – (SNDisclosableView/SNDisclosureButton) Copyright © 2002,  
Kurt Revis. All rights reserved.


Does anyone else have experience using this material or have any  
thoughts on the current relevancy of this material?


--Richard Somers

___

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 arch...@mail-archive.com


Load View Controller Nib without pushing it?

2010-11-16 Thread Laurent Daudelin
Hello.

I'm stomped by a strange problem. I've been working with a UIViewController 
subclass and it's been working fine, putting it on screen using 
pushViewController:animated:.

Now, I would like to load the view controller and have it perform a method 
before I put it on screen. However, when I do that, the nib is not loaded even 
though I'm still using initWithNibName:bundle:. The view's ivars are not set 
and it never receives awakeFromNib.

What's this? Is there any way I can force it to load the nib? In the method I 
want to execute, there are a few references to nib objects but they are all set 
to nil after the alloc-initWithNibName:bundle:. I double-checked and the custom 
view controller receives the initWithNibName:bundle:. Everything works fine as 
long as I use pushViewController:animated:.

Any workaround this?

Thanks in advance!

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

___

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 arch...@mail-archive.com


Re: Load View Controller Nib without pushing it?

2010-11-16 Thread Dave Carrigan
On Nov 16, 2010, at 1:29 PM, Laurent Daudelin wrote:
 Hello.
 
 I'm stomped by a strange problem. I've been working with a UIViewController 
 subclass and it's been working fine, putting it on screen using 
 pushViewController:animated:.
 
 Now, I would like to load the view controller and have it perform a method 
 before I put it on screen. However, when I do that, the nib is not loaded 
 even though I'm still using initWithNibName:bundle:. The view's ivars are 
 not set and it never receives awakeFromNib.
 
 What's this? Is there any way I can force it to load the nib? In the method I 
 want to execute, there are a few references to nib objects but they are all 
 set to nil after the alloc-initWithNibName:bundle:. I double-checked and the 
 custom view controller receives the initWithNibName:bundle:. Everything works 
 fine as long as I use pushViewController:animated:.

Why don't you just override -viewDidLoad.

-- 
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA

___

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 arch...@mail-archive.com


add a icon to window title bar ?

2010-11-16 Thread Rajendran P
Hi ,
  I am developing a non document based App. i need to add an icon to its  main 
window title bar before the title string , any input on how to implement it 
would be help full 



Thanks  In Advance


  P.Rajendran or Raju   

(for further details contact 
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 arch...@mail-archive.com


Re: Load View Controller Nib without pushing it?

2010-11-16 Thread Laurent Daudelin
On Nov 16, 2010, at 13:34, Dave Carrigan wrote:

 On Nov 16, 2010, at 1:29 PM, Laurent Daudelin wrote:
 Hello.
 
 I'm stomped by a strange problem. I've been working with a UIViewController 
 subclass and it's been working fine, putting it on screen using 
 pushViewController:animated:.
 
 Now, I would like to load the view controller and have it perform a method 
 before I put it on screen. However, when I do that, the nib is not loaded 
 even though I'm still using initWithNibName:bundle:. The view's ivars are 
 not set and it never receives awakeFromNib.
 
 What's this? Is there any way I can force it to load the nib? In the method 
 I want to execute, there are a few references to nib objects but they are 
 all set to nil after the alloc-initWithNibName:bundle:. I double-checked and 
 the custom view controller receives the initWithNibName:bundle:. Everything 
 works fine as long as I use pushViewController:animated:.
 
 Why don't you just override -viewDidLoad.

I was already overriding it but since the view was not initiated from the nib, 
viewDidLoad: would not be called.

After browsing tons of initWithNibName:bundle: links, I finally found a 
workaround. In the calling view controller, after the call to 
initWithNibName:bundle:, I call something like [customViewController view]. 
This seems to force the lazy loading to happen.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

___

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 arch...@mail-archive.com


problem with right click jump to definition

2010-11-16 Thread Rajendran P
HI all ,
  I am currently using a  custom make file to build my project file , when i 
right click and say Jump to definition.  it is no going to definition file 
for 
methods defined in  frameworks like cocoa and systemsecurity  but its working 
fine for all methods written by me . any input on how to make jump to 
definition  work for system defined Api and framework would be good .



  P.Rajendran or Raju   

(for further details contact 
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 arch...@mail-archive.com


Re: Load View Controller Nib without pushing it?

2010-11-16 Thread Brian Slick

On Nov 16, 2010, at 4:50 PM, Laurent Daudelin wrote:

 On Nov 16, 2010, at 13:34, Dave Carrigan wrote:
 
 On Nov 16, 2010, at 1:29 PM, Laurent Daudelin wrote:
 Hello.
 
 I'm stomped by a strange problem. I've been working with a UIViewController 
 subclass and it's been working fine, putting it on screen using 
 pushViewController:animated:.
 
 Now, I would like to load the view controller and have it perform a method 
 before I put it on screen. However, when I do that, the nib is not loaded 
 even though I'm still using initWithNibName:bundle:. The view's ivars are 
 not set and it never receives awakeFromNib.
 
 What's this? Is there any way I can force it to load the nib? In the method 
 I want to execute, there are a few references to nib objects but they are 
 all set to nil after the alloc-initWithNibName:bundle:. I double-checked 
 and the custom view controller receives the initWithNibName:bundle:. 
 Everything works fine as long as I use pushViewController:animated:.
 
 Why don't you just override -viewDidLoad.
 
 I was already overriding it but since the view was not initiated from the 
 nib, viewDidLoad: would not be called.

viewDidLoad documentation:

This method is called regardless of whether the views were stored in a nib file 
or created programmatically in the loadView method.


viewWillAppear: is another option.

Brian
___

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 arch...@mail-archive.com


Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Adam Swift

On Nov 16, 2010, at 10:46 AM, Jerry Krinock wrote:

 
 On 2010 Nov 16, at 09:48, Adam Swift wrote:
 
 That the objects will be fetched as NSManagedObjects is documented in the 
 versioning  migration guide … Three-Stage Migration.
 
 Thank you, Adam.  I see that it says the class of all entities is changed to 
 NSManagedObject.  However, I think that I'm probably not alone in wondering 
 exactly what it means to ** change the class of an entity ** , and the 
 programming implications of it, which I learned when exceptions were raised.
 
It simply means that any class name specified in the managed object model for 
your entities will be ignored.  If the docs don't communicate that clearly then 
that would be worth filing a bug to clarify the language (it seems clear to me, 
but I already know how it works).

 You should be able to use the standard KVC accessors during migration, 
 NSManagedObjects will respond to the foo/setFoo: accessors for properties 
 defined in your managed object model - 
 
 Yes, unless, as I found, accessors have been overridden, and the overrides 
 invoke methods which are not defined in NSManagedObject.  
 
The accessors defined on your NSManagedObject subclasses will not be called - 
unless you've added property accessors to NSManagedObject via a category (and 
you REALLY don't want to do that) that call them directly.

 the accessors will perform better than valueForKey/setValue:forKey: (see 
 Dynamically-Generated Accessor Methods)
 
 Well, since migration only happens once in a lifetime of a database, I'm not 
 too worried about it, unless it falls to zero, which is what happens when a 
 method does not respond to selector exception is raised :(
 
What you seem to be describing shouldn't be possible (unless you've added 
property accessors to NSManagedObject via a category) - the accessors defined 
on your subclass are not going to be called during migration because the 
instances being migrated are not instances of your class.

- adam

___

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 arch...@mail-archive.com


Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Jerry Krinock

On 2010 Nov 16, Adam Swift wrote:

 What you seem to be describing shouldn't be possible (unless you've added 
 property accessors to NSManagedObject via a category)

I definitely have not done that.  I subclass NSManagedObject.

Let's step back a little here:

 You should be able to use the standard KVC accessors during migration, 
 NSManagedObjects will respond to the foo/setFoo: laccessors for properties 
 defined in your managed object model.

Well, -foo and -setFoo: won't even compile unless I change the type of the 
sourceInstance: parameter of the method to be a MyManagedObject* like this:

- (BOOL)createDestinationInstancesForSourceInstance:(MyManagedObject*)foo
  entityMapping:(NSEntityMapping*)inMapping

manager:(NSMigrationManager*)inManager
  error:(NSError**)error_p

or else do some equivalent typecasting in the implementation.

 - the accessors defined on your subclass are not going to be called during 
 migration because the instances being migrated are not instances of your 
 class.


Makes sense, but I distinctly remember debugging this and seeing in the call 
stack that KVO was calling my custom accessors.
  I'll have a closer look the next time that I run into this problem.  Making a 
demo project of a Core Data migration is quite tedious.

By the way, my custom accessors are also called if I used -valueForKey: and 
-setValue:forKey:.  This is per documentation [1]:

The access pattern key-value coding uses for managed objects is largely the 
same as that used for subclasses of NSObject—seevalueForKey:

and drilling down, [2]:

Default Search Pattern for valueForKey:
When the default implementation of valueForKey: is invoked on a receiver, the 
following search pattern is used:
• Searches the class of the receiver for an accessor method whose name matches 
the pattern -getKey, -key, or -isKey, in that order.


[1] 
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW9
[2] 
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/SearchImplementation.html#//apple_ref/doc/uid/2955

___

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 arch...@mail-archive.com


Re: Core Data: During Migration, should use Primitive Accessors only?

2010-11-16 Thread Quincey Morris
On Nov 16, 2010, at 15:55, Jerry Krinock wrote:

 You should be able to use the standard KVC accessors during migration, 
 NSManagedObjects will respond to the foo/setFoo: laccessors for properties 
 defined in your managed object model.
 
 Well, -foo and -setFoo: won't even compile unless I change the type of the 
 sourceInstance: parameter of the method to be a MyManagedObject* like this:
 
 - (BOOL)createDestinationInstancesForSourceInstance:(MyManagedObject*)foo
  entityMapping:(NSEntityMapping*)inMapping

 manager:(NSMigrationManager*)inManager
  error:(NSError**)error_p
 
 or else do some equivalent typecasting in the implementation.

I think you're mixing up two different things here.

1. Regardless of whether we're talking about migrating or just using Core Data 
stores, *any* NSManagedObject, including vanilla ones whose entity doesn't name 
a custom subclass, has accessor methods for all of the properties in the 
corresponding entity definition. But the compiler doesn't know that these 
accessors exist, so you can't use them in source unless you arrange for 
@dynamic declarations of them, for which there are a couple of semi-automatic 
procedures.

I guess to make such declarations usable, you could just *declare* subclasses 
and use subclass-typed pointers in the source code, even though the class is 
still officially NSManagedObject.

I guess this oddity doesn't normally come up in non-migration scenarios, 
because if you want to make the dynamic accessors visible to the compiler, 
you'd likely specify a subclass in the entity, even if you don't actually 
override any accessors.

2. If you have a *custom* NSManagedObject subclass (i.e. whose subclass name is 
known to the Core Data entity), you can of course override the 
Core-Data-supplied accessor methods by writing your own. Adam was saying that 
there isn't supposed to be any legal way to use such custom subclasses during 
migration. All you've got are objects of class NSManagedObject, which 
notwithstanding their class have the dynamic Core-Data-supplied accessors.

I guess this kind of blurs the boundaries of what a class is, since different 
instances have different APIs, but that's actually nothing new -- you could 
always extend the class API on a per-object basis via things like 
'valueForUndefinedKey:'.

TBH, I never thought all this through explicitly before, but this is how I 
think it works, unless my brain has gone into meltdown again.

___

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 arch...@mail-archive.com


What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread eveningnick eveningnick
Hello!
I have to write an application, that should run on the background.
When the user needs, it should display some control panel. On Windows
system i would have used System tray, and an icon there - when the
user clicks on that icon, it displays some GUI. but what is the Mac's
usual practice? I am thinking that the analog to that tray application
is an agent, launched by launchd. On what event it is considered to be
good to trigger that control panel?
All i could think of - is installing a global event tap (but i need
accessibility Enabled then all the time - it is neither a good idea)
and watch some Shortcut pressed on a keyboard.
Another idea was to create an item in System preferences (but, could
it be done? And how?).

And where should I install that application? Installing in
/Applications doesn't seem to be nice, because it's not really a
full-gui applicatlion, It's rather some kind of background system
helper.

Thanks for the hints,
George
___

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 arch...@mail-archive.com


Re: What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread Eeyore
I fumble-fingered the first message and sent it without actually typing 
anything. Sorry for the noise if the moderator didn't catch it.

Someone may know an approved Apple method, but here are some things that are 
out there now you could emulate. You could have it in Applications and use a 
menu item to access its control panel (like Shimo, Jolt, Caffeine, BravoTunes). 
You could install your background app as a command-line app and have a GUI app 
in Applications that launches the control panel (see ClamXav for an example). 
You could put it in Library/Application Support and have access to the Control 
panel through System Preferences (like Roxio's Retrospect).

Aaron

On Nov 16, 2010, at 5:27 PM, eveningnick eveningnick wrote:

 Hello!
 I have to write an application, that should run on the background.
 When the user needs, it should display some control panel. On Windows
 system i would have used System tray, and an icon there - when the
 user clicks on that icon, it displays some GUI. but what is the Mac's
 usual practice? I am thinking that the analog to that tray application
 is an agent, launched by launchd. On what event it is considered to be
 good to trigger that control panel?
 All i could think of - is installing a global event tap (but i need
 accessibility Enabled then all the time - it is neither a good idea)
 and watch some Shortcut pressed on a keyboard.
 Another idea was to create an item in System preferences (but, could
 it be done? And how?).
 
 And where should I install that application? Installing in
 /Applications doesn't seem to be nice, because it's not really a
 full-gui applicatlion, It's rather some kind of background system
 helper.
 
 Thanks for the hints,
 George
 ___
 
 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/eeyore%40monsterworks.com
 
 This email sent to eey...@monsterworks.com
 

___

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 arch...@mail-archive.com


Re: What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/16/10 5:27 PM, eveningnick eveningnick wrote:
 Hello!
 I have to write an application, that should run on the background.
 When the user needs, it should display some control panel. On Windows
 system i would have used System tray, and an icon there - when the
 user clicks on that icon, it displays some GUI. but what is the Mac's
 usual practice? I am thinking that the analog to that tray application
 is an agent, launched by launchd. On what event it is considered to be
 good to trigger that control panel?
 All i could think of - is installing a global event tap (but i need
 accessibility Enabled then all the time - it is neither a good idea)
 and watch some Shortcut pressed on a keyboard.

If I'm understanding what you are asking, why not put an icon in the
menu bar?  I'm referring to the icon(s) to the left of the clock, e.g.
volume, Wi-Fi, Bluetooth, etc.  The pertinent classes are NSStatusItem
and NSStatusBar.  (Be sure to read the usability notes in the latter.)

Several applications use this for what I think you describe.  (I
currently have NSStatusItems from Tweetie, Dropbox, and Growl.)

 Another idea was to create an item in System preferences (but, could
 it be done? And how?).

See NSPreferencePane, probably by way its associated Programming Guide
at
http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/PreferencePanes/PreferencePanes.html

 And where should I install that application? Installing in
 /Applications doesn't seem to be nice, because it's not really a
 full-gui applicatlion, It's rather some kind of background system
 helper.

I will let someone more experienced in these matters address this issue;
I will note that Dropbox, Google Notifier, and QuickSilver all fit your
general description and are all in Applications.  This does not mean you
won't have a LaunchDaemon or the like to get things going as well.

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFM4zPQaOlrz5+0JdURAntiAJ4sWnl2v+q+XnWKCW+nA814hFj6uACeMG9M
UMwDLojEyKX8vBWQ+fDojxE=
=XDYe
-END PGP 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 arch...@mail-archive.com


Re: What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread Kiel Gillard
http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/PreferencePanes/PreferencePanes.html

On 17/11/2010, at 12:27 PM, eveningnick eveningnick wrote:

 Hello!
 I have to write an application, that should run on the background.
 When the user needs, it should display some control panel. On Windows
 system i would have used System tray, and an icon there - when the
 user clicks on that icon, it displays some GUI. but what is the Mac's
 usual practice? I am thinking that the analog to that tray application
 is an agent, launched by launchd. On what event it is considered to be
 good to trigger that control panel?
 All i could think of - is installing a global event tap (but i need
 accessibility Enabled then all the time - it is neither a good idea)
 and watch some Shortcut pressed on a keyboard.
 Another idea was to create an item in System preferences (but, could
 it be done? And how?).
 
 And where should I install that application? Installing in
 /Applications doesn't seem to be nice, because it's not really a
 full-gui applicatlion, It's rather some kind of background system
 helper.
 
 Thanks for the hints,
 George
 ___
 
 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/kiel.gillard%40gmail.com
 
 This email sent to kiel.gill...@gmail.com

___

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 arch...@mail-archive.com


Re: problem with right click jump to definition

2010-11-16 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/16/10 1:51 PM, Rajendran P wrote:
 HI all ,
   I am currently using a  custom make file to build my project file , when i 
 right click and say Jump to definition.  it is no going to definition file 
 for 
 methods defined in  frameworks like cocoa and systemsecurity  but its working 
 fine for all methods written by me . any input on how to make jump to 
 definition  work for system defined Api and framework would be good .

1) When posting a new message, please don't reply to a message and just
change the subject - the In-reply-to header is still set and messes up
threading on certain mail clients, like Mail.app.

2) (Moderator, please correct me if wrong, but) this is a question
better suited to the Xcode list
(http://lists.apple.com/mailman/listinfo/xcode-users).

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFM4zjCaOlrz5+0JdURAog1AJ42JZixV8zDXJc1xi6cDv2GY8pcCACfSbgS
EExpn6cHaMin+Y/z6Rr3KA8=
=ryyY
-END PGP 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 arch...@mail-archive.com


QTKit

2010-11-16 Thread albert jordan

I am trying to study the performance of non standard codec relative to H.264.  
I was wondering if there was a straight forward way to add compression options 
to QTCompressionOptions object.

If this is not the best approach, what is the recommended strategy to implement 
a proprietary codec?  I'm hoping that I can leverage QTKit as much as possible.

Thanks in advance,

Albert 
___

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 arch...@mail-archive.com


Re: What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread Gregory Weston
Conrad Shultz wrote:

 On 11/16/10 5:27 PM, eveningnick eveningnick wrote:
 Hello!
 I have to write an application, that should run on the background.
 When the user needs, it should display some control panel. On Windows
 system i would have used System tray, and an icon there - when the
 user clicks on that icon, it displays some GUI. but what is the Mac's
 usual practice? I am thinking that the analog to that tray application
 is an agent, launched by launchd. On what event it is considered to be
 good to trigger that control panel?
 All i could think of - is installing a global event tap (but i need
 accessibility Enabled then all the time - it is neither a good idea)
 and watch some Shortcut pressed on a keyboard.
 
 If I'm understanding what you are asking, why not put an icon in the
 menu bar?  I'm referring to the icon(s) to the left of the clock, e.g.
 volume, Wi-Fi, Bluetooth, etc.  The pertinent classes are NSStatusItem
 and NSStatusBar.  (Be sure to read the usability notes in the latter.)
 
 Several applications use this for what I think you describe.  (I
 currently have NSStatusItems from Tweetie, Dropbox, and Growl.)

For what it's worth, I'm increasingly getting pushback from users about 
NSStatusItems. Some people really seem to resent things taking space there.
___

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 arch...@mail-archive.com


Re: add a icon to window title bar ?

2010-11-16 Thread Gregory Weston
Rajendran P wrote:

 Hi ,
  I am developing a non document based App. i need to add an icon to its  main 
 window title bar before the title string , any input on how to implement it 
 would be help full 

Found something in the list archives from 2008. You can use:

[[window standardWindowButton:NSWindowDocumentIconButton] setImage:image]

but before that will work you have to actually indicate that the window 
represents a file. If the represented file exists, the window will by default 
show its correct icon. If the represented file doesn't exist, it will show a 
generic icon. In either case, you should be able to override it with a custom 
image. If the window doesn't represent a file, it won't show the icon so you've 
got no image to override.

___

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 arch...@mail-archive.com


Re: Third Party Material

2010-11-16 Thread Gregory Weston
Richard Somers wrote:

 I just noticed that Apple's Keynote, Pages, and Numbers '08  
 applications acknowledge the following material.
 
 Mike Ferris ˆ (MOKit) Portions Copyright © 1996-2002 Mike Ferris. All  
 Rights Reserved.
 
 Kurt Revis ˆ (SNDisclosableView/SNDisclosureButton) Copyright © 2002,  
 Kurt Revis. All rights reserved.
 
 Does anyone else have experience using this material or have any  
 thoughts on the current relevancy of this material?

Not sure specifically what you're hoping to hear. They're fine. Nothing you 
couldn't write yourself, but why spend time solving already-solved problems?


___

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 arch...@mail-archive.com


Re: What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread Kyle Sluder
On Tue, Nov 16, 2010 at 5:27 PM, eveningnick eveningnick 
eveningn...@gmail.com wrote:
 Hello!
 I have to write an application, that should run on the background.
 When the user needs, it should display some control panel. On Windows
 system i would have used System tray, and an icon there - when the
 user clicks on that icon, it displays some GUI. but what is the Mac's
 usual practice? I am thinking that the analog to that tray application
 is an agent, launched by launchd. On what event it is considered to be
 good to trigger that control panel?

It depends on what you're writing.

Don't use the status area (near the clock) just to provide access to your
app. If you're writing a VPN client or something else whose status needs to
be monitored continuously, the status area is a good place to put your UI: a
status item with a menu that afford access to the app's
configuration/preferences dialog.

But don't use the status area for transient things. If you're writing a
backup app, for example, and don't feel like burdening your users' status
area with mundane backups are happening information, don't all of a sudden
put UI to alert the user that something's gone wrong. But then how do you
alert the user or let them configure things?

If you have no configuration options (the only interaction you need in your
background app is to alert the user) you can use the CFNotification API. If
you *do* have configuration, then create an app that only configures things,
and embed your background app as a helper tool inside this app wrapper. When
you need to show UI, have your background app launch the main app that it's
a part of.

Alternatively, your main app could be a system preferences pane rather
than a full-blown app.

--Kyle Sluder
___

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 arch...@mail-archive.com


Re: What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread John Joyce

On Nov 17, 2010, at 12:40 PM, Kyle Sluder wrote:

 On Tue, Nov 16, 2010 at 5:27 PM, eveningnick eveningnick 
 eveningn...@gmail.com wrote:
 Hello!
 I have to write an application, that should run on the background.
 When the user needs, it should display some control panel. On Windows
 system i would have used System tray, and an icon there - when the
 user clicks on that icon, it displays some GUI. but what is the Mac's
 usual practice? I am thinking that the analog to that tray application
 is an agent, launched by launchd. On what event it is considered to be
 good to trigger that control panel?
 
 It depends on what you're writing.
 
 Don't use the status area (near the clock) just to provide access to your
 app. If you're writing a VPN client or something else whose status needs to
 be monitored continuously, the status area is a good place to put your UI: a
 status item with a menu that afford access to the app's
 configuration/preferences dialog.
 
 But don't use the status area for transient things. If you're writing a
 backup app, for example, and don't feel like burdening your users' status
 area with mundane backups are happening information, don't all of a sudden
 put UI to alert the user that something's gone wrong. But then how do you
 alert the user or let them configure things?
 
 If you have no configuration options (the only interaction you need in your
 background app is to alert the user) you can use the CFNotification API. If
 you *do* have configuration, then create an app that only configures things,
 and embed your background app as a helper tool inside this app wrapper. When
 you need to show UI, have your background app launch the main app that it's
 a part of.
 
 Alternatively, your main app could be a system preferences pane rather
 than a full-blown app.
 
 --Kyle Sluder
 ___
Additionally, consider your target users hardware...
There are too many apps with Status Items these days. It's getting to be like 
Windows' system tray junk.
Remember the real estate is extremely limited on anything smaller than a 17 
inch MacBook Pro, and even that is fairly limited if the active application has 
many menus.
If your primary users mostly have 27 inch displays or bigger, add as much as 
you like.
Seriously consider including a check on the size of display during status item 
activation and informing the user that this will take up significant space on 
small displays.

You should avoid making a Status Item required. It should always be optional. 
It should not be a shortcut to the app, that is what the Dock is intended for. 
Hence, the name Status Item.

If you do not actually display any information in the Status Item, or not 
constantly need to display (like battery level), then you should consider just 
building a Preference Pane for System Preferences and a Dashboard widget for 
status and/or launch and/or control.

The Dashboard widget approach is a lot more considerate of the end user's real 
estate.

___

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 arch...@mail-archive.com


Re: libsvn_client for IOS

2010-11-16 Thread Andrew McLaughlin
I'm curious. What will you use svn for from iOS? is this for mobile access to a 
repository? Or something else?

Piko


Sent from my iPhone

On Nov 14, 2010, at 11:51 AM, James West jww...@gmail.com wrote:

 I'd like to add support for svn to my ios project, but I notice that
 libsvn_client is not available for ios through Frameworks  Add  Existing
 Framework.
 
 My question is two-fold: 1) Is there a method by which I can link against
 libsvn_client in an ios application and 2) If not, are there any issues with
 compiling and linking against libsvn from source?
 
 Thanks!
 
 -- James
 ___
 
 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/pik0%40me.com
 
 This email sent to p...@me.com
___

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 arch...@mail-archive.com


Query on writing a Cocoa plugin

2010-11-16 Thread Santhosh Kumar Behara
hi,

  To write cocoa parser plugin for 3gp or MKV file format(for MAC OS on PC) do 
we need to write in any specific plugin pattern/format. 
  
 If not can we add our own member functions into this plugin in which case the 
host application needs to know the prototypes of the member functions before 
using this plugin.

 Kindly suggest us on how to implement this kind of cocoa plugin.

Thanks,
Santhosh



___

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 arch...@mail-archive.com


Detecting shared folders

2010-11-16 Thread Leo
Hi,

I wonder if it's possible to detect a shared folder? That is a folder that
is shared via File Sharing.

Am I missing something obvious?

I couldn't find an appropriate folder attribute in either Cocoa or
AppleScript. Or any other way to distinguish a shared folder from other
folders.

I also assume there must be a list of all shared folders in one of the Unix
special directories. Or a way to retrieve it with a shell command. I did
some extensive research, couldn't find anything.

Any help would be appreciated!

Thanks,
Leo
___

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 arch...@mail-archive.com


NSBrowser and column's titles

2010-11-16 Thread Bruno Causse

hi,

When I instantiate my browser from XIB file, and when i play with  
hierarchy, the column 's titles do not appear.


Only after the resize the window (container), that the conportment of  
titles is correct.


have you a solution to fix this?

thank.

___

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 arch...@mail-archive.com


Re: NSSavePanel panel:shouldShowFilename:

2010-11-16 Thread Leo
From: Quincey Morris quinceymor...@earthlink.net

 a number of system extensions (like Default Folder, but I think that wasn't
 the first) added the ability to option-click on a disabled item to prefill the
 text field with an existing name,

 At some point (possibly Mac OS X 10.0), Apple quietly adopted this very useful
 convention.

I once submitted a request to Apple, maybe I'm in minority, but I hope this
behavior will be optional one day. Like Opt-click would be perfect.

I worked at a major ad agency for several years, and this behavior caused
major problems, misunderstandings and loss of time.

Most of the time, people click on the file list occasionally (maybe to
type-scroll to desired folder), the file gets quietly renamed, you save it
- and can never find it because it was saved under a name you never wanted
or thought about.

I had myself to cancel the Save dialog countless times to avoid saving files
under unwanted names.

Leo



___

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 arch...@mail-archive.com


Cocoa and Objective-C up and running

2010-11-16 Thread Jean-Christophe Helary
I am just starting to work on Scott Stevenson's book as a total programming 
beginner and I am wondering if there is a place to discuss beginner's issues (I 
just completed the first part of the introduction to C concepts) or the 
contents of the book itself.


Jean-Christophe Helary

fun: http://mac4translators.blogspot.com
work: http://www.doublet.jp (ja/en  fr)
tweets: http://twitter.com/brandelune

___

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 arch...@mail-archive.com


Intercept network traffic on specific port

2010-11-16 Thread Lionel Pinkhard
Hi

I'm trying to achieve a kind of proxy/filter effect for a specific TCP/IP
port. I want my application to act as a server to all other applications on
the system for that specific port.

For example, Safari connects to site www.whatever.com on port 412. My
application is intercepting on port 412, so instead of getting a response
from www.whatever.com, my application would serve as the server (and
possibly open a separate connection from itself to that site).

The type of behavior I'm after is similar to what PGP Desktop does with
encrypting/decrypting e-mail.

I'm looking for a suggestion on a framework/API I could use to do something
like this. I'm not too sure whether there's something in the Cocoa
frameworks that could do this, or whether I should be looking at something
in BSD sockets.

Any suggestions would be appreciated.

Regards

Lionel
___

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 arch...@mail-archive.com


Re: Intercept network traffic on specific port

2010-11-16 Thread Kyle Sluder
On Tue, Nov 16, 2010 at 3:19 AM, Lionel Pinkhard lio...@breezysoft.comwrote:

 Hi

 I'm trying to achieve a kind of proxy/filter effect for a specific TCP/IP
 port. I want my application to act as a server to all other applications on
 the system for that specific port.

 For example, Safari connects to site www.whatever.com on port 412. My
 application is intercepting on port 412, so instead of getting a response
 from www.whatever.com, my application would serve as the server (and
 possibly open a separate connection from itself to that site).


Is www.whatever.com someone else's site? If so, you'll need to run an HTTP
proxy and configure Safari to use it to connect to the web.

--Kyle Sluder
___

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 arch...@mail-archive.com


Re: Detecting shared folders

2010-11-16 Thread Ken Thomases
On Nov 15, 2010, at 4:01 AM, Leo wrote:

 I wonder if it's possible to detect a shared folder? That is a folder that
 is shared via File Sharing.

It would seem to be possible, since the Finder puts a banner in the window for 
shared folders.

 Am I missing something obvious?

Not obvious, no.

 I couldn't find an appropriate folder attribute in either Cocoa or
 AppleScript. Or any other way to distinguish a shared folder from other
 folders.

There are some flags in Carbon File Manager structures about file system items 
that are supposed to indicate the shared status, but they don't seem to be 
supported any longer.  I used Apple's FSMegaInfo to dump the info, as in:

/path/to/FSMegaInfo -vvv FSGetCatalogInfo -kFSCatInfoGettableInfo path


 I also assume there must be a list of all shared folders in one of the Unix
 special directories. Or a way to retrieve it with a shell command. I did
 some extensive research, couldn't find anything.

I doubt there's one single list.  It depends on the specific sharing protocol 
and the configuration of the server for that protocol.  I found that 
/etc/smb.conf includes /var/db/samba/smb.shares, and that file lists the shares 
in a manner which matches the settings in the Sharing preference pane.  
However, that would probably not apply if you don't share via SMB and only 
share via AFP.

Hmm.  I went hunting for the AFP configuration and think I did find the master 
list.  Try this command:

dscl /Local/Default -list SharePoints

Then, take one of the listed share points and do these on it:

dscl /Local/Default -read SharePoints/share point name
dscl /Local/Default -read SharePoints/share point name directory_path

Be sure to quote the share point name if it contains spaces or other characters 
that the shell will interpret.  Since the dscl command is just a front-end to 
Directory Services, there should be a way to do this directly via those APIs.

Some experimentation shows that these records are not modified as you enable 
and disable file sharing protocols or even all of file sharing.  So, you'd have 
to test if file sharing is even enabled before paying attention to them.  I 
believe that toggling file sharing servers on or off amounts to enabling and 
disabling the corresponding service in launchd.  So, I think you may be able to 
query their status with SMJobCopyDictionary() and the relevant identifier (e.g. 
com.apple.AppleFileServer or org.samba.smbd).

Regards,
Ken

___

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 arch...@mail-archive.com


Re: Maths package for 128/256 bit integers?

2010-11-16 Thread Yung-Luen Lan
You may check Accelerate.framework. It utilized the SIMD for
performance for up to 1024bit operands.
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/vBigNum.7.html

Regards.
yllan

On Mon, Nov 15, 2010 at 7:14 AM, William Squires wsqui...@satx.rr.com wrote:
 I know some crypto algorithms use 128 or up to 256 bit keys - I'm hoping
 that means there's a maths package (in C or ObjC) that'll provide for
 computations (addition, subtraction, multiplication, division, and modulus,
 at least...) and a way to convert them to-from NSStrings. Anyone know of
 any? I'm trying to rewrite an algorithm I made for NSUIntegers to use ever
 larger values for cryptanalysis.

 ___

 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/yungluen%40gmail.com

 This email sent to yungl...@gmail.com

___

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 arch...@mail-archive.com


Re: What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread Jean-Daniel Dupas

Le 17 nov. 2010 à 05:21, John Joyce a écrit :

 
 On Nov 17, 2010, at 12:40 PM, Kyle Sluder wrote:
 
 On Tue, Nov 16, 2010 at 5:27 PM, eveningnick eveningnick 
 eveningn...@gmail.com wrote:
 Hello!
 I have to write an application, that should run on the background.
 When the user needs, it should display some control panel. On Windows
 system i would have used System tray, and an icon there - when the
 user clicks on that icon, it displays some GUI. but what is the Mac's
 usual practice? I am thinking that the analog to that tray application
 is an agent, launched by launchd. On what event it is considered to be
 good to trigger that control panel?
 
 It depends on what you're writing.
 
 Don't use the status area (near the clock) just to provide access to your
 app. If you're writing a VPN client or something else whose status needs to
 be monitored continuously, the status area is a good place to put your UI: a
 status item with a menu that afford access to the app's
 configuration/preferences dialog.
 
 But don't use the status area for transient things. If you're writing a
 backup app, for example, and don't feel like burdening your users' status
 area with mundane backups are happening information, don't all of a sudden
 put UI to alert the user that something's gone wrong. But then how do you
 alert the user or let them configure things?
 
 If you have no configuration options (the only interaction you need in your
 background app is to alert the user) you can use the CFNotification API. If
 you *do* have configuration, then create an app that only configures things,
 and embed your background app as a helper tool inside this app wrapper. When
 you need to show UI, have your background app launch the main app that it's
 a part of.
 
 Alternatively, your main app could be a system preferences pane rather
 than a full-blown app.
 
 --Kyle Sluder

You can also consider the option Apple chosen with Spaces, Dashboard, and 
Expose. Deploy a real application bundle that launch this panel when double 
clic it.


-- Jean-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 arch...@mail-archive.com