Re: /Library/Logs vs. user/Library/Logs

2008-10-24 Thread Ken Thomases

On Oct 23, 2008, at 3:27 PM, Chris Markle wrote:


1. Document to read: Low-Level File Management Programming Topics:
Locating Directories on the System
(http://developer.apple.com/documentation/Cocoa/Conceptual/LowLevelFileMgmt/Tasks/LocatingDirectories.html 
)


There's also information on this topic here: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/ 



Cheers,
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 [EMAIL PROTECTED]


Re: File event notification

2008-10-24 Thread Ardian Lazuardi
Is it impossible to hook the copy procedures, such like windows  
programmers using shellhook, cbthook, or api hook, so that we can  
intercept the process before system does?



By using FSEvent, we can get the changed folder path. Can we get the  
modified filename exactly (deleted file's filename, created file'  
filename, etc) ?


Regards,
Ardian


On Thu, Oct 23, 2008 at 11:44 PM, Michael Ash [EMAIL PROTECTED] wrote:
 Can't be done. The system has no concept of copy. A copy simply
 means that you read the contents from A, and then write them to B.  
But
 there's no inherent link between the reading and the writing. In  
other

 words, when I'm writing out the contents to B, the system has no way
 of tracking that those contents did, in fact, come from A. To
 illustrate, I can copy a file by using the Finder, by using Save As  
in

 an app, or by doing something like tar -cf - A | tar -C B -xf - at
 the command line. There's simply no way the system is going to be  
able

 to tell you where the new file came from, in the sense that a human
 would interpret it.

... and a move between volumes is actually a copy + delete. So again,
no fool proof way to track.

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: File event notification

2008-10-24 Thread Stephen J. Butler
On Fri, Oct 24, 2008 at 3:10 AM, Ardian Lazuardi
[EMAIL PROTECTED] wrote:
 Is it impossible to hook the copy procedures, such like windows programmers
 using shellhook, cbthook, or api hook, so that we can intercept the process
 before system does?

You've missed the point. There *is* no copy procedure. The best you
get is the FSCopyObject, and there's no way to hook into that.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: File event notification

2008-10-24 Thread Ardian Lazuardi


Hi Stephen,

On Oct 24, 2008, at 5:13 PM, Stephen J. Butler wrote:


On Fri, Oct 24, 2008 at 3:10 AM, Ardian Lazuardi
[EMAIL PROTECTED] wrote:
Is it impossible to hook the copy procedures, such like windows  
programmers
using shellhook, cbthook, or api hook, so that we can intercept the  
process

before system does?


You've missed the point. There *is* no copy procedure. The best you
get is the FSCopyObject, and there's no way to hook into that.


OK, i got the point.

how about my another question? is it possible to get the filename  
modified from FSEvent?
By using FSEvent, we can get the changed folder path. Can we get the  
modified filename exactly (deleted file's filename, created file'  
filename, etc) ?




Regards,
Ardian


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Fwd: Problems when putting a window between desktop and desktop icons

2008-10-24 Thread Markus Amalthea Magnuson
(I accidentally posted this directly to the poster instead of the list.)

On Tue, Oct 21, 2008 at 23:09, Charles Steinman [EMAIL PROTECTED] wrote:

 --- On Tue, 10/21/08, Markus Amalthea Magnuson [EMAIL PROTECTED] wrote:

 This half transparent red color covers the desktop, but not
 the
 desktop icons. So far, so good. The problem however, is
 that my window
 intercepts all mouse clicks, even if I click on an icon.

 Does [window setIgnoresMouseEvents:YES] work?

Yes it does, as does setting the alpha value to zero. However, I
_want_ to intercept mouse events, just not when I click an icon. My
window should not intercept those clicks since it is obviously behind
the icons, but it does anyway.
-- 
Markus Amalthea Magnuson

http://konstochvanligasaker.se
http://nattlek.se

Life... is like a grapefruit. It's orange and squishy, and has a few
pips in it, and some folks have half a one for breakfast.
 – Douglas Adams
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: commitEditing

2008-10-24 Thread Chris Idou
--- On Wed, 10/22/08, Ron Lue-Sang [EMAIL PROTECTED] wrote:
 The only reason a controller would return NO for
 commitEditing is that  
 one of *its* editors refused to commitEditing.

It's not clear to me what its editors are. All I've got is an object with 
some fields, with an NSObjectController, and a few text fields. At least that 
is all that is apparent to me that is conceivably related to this 
NSObjectController. And there is no validation.


--- On Thu, 10/23/08, Mike Abdullah [EMAIL PROTECTED] wrote:
 Try using the asynchronous version:
 
 commitEditingWithDelegate:didCommitSelector:contextInfo:
 
 It should display an alert with the error.

It doesn't seem to, unless I'm somehow not using it correctly.






  
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Framework stops working

2008-10-24 Thread Mahaboob
Hi all,
I have been using the Pantomime framework for developing a mailing
application. It was working well. But, recently it stoped working, means it
is not firing the events
serviceInitialized:
messageSent: 
And 
connectionTerminated:

It only fires connectionEstablished: event and not going further resulting
timeout. I send email to its supports but I didn't got any reply.

Is there any way to do for its proper working?
Or Please let me know any alternative framework or other ways to implement
the mailing application.

Thanks in advance


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Consola application

2008-10-24 Thread parag vibhute
Hello all,

I have an open source application Consola (which I received from one of my
friend). But I do not have its source code.

FYI, there was an Open Source *Bluetooth* Proximity Media Server application
Consola. This application  its source code were available around Year
2005.

If anybody has source code of that application, then please send it. I need
to make certain enhancements to that applicatiion.

Thanks,
Palav


-- 

There are many things in your life that will catch your eye but only a few
will catch your heartpursue those'.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Retain

2008-10-24 Thread Ron Green

If I call NSString w = [NSString stringWithFormat:@something %i, x];

Am I now suppose to call retain on w?
When I'm done I know I'm suppose to release w.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Retain

2008-10-24 Thread Jean-Daniel Dupas

All answers you need are in this guide:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html

Le 24 oct. 08 à 07:24, Ron Green a écrit :


If I call NSString w = [NSString stringWithFormat:@something %i, x];

Am I now suppose to call retain on w?
When I'm done I know I'm suppose to release w.
___

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/devlists%40shadowlab.org

This email sent to [EMAIL PROTECTED]



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Retain

2008-10-24 Thread Jesper Storm Bache
It depends on the lifetime of w (which is an NSString*?) is supposed  
to live.

If you have:
void foo() {
NSString* w = [NSString stringWithFormat:@something %i, x];
bar(w);
}
	Then the answer is: You do not have to retain w (the above code is  
correct without release and incorrect if you add release).


If you have:
NSString* w = NULL;
void foo() {
w = [NSString stringWithFormat:@something %i, x];
[w retain];
}
void baz() {
bar(w);
[w release];
w = nil;
}
Then the answer is: Yes - you will have to add retain.

The reason is that any object created in the way that you show  
(NSString stringWithFormat) is autoreleased. This means that it is  
guaranteed to be live until the autorelease pool is drained next (and  
you cannot add another release without first adding a retain).
Unless your code explicitly creates and destroys autorelease pools,  
this again means that the object is guaranteed to be alive within your  
function scope. Once you return it may be deleted at any time.
Therefore if you need the object to stay alive across function scopes,  
you must manage the life time (and add retain/release).
Objects created by [[Class [alloc] init] have already been retained  
for you, and you should make sure that you release, or autorelease.
When in doubt, add a retain/release pair. For example, the following  
is also correct (barring any NSExceptions):

void foo() {
NSString* w = [[NSString stringWithFormat:@something %i, x] 
retain];
bar(w);
[w release];
}

If you are uncertain about memory management, be sure to run with the  
Leaks tool frequently and also run with debugmalloc (also know that  
obj-c 2 has a garbage collection option).


Jesper Storm Bache


On Oct 23, 2008, at 10:24 PM, Ron Green wrote:


If I call NSString w = [NSString stringWithFormat:@something %i, x];

Am I now suppose to call retain on w?
When I'm done I know I'm suppose to release w.
___

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/jsbache%40adobe.com

This email sent to [EMAIL PROTECTED]


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: File event notification

2008-10-24 Thread Robert Martin
You can do all this, but you'll have to set up a database/store to  
figure out the differences. I store the nodeID/parentID modDate and  
attributeChangDate as well as the path in order to get 'Delete'  
'Change' 'Move' and 'Rename' - 'Add is simple!



On Oct 24, 2008, at 4:31 AM, Ardian Lazuardi wrote:



Hi Stephen,

On Oct 24, 2008, at 5:13 PM, Stephen J. Butler wrote:


On Fri, Oct 24, 2008 at 3:10 AM, Ardian Lazuardi
[EMAIL PROTECTED] wrote:
Is it impossible to hook the copy procedures, such like windows  
programmers
using shellhook, cbthook, or api hook, so that we can intercept  
the process

before system does?


You've missed the point. There *is* no copy procedure. The best you
get is the FSCopyObject, and there's no way to hook into that.


OK, i got the point.

how about my another question? is it possible to get the filename  
modified from FSEvent?
By using FSEvent, we can get the changed folder path. Can we get  
the modified filename exactly (deleted file's filename, created  
file' filename, etc) ?


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Retain

2008-10-24 Thread Mike Abdullah
This sort of question comes up every couple of weeks. You did not use  
+alloc to create the string, so you do NOT need to release it. If you  
try to release it, the app will crash. Any of these are correct:


NSString w = [NSString stringWithFormat:@something %i, x];
// Do stuff


NSString w = [[NSString alloc] initWithFormat:@something %i, x];
// Do stuff
[w release];


NSString w = [NSString stringWithFormat:@something %i, x];
[w retain];
// Do stuff
[w release];


BUT NOT:

NSString w = [NSString stringWithFormat:@something %i, x];
// Do stuff
[w release];// Will crash here


On 24 Oct 2008, at 06:24, Ron Green wrote:


If I call NSString w = [NSString stringWithFormat:@something %i, x];

Am I now suppose to call retain on w?
When I'm done I know I'm suppose to release w.
___

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/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Retain

2008-10-24 Thread Devon Ferns
I've done stuff like this by accident but doesn't it actually crash 
later on when the auto release pool runs to release memory and not 
actually at the release?


This is a good use of NSZombies if you have strange crashes.

Devon

Mike Abdullah wrote:



BUT NOT:

NSString w = [NSString stringWithFormat:@something %i, x];
// Do stuff
[w release];// Will crash here



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Retain

2008-10-24 Thread Dave Carrigan


On Oct 24, 2008, at 8:23 AM, Mike Abdullah wrote:


NSString w = [NSString stringWithFormat:@something %i, x];
// Do stuff
[w release];// Will crash here



To be pedantic, it won't crash right there. It will crash sometime  
later in a place completely unrelated to the location that you  
released it.


--
Dave Carrigan
[EMAIL PROTECTED]
Seattle, WA, USA



PGP.sig
Description: This is a digitally signed message part
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: what do you use to make icons and similar?

2008-10-24 Thread Richard Somers
I have been using Inkscape for making images for buttons. The native  
Inkscape file format is svg (scalable vector graphics) with a pixel  
canvas. I changed the canvas units to points with a size of 32 x 32 or  
smaller, set the grid size to one point wide, and then draw my stuff  
with the vector tools so that it looks correctly on the 1 x 1 point  
grid. I then save as a pdf (a single vector image inside) and then use  
the pdf directly in Interface Builder. So far it works well. The  
background is transparent and it renders very well at all user  
interface resolutions in Quartz Debug with just a single image and file.


There are a few bugs in Inkscape but so far I have been able to work  
around them. Some of the issues seem to be perhaps related to the fact  
that the pixel canvas and point canvas are internally different sizes.  
I have a tradition mechanical draftsman type of background and so find  
the entire path based vector drawing paradigm and tools extremely  
bizarre but I am getting used to it. The primary thing I like about  
Inkscape is that it is free.


Inkscape works natively on WindowsXP which I have been using. I also  
downloaded the version of Inkscape for use with Leopard and X11  
yesterday. It seems to work just the same as on XP including the same  
bugs with the same workarounds required.


If anyone with more graphics experience than myself would like to  
comment on the pros and cons of this approach the feedback would be  
welcome.


Richard

On Oct 19, 2008, at 3:20AM, Roland King wrote:

I need a make a few icons and other graphics for my app, simple  
stuff like a small yellow triangle with an invisible background. I'm  
totally and completely graphically challenged which never helps. I  
can't find a simple (preferably free!) drawing program which will  
let me make stuff like this. What does everyone use for these things?


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Apple Developer Forums

2008-10-24 Thread Randall Meadows

It looks like we're legit to discuss now!

http://devforums.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 [EMAIL PROTECTED]


Re: Retain

2008-10-24 Thread Mike Abdullah
Yeah, but I figured that's more of a minor detail. When you're getting  
started you just don't want it to crash; doesn't matter too much when  
the crash actually occurs.


On 24 Oct 2008, at 16:33, Dave Carrigan wrote:



On Oct 24, 2008, at 8:23 AM, Mike Abdullah wrote:


NSString w = [NSString stringWithFormat:@something %i, x];
// Do stuff
[w release];// Will crash here



To be pedantic, it won't crash right there. It will crash sometime  
later in a place completely unrelated to the location that you  
released it.


--
Dave Carrigan
[EMAIL PROTECTED]
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/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Apple Developer Forums

2008-10-24 Thread Eric Gorr


On Oct 24, 2008, at 12:15 PM, Randall Meadows wrote:


It looks like we're legit to discuss now!

http://devforums.apple.com/


I wonder if there will be a corresponding iphone-dev mailing list...?

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Passing data to a different nib

2008-10-24 Thread Cody Brimhall
I'm not sure if this is the *best* approach for what you're trying to  
do, but you could use notifications (http://developer.apple.com/documentation/Cocoa/Conceptual/Notifications/Introduction/introNotifications.html 
).  If all you've got is two nib files loaded automatically at  
runtime, then I don't think there is a way for them to communicate  
more directly.



-Cody Brimhall

On Oct 23, 2008, at 9:31 PM, Hough, Kenneth P wrote:


Hi

I'm pretty sure it's very obvious however I still cannot figure it  
out.  I have done research and followed some sample code but just  
does not function for me.  The following is my problem:


I have a window with three NSButtons.  When one of the buttons are  
clicked, the previous window hides and a  new window appears showing  
a custom made number pad (just an array of buttons).  After typing  
in some random number I hit the save button to pass the inputted  
number to the previous window where the title of the button will  
change (once the save button is clicked the number pad window is  
dealloc and the previous window shows up again).  However my problem  
is I am unable to pass that simple piece of info.  I tried using  
global variables by incorporating simple C but that did not work.  I  
also tried creating methods within the class that holds the variable  
with the inputed data that will return that data when called,  
however it will cause the following compiler error: Undeclared  
method getValueetc.  What would be the easiest way to do this.   
Thanks.


Best Regards,
Kenneth


Biology and Biotechnology Combined Major
SGA PPE Interim Senator
Class of 2012
http://kenmbp.res.wpi.net
cell: (413) 346-7298
rm: (508) 831-6836

This message contains confidential information and is intended only  
for the individual named. If you are not the named addressee you  
should not disseminate, distribute or copy this e-mail. Please  
notify the sender immediately by e-mail if you have received this e- 
mail by mistake and delete this e-mail from your system. E-mail  
transmission cannot be guaranteed to be secure or error-free as  
information could be intercepted, corrupted, lost, destroyed, arrive  
late or incomplete, or contain viruses. The sender therefore does  
not accept liability for any errors or omissions in the contents of  
this message, which arise as a result of e-mail transmission.
www 
.emaildisclaimers.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/zbrimhall%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Apple Developer Forums

2008-10-24 Thread René v Amerongen


On 24 okt 2008, at 18:24, Eric Gorr wrote:



On Oct 24, 2008, at 12:15 PM, Randall Meadows wrote:


It looks like we're legit to discuss now!

http://devforums.apple.com/


I wonder if there will be a corresponding iphone-dev mailing list...?


I hope not, there is many overlaps between the all those devices and  
their programming.





___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Apple Developer Forums

2008-10-24 Thread Colin Cornaby
I like the developer lists myself. It's nice to do things from an  
email client.


On Oct 24, 2008, at 9:39 AM, René v Amerongen wrote:



On 24 okt 2008, at 18:24, Eric Gorr wrote:



On Oct 24, 2008, at 12:15 PM, Randall Meadows wrote:


It looks like we're legit to discuss now!

http://devforums.apple.com/


I wonder if there will be a corresponding iphone-dev mailing list...?


I hope not, there is many overlaps between the all those devices and  
their programming.





___

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/colin.cornaby%40mac.com

This email sent to [EMAIL PROTECTED]


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Problems when putting a window between desktop and desktop icons

2008-10-24 Thread Andreas Mayer


Am 24.10.2008 um 11:09 Uhr schrieb Markus Amalthea Magnuson:


My
window should not intercept those clicks since it is obviously behind
the icons, but it does anyway.


Ah. I never noticed that.

I can only speculate, but I guess it's actually the background view  
that is handling icon selection; makes sense since you can also drag- 
select multiple icons using a rubber band. If that's the case, you are  
probably out of luck.



Andreas
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Apple Developer Forums

2008-10-24 Thread Nick Zitzmann


On Oct 24, 2008, at 10:59 AM, Colin Cornaby wrote:

I like the developer lists myself. It's nice to do things from an  
email client.



Forums aren't too bad anymore, because many of them offer RSS, so you  
can at least browse threads in Mail if you use Mail as an RSS reader.  
But yeah, forums and lists do appeal to different people. MSDN for  
example only offers forums and not lists, and I wish they offered both.


But now we're going OT, so please don't follow up to this on-list...

Nick Zitzmann
http://www.chronosnet.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 [EMAIL PROTECTED]


Re: Strange Tiger incompatability

2008-10-24 Thread Kyle Sluder
On Wed, Oct 22, 2008 at 2:14 PM, David Burnett [EMAIL PROTECTED] wrote:
 Does any one know if IB Value Transformers instances working in Leopard
 without registration is a feature or an happy accident ?

It's undocumented; it may have been added as a compatibility hack or
something similar in Leopard, but you shouldn't rely on its behavior.

--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 [EMAIL PROTECTED]


No warning on float to int assignment?

2008-10-24 Thread Don Arnel
I was just looking through some code that I wrote, and noticed I had  
changed a float to an int in my header file but I was still assigning  
float values to it in the code. The odd thing was that the compiler  
was not complaining about it. Which warning is it that I need to turn  
on in the compiler settings? I've looked through all the warning  
options but can't seem to find it. I'm using Xcode 3.1.1, GCC 4.0.


Thanks.

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: No warning on float to int assignment?

2008-10-24 Thread Jason Coco


On Oct 24, 2008, at 14:10 , Don Arnel wrote:

I was just looking through some code that I wrote, and noticed I had  
changed a float to an int in my header file but I was still  
assigning float values to it in the code. The odd thing was that the  
compiler was not complaining about it. Which warning is it that I  
need to turn on in the compiler settings? I've looked through all  
the warning options but can't seem to find it. I'm using Xcode  
3.1.1, GCC 4.0.


It's perfectly legal to cast a float to an integer... the integral  
portion is always maintained and the remainder is simply truncated. I  
can't really think of a reason to warn about this, which is probably  
why no such warning exists.


J

smime.p7s
Description: S/MIME cryptographic signature
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: No warning on float to int assignment?

2008-10-24 Thread Sean McBride
On 10/24/08 2:22 PM, Jason Coco said:

On Oct 24, 2008, at 14:10 , Don Arnel wrote:

 I was just looking through some code that I wrote, and noticed I had
 changed a float to an int in my header file but I was still
 assigning float values to it in the code. The odd thing was that the
 compiler was not complaining about it. Which warning is it that I
 need to turn on in the compiler settings? I've looked through all
 the warning options but can't seem to find it. I'm using Xcode
 3.1.1, GCC 4.0.

It's perfectly legal to cast a float to an integer... the integral
portion is always maintained and the remainder is simply truncated. I
can't really think of a reason to warn about this, which is probably
why no such warning exists.

Perfectly legal, but often unintended.  A reason to warn is that
information is lost.

CodeWarrior has 2 independent warnings for this: float to integer and
integer to float.  I've looked, but I don't think gcc has this.

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: No warning on float to int assignment?

2008-10-24 Thread Scott Ribe
 It's perfectly legal to cast a float to an integer...

Legal yes, but not a bad idea to have a warning if it's done without an
explicit cast.

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


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSImage/NSImageView opacity

2008-10-24 Thread Randall Meadows

On Oct 23, 2008, at 7:53 PM, Jason Coco wrote:


On Oct 23, 2008, at 21:20 , Randall Meadows wrote:

The custom drawing doesn't fill up all the contents of the bounds  
of the view.  Specifically, a black border is left around the  
outside of where I'm drawing.  You can view a snapshot of what I'm  
talking about at http://www.not-pc.com/ViewBorder.png (that's the  
top-right corner of the custom view); the blue is the background,  
the gray is the contents of the view I'm drawing, and the black is  
what I'd like to get rid of (the blue background should show  
through).




How are you compositing the image when you're drawing it to the view?



Bah, incorrectly, apparently.  Using the right compositing mode  
(NSCompositeSourceOver instead of NSCompositeCopy--DOH!) fixed it  
right up.  Thanks for the whack upon the noggin.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSPredicate predicateWithFormat:

2008-10-24 Thread Keary Suska

On Oct 23, 2008, at 1:03 PM, chaitanya pandit wrote:

Well i could not find any explicit explicit alloc/init method for  
predicate, I am using Instruments to check for memory leaks, and it  
shows a memory leak with the array.


You would use NSComparisonPredicate for explicit creation. Anyway,  
just because instruments says there is a leak, doesn't mean there  
really is a leak. It just thinks there *might* be a leak. Use object  
allocations to watch namesArray, and I bet you will see it being  
deallocated nice and neat. If not, then it means you aren't showing us  
all of the relevant code.



On 23-Oct-08, at 11:33 PM, Keary Suska wrote:



On Oct 23, 2008, at 11:05 AM, chaitanya pandit wrote:

	NSArray *namesArray = [NSArray arrayWithObjects:@Tom ,  
@Matt , @Joe, nil];
	NSPredicate *predicate = [NSPredicate predicateWithFormat: @Name  
IN %@, namesArray];
	NSMutableArray *foundNames = [[arrayController  
arrangedObjects]filteredArrayUsingPredicate:predicate];


It works but he problem is that i have a memory leak over here,  
before creating the predicate, the retain count of namesArray is  
1, but after i create the predicate it is 2 and in instruments i  
see a memory leak with the namesArray.


There is no memory leak in the code you provided. Everything is  
autoreleased, and should be deallocated when the pool is drained.  
The NSPredicate is probably retaining its arguments, and it should  
release them when itself is released.


To check this, use alloc/init for the predicate and explicitly  
release it before re-checking the retain count.


Anyway, you shouldn't rely on retain count for memory-related  
issues, as you now see.





Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Strange Tiger incompatability

2008-10-24 Thread Ken Ferry
On Fri, Oct 24, 2008 at 10:54 AM, Kyle Sluder
[EMAIL PROTECTED] wrote:
 On Wed, Oct 22, 2008 at 2:14 PM, David Burnett [EMAIL PROTECTED] wrote:
 Does any one know if IB Value Transformers instances working in Leopard
 without registration is a feature or an happy accident ?

 It's undocumented; it may have been added as a compatibility hack or
 something similar in Leopard, but you shouldn't rely on its behavior.


Oh, interesting.  This should be documented better, it's intentional.

This is in the NSValueTransformer.h header on Leopard.

// if valueTransformerForName: does not find a registered transformer
instance, it will fall back to looking up a class with the specified
name - if one is found, it will instantiate a transformer with the
default -init method and automatically register it

-Ken
Cocoa Frameworks
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Apple Developer Forums

2008-10-24 Thread Charles E. Heizer
Problem is, it's only for iPhone Developer, paid programs.


On 10/24/08 9:15 AM, Randall Meadows [EMAIL PROTECTED] wrote:

It looks like we're legit to discuss now!

http:// devforums.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/heizer1%40llnl.gov

This email sent to [EMAIL PROTECTED]


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: [NSOpenPanel] How to disable folder selection but still access their contents?

2008-10-24 Thread Iceberg-Dev


On Oct 24, 2008, at 1:20 AM, Corbin Dunn wrote:



On Oct 23, 2008, at 1:38 PM, Iceberg-Dev wrote:


Solution not found in the cocoabuilder archive.

Problem:


I have a list of files and folders.

I can add items to this list through a standard NSOpenPanel dialog.

When a folder is already in the list, I want to prevent the user  
from selecting it from the NSOpenPanel dialog.


I can do this with:

- (BOOL) panel:(id)sender shouldShowFilename:(NSString *) inFileName;

The problem is that this prevents the user from selecting a file  
within this folder from the NSOpenDialog.


Question:
-

Is there a way to prevent a folder from being selected but still  
allow a file within this folder to be selected?


Yes; I think just calling setCanChooseDirectories:NO will work.

If not, then:

1. Don't use shouldShowFilename:
2. Call setCanChooseDirectories:NO
3. Call beginForDirectory:.. types:(your types)

If you have to do some specific dynamic processing to turn on/off  
enabled types, then you may be out of luck.


Feel free to log a bug requesting to make this process easier. (I  
already do have some bugs logged for this ability to be easier, so  
I am aware of the problem).


Hmm. Actually, I want the user to be able to choose a folder/ 
directory as long as it's not already in my list of files/folders.


Otherwise, setCanChooseDirectories:NO would work,

Or am I missing something and you're suggesting to call  
setCanChooseDirectories:NO:NO from the panel:shouldShowFilename:  
delegate method?



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: [NSOpenPanel] How to disable folder selection but still access their contents?

2008-10-24 Thread Corbin Dunn


On Oct 24, 2008, at 2:26 PM, Iceberg-Dev wrote:



On Oct 24, 2008, at 1:20 AM, Corbin Dunn wrote:



On Oct 23, 2008, at 1:38 PM, Iceberg-Dev wrote:


Solution not found in the cocoabuilder archive.

Problem:


I have a list of files and folders.

I can add items to this list through a standard NSOpenPanel dialog.

When a folder is already in the list, I want to prevent the user  
from selecting it from the NSOpenPanel dialog.


I can do this with:

- (BOOL) panel:(id)sender shouldShowFilename:(NSString *)  
inFileName;


The problem is that this prevents the user from selecting a file  
within this folder from the NSOpenDialog.


Question:
-

Is there a way to prevent a folder from being selected but still  
allow a file within this folder to be selected?


Yes; I think just calling setCanChooseDirectories:NO will work.

If not, then:

1. Don't use shouldShowFilename:
2. Call setCanChooseDirectories:NO
3. Call beginForDirectory:.. types:(your types)

If you have to do some specific dynamic processing to turn on/off  
enabled types, then you may be out of luck.


Feel free to log a bug requesting to make this process easier. (I  
already do have some bugs logged for this ability to be easier, so  
I am aware of the problem).


Hmm. Actually, I want the user to be able to choose a folder/ 
directory as long as it's not already in my list of files/folders.


Okay - I assumed you wanted only files.




Otherwise, setCanChooseDirectories:NO would work,

Or am I missing something and you're suggesting to call  
setCanChooseDirectories:NO:NO from the panel:shouldShowFilename:  
delegate method?


No; don't do that. You have to use shouldShowFilename: and implement - 
isValidFilename to validate the file when the user hits enter. Sorry  
-- there isn't any other way around it -- you can't have a folder  
disabled and still browseable with the current API.


I'd recommend just accepting all folders, and if it is already in your  
list, then just let the user choose the duplicate, and handle it as a  
nop.


corbin




___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: [NSOpenPanel] How to disable folder selection but still access their contents?

2008-10-24 Thread Iceberg-Dev


On Oct 24, 2008, at 11:51 PM, Corbin Dunn wrote:



On Oct 24, 2008, at 2:26 PM, Iceberg-Dev wrote:



On Oct 24, 2008, at 1:20 AM, Corbin Dunn wrote:



On Oct 23, 2008, at 1:38 PM, Iceberg-Dev wrote:


Solution not found in the cocoabuilder archive.

Problem:


I have a list of files and folders.

I can add items to this list through a standard NSOpenPanel dialog.

When a folder is already in the list, I want to prevent the user  
from selecting it from the NSOpenPanel dialog.


I can do this with:

- (BOOL) panel:(id)sender shouldShowFilename:(NSString *)  
inFileName;


The problem is that this prevents the user from selecting a file  
within this folder from the NSOpenDialog.


Question:
-

Is there a way to prevent a folder from being selected but still  
allow a file within this folder to be selected?


Yes; I think just calling setCanChooseDirectories:NO will work.

If not, then:

1. Don't use shouldShowFilename:
2. Call setCanChooseDirectories:NO
3. Call beginForDirectory:.. types:(your types)

If you have to do some specific dynamic processing to turn on/off  
enabled types, then you may be out of luck.


Feel free to log a bug requesting to make this process easier. (I  
already do have some bugs logged for this ability to be easier,  
so I am aware of the problem).


Hmm. Actually, I want the user to be able to choose a folder/ 
directory as long as it's not already in my list of files/folders.


Okay - I assumed you wanted only files.




Otherwise, setCanChooseDirectories:NO would work,

Or am I missing something and you're suggesting to call  
setCanChooseDirectories:NO:NO from the panel:shouldShowFilename:  
delegate method?


No; don't do that. You have to use shouldShowFilename: and  
implement -isValidFilename to validate the file when the user hits  
enter. Sorry -- there isn't any other way around it -- you can't  
have a folder disabled and still browseable with the current API.


I'd recommend just accepting all folders, and if it is already in  
your list, then just let the user choose the duplicate, and handle  
it as a nop.


OK, I will file an enhancement request because I think being able to  
disable a folder yet allow access to its contents can make sense in  
multiple cases. It would just require disabling the Open button.


Maybe something like [NSNavView  
setCanSeeContentsOfDisabledDirectories:YES];



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Rotation in CAAnimation layers

2008-10-24 Thread DKJ
Is there an easy way to provide a realistic shadow for a (non- 
circular) layer rotating round the z-axis? (I know layer.rotateShadow  
= YES is too much to hope for.) 
___


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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Security - Write to protected directory

2008-10-24 Thread Dragan Milić

Hi all.

Now, I really sincerely apologise for bringing this thread into life  
again and for probably abusing the list, since the topic is not  
strictly Cocoa, so if moderators mind this, just don't approve the  
message. But I need to ask a bit of advice related to privileged  
reading/writing and I couldn't find any other place to ask, since it's  
more related to user experience and app interface design.


On pet 03. 10. 2008., at 05:30, Bill Bumgarner wrote:

So... again... why does the OP's app need to write anything with  
authorization privileges (and where)?


I'd like to refer to this question...

Assume I created an archiving tool and a user wants to extract some  
files from an archive into a directory one hasn't got write permission  
for (e.g. /Applictions). Currently, the application shows alert sheet  
informing the user of permission denied error. But imagine that  
instead of that, a standard Mac OS X authentication dialog appears,  
asking for admin password in order to complete the operation (with  
prior explanation of why that is necessary). Of course, if the user is  
suspicious, he/she can click Cancel, in which case the permission  
denied error would appear as intended.


Do you think this is a good idea? On the one (positive) side, I think  
it'd make user interaction much smoother in the situations similar to  
the one above and possibly look like professional way to handle them.  
On the other (negative) side, I'm aware many people wouldn't trust  
giving admin password to my application, some may think that I faked  
authentication panel, some may wonder why in the world do I need to  
enter admin password to extract files?!. Also, many people tend to  
think that password should be asked only by (preferably Apple)  
installers and system tools (e.g. DiskUtility...) and in no case  
should it be asked from a shareware app.


Once again, I apologise if this was too much of abusing this list.

Milke

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Security - Write to protected directory

2008-10-24 Thread Nick Zitzmann


On Oct 24, 2008, at 4:52 PM, Dragan Milić wrote:

Assume I created an archiving tool and a user wants to extract some  
files from an archive into a directory one hasn't got write  
permission for (e.g. /Applictions). Currently, the application shows  
alert sheet informing the user of permission denied error. But  
imagine that instead of that, a standard Mac OS X authentication  
dialog appears, asking for admin password in order to complete the  
operation (with prior explanation of why that is necessary). Of  
course, if the user is suspicious, he/she can click Cancel, in  
which case the permission denied error would appear as intended.


Do you think this is a good idea?



Why not? Finder already does this if you try to copy something into a  
folder and you don't have write permission in that folder.


On the other (negative) side, I'm aware many people wouldn't trust  
giving admin password to my application,


Really? It's been my experience that, even with the additional  
requirement of entering a password, most users do not think critically  
about multiple choice alert panels. People tend to go onto auto-pilot  
and just click OK on all of them without reading or thinking about  
them. They're better than nothing, though.



some may think that I faked authentication panel,


This is a possibility, though highly unlikely. I have yet to see  
someone even try making a phishing panel on Mac OS X, and when it does  
happen, then you can expect a security update to fix it within a month.


some may wonder why in the world do I need to enter admin password  
to extract files?!.


Again, this is not very likely to happen. Most users will just pass  
through, and the few that think about it will probably be technically  
inclined enough to know that the reason why it's asking is because  
they don't have permission.


And for the small percentage in between, it is possible to customize  
the title of the authorization panel, so you can explain it there if  
you wish.


Nick Zitzmann
http://www.chronosnet.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 [EMAIL PROTECTED]


Re: NSImage/NSImageView opacity

2008-10-24 Thread Randall Meadows

On Oct 23, 2008, at 9:11 PM, Ken Ferry wrote:
Last, you might be interested in -[NSView  
cacheDisplayInRect:toBitmapImageRep:] as an alternate way of  
accomplishing the end goal. Take a gander at the 10.4 AppKit release  
notes, that have an explanatory section on this method.  Search for  
NSView Drawing Redirection API at http://developer.apple.com/releasenotes/Cocoa/AppKitOlderNotes.html 
.


OK, I thought this was what I wanted, but I seem to be having a  
problem that I don't fully understand.


I have 2 views, viewToReflect, and reflectionView (which shows the  
reflection of viewToReflect), both subclasses of NSView.  In each  
class, I have an outlet to the other.  In reflectionView, I have an  
NSBitmapImageRep* (reflectedImage) member.


When viewToReflect gets redrawn, I tell reflectionView that it needs  
to update itself:


[reflectionView setNeedsDisplay];

In reflectionView's -drawRect:, I create the NSBitmapImageRep instance  
and I initialize it as those release notes state:


reflectedImage = [viewToReflect bitmapImageRepForCachingDisplayInRect: 
[viewToReflect bounds]];
NSGraphicsContext *bitmapGraphicsContext = [NSGraphicsContext  
graphicsContextWithBitmapImageRep:reflectedImage];

[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:bitmapGraphicsContext];
[[NSColor clearColor] set];
NSRectFill(NSMakeRect(0, 0, [reflectedImage size].width,  
[reflectedImage size].height));

[NSGraphicsContext restoreGraphicsState];

and then I call

[viewToReflect cacheDisplayInRect:[viewToReflect bounds]  
toBitmapImageRep:reflectedImage];


This causes a recursion cycle to start; upon calling this  
cacheDisplayInRect:... method, I ended up being put back at the top of  
reflectionView's -drawRect:, even though it's viewToReflect that  
should be getting redrawn.  I assumed I would go back through the  
viewToReflect's -drawRect, but that is not happening (I have a  
breakpoint there, and it's not getting hit after this call, while the  
reflectionView's -drawRect: breakpoint IS getting hit).  Here's a  
stack trace snippet:


...repeat lines 15-19 ad infinitum (as long as I keep continuing)
#15 0x0002a8b8 in -[CardReflectionView drawRect:] at  
CardReflectionView.m:29
#16 0x903e2eb2 in -[NSView(NSInternal)  
_recursive:displayRectIgnoringOpacity:inContext:topView:]
#17 0x903e324a in -[NSView(NSInternal)  
_recursive:displayRectIgnoringOpacity:inContext:topView:]

#18 0x903e27db in -[NSView displayRectIgnoringOpacity:inContext:]
#19 0x90489c0c in -[NSView cacheDisplayInRect:toBitmapImageRep:]
#20 0x0002a8b8 in -[CardReflectionView drawRect:] at  
CardReflectionView.m:29
#21 0x903e2eb2 in -[NSView(NSInternal)  
_recursive:displayRectIgnoringOpacity:inContext:topView:]
#22 0x903e324a in -[NSView(NSInternal)  
_recursive:displayRectIgnoringOpacity:inContext:topView:]

#23 0x903e27db in -[NSView displayRectIgnoringOpacity:inContext:]
#24 0x90489c0c in -[NSView cacheDisplayInRect:toBitmapImageRep:]
#25 0x0002a8b8 in -[CardReflectionView drawRect:] at  
CardReflectionView.m:29

#26 0x90399984 in -[NSView _drawRect:clip:]

cacheDisplayInRect:... sure seemed like what I want to do, and going  
over it again (and again, and again...) it sure seems logical, but  
obviously I'm missing something rather important.  Anyone care to  
point what exactly what that might be to me?


Thanks!
randy
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Security - Write to protected directory

2008-10-24 Thread Tommy Nordgren


On 3 okt 2008, at 16.39, Michael Ash wrote:


...snip



Nope! AEWP is a rather broken API in more ways than one. One of the
ways that it's broken is that it is *impossible* to correctly use it
without a subprocess which will cooperate with you. The reason for
this is that you *must* use wait4 or waitpid to reap the zombie that
will be created when the subprocess terminates, but AEWP provides *no*
way to get the pid. (You cannot use wait or wait3 because those could
	NOPE. As soon as the App terminates, any unreaped subprocess will  
become a child

of, and finally reaped by launchd


end up inadvertently reaping a child process spawned by a library
you're using.) So your subprocess must have a way to communicate its
pid back to the parent, and do so very early before it does anything
that could make it crash or otherwise terminate.

Correct use of AEWP is extremely weird and un-fun. I definitely
recommend finding some of Apple's sample code on the subject, and then
adapting it to do what you need, rather than trying to figure out how
to use it on your own. In particular, the BetterAuthorizationSample,
while probably not doing what you need, is full of useful commentary
on how it works and how it gets around the various problems with the
AEWP API:

http://developer.apple.com/samplecode/BetterAuthorizationSample/index.html

Mike
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/tommy.nordgren%40comhem.se

This email sent to [EMAIL PROTECTED]


--
What is a woman that you forsake her, and the hearth fire and the home  
acre,
to go with the old grey Widow Maker.  --Kipling, harp song of the Dane  
women

Tommy Nordgren
[EMAIL PROTECTED]



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Rotation in CAAnimation layers

2008-10-24 Thread douglas welton

On Oct 24, 2008, at 6:50 PM, DKJ wrote:

Is there an easy way to provide a realistic shadow for a (non- 
circular) layer rotating round the z-axis? (I know  
layer.rotateShadow = YES is too much to hope for.)


To get a realistic answer, it might help if you provide a little  
more specific information about 1) what you are trying to do, 2) what  
is not working and 3) what you have tried. (consult: http://www.catb.org/~esr/faqs/smart-questions.html 
)


regards,

douglas


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSImage/NSImageView opacity

2008-10-24 Thread Ken Ferry
Yes, -cacheDisplayInRect:toBitmapImageRep: is going to end up calling
drawRect:.  It's not meant to be invoked _from_ drawRect:.

You can call that from another view, or from a controller, or whatever.

-Ken

On Fri, Oct 24, 2008 at 5:07 PM, Randall Meadows [EMAIL PROTECTED] wrote:
 On Oct 23, 2008, at 9:11 PM, Ken Ferry wrote:

 Last, you might be interested in -[NSView
 cacheDisplayInRect:toBitmapImageRep:] as an alternate way of accomplishing
 the end goal. Take a gander at the 10.4 AppKit release notes, that have an
 explanatory section on this method.  Search for NSView Drawing Redirection
 API at
 http://developer.apple.com/releasenotes/Cocoa/AppKitOlderNotes.html.

 OK, I thought this was what I wanted, but I seem to be having a problem that
 I don't fully understand.

 I have 2 views, viewToReflect, and reflectionView (which shows the
 reflection of viewToReflect), both subclasses of NSView.  In each class, I
 have an outlet to the other.  In reflectionView, I have an NSBitmapImageRep*
 (reflectedImage) member.

 When viewToReflect gets redrawn, I tell reflectionView that it needs to
 update itself:

 [reflectionView setNeedsDisplay];

 In reflectionView's -drawRect:, I create the NSBitmapImageRep instance and I
 initialize it as those release notes state:

 reflectedImage = [viewToReflect
 bitmapImageRepForCachingDisplayInRect:[viewToReflect bounds]];
 NSGraphicsContext *bitmapGraphicsContext = [NSGraphicsContext
 graphicsContextWithBitmapImageRep:reflectedImage];
 [NSGraphicsContext saveGraphicsState];
 [NSGraphicsContext setCurrentContext:bitmapGraphicsContext];
 [[NSColor clearColor] set];
 NSRectFill(NSMakeRect(0, 0, [reflectedImage size].width, [reflectedImage
 size].height));
 [NSGraphicsContext restoreGraphicsState];

 and then I call

 [viewToReflect cacheDisplayInRect:[viewToReflect bounds]
 toBitmapImageRep:reflectedImage];

 This causes a recursion cycle to start; upon calling this
 cacheDisplayInRect:... method, I ended up being put back at the top of
 reflectionView's -drawRect:, even though it's viewToReflect that should be
 getting redrawn.  I assumed I would go back through the viewToReflect's
 -drawRect, but that is not happening (I have a breakpoint there, and it's
 not getting hit after this call, while the reflectionView's -drawRect:
 breakpoint IS getting hit).  Here's a stack trace snippet:

 ...repeat lines 15-19 ad infinitum (as long as I keep continuing)
 #15 0x0002a8b8 in -[CardReflectionView drawRect:] at CardReflectionView.m:29
 #16 0x903e2eb2 in -[NSView(NSInternal)
 _recursive:displayRectIgnoringOpacity:inContext:topView:]
 #17 0x903e324a in -[NSView(NSInternal)
 _recursive:displayRectIgnoringOpacity:inContext:topView:]
 #18 0x903e27db in -[NSView displayRectIgnoringOpacity:inContext:]
 #19 0x90489c0c in -[NSView cacheDisplayInRect:toBitmapImageRep:]
 #20 0x0002a8b8 in -[CardReflectionView drawRect:] at CardReflectionView.m:29
 #21 0x903e2eb2 in -[NSView(NSInternal)
 _recursive:displayRectIgnoringOpacity:inContext:topView:]
 #22 0x903e324a in -[NSView(NSInternal)
 _recursive:displayRectIgnoringOpacity:inContext:topView:]
 #23 0x903e27db in -[NSView displayRectIgnoringOpacity:inContext:]
 #24 0x90489c0c in -[NSView cacheDisplayInRect:toBitmapImageRep:]
 #25 0x0002a8b8 in -[CardReflectionView drawRect:] at CardReflectionView.m:29
 #26 0x90399984 in -[NSView _drawRect:clip:]

 cacheDisplayInRect:... sure seemed like what I want to do, and going over it
 again (and again, and again...) it sure seems logical, but obviously I'm
 missing something rather important.  Anyone care to point what exactly what
 that might be to me?

 Thanks!
 randy

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: MVC

2008-10-24 Thread Ian Joyner

On 24/10/2008, at 4:42 PM, Carlos Weber wrote:

No one can have a complete understanding of MVC without hearing  
James Dempsey (an Apple engineer) explicate it:


http://www.youtube.com/watch?v=YYvOGPMLVDo


Excellent. And I thought MVC was Mountain View, California!

Actually, I first came across it while doing MacApp about 20 years ago  
and reading Brad Cox's book on some obscure language called Objective- 
C... whatever happened to that?


James's observation about a string maybe containing a phone number or  
the works of Aristotle not being of concern to the view, but being in  
the Model's domain does raise the difficulty in it – where does  
semantics of information come in and specifically validation. With web- 
based applications, we are putting more into JavaScript, where the  
view may check that something looks like a phone number (rather than  
the works of Aristotle), thus giving a user a better interface (error  
message, rather than Windows has found an error, error number 60532,  
click here to find out more information about what this is about). It  
can also provide a faster feedback loop to the user than sending a  
message to a server to get Invalid data back.


As for the original question. there aren't hard and fast rules about  
MVC, but it certainly helps design any app by using its guidelines.  
Within Cocoa, however, there is a lot of support with Core Data  
helping with the model and bindings helping with doing a lot of that  
boring controller stuff, and obviously nib files (xib, and Interface  
Builder) isolate the view for you.


Ian___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Security - Write to protected directory

2008-10-24 Thread Michael Ash
On Fri, Oct 24, 2008 at 8:46 PM, Tommy Nordgren
[EMAIL PROTECTED] wrote:

 On 3 okt 2008, at 16.39, Michael Ash wrote:

 ...snip

 Nope! AEWP is a rather broken API in more ways than one. One of the
 ways that it's broken is that it is *impossible* to correctly use it
 without a subprocess which will cooperate with you. The reason for
 this is that you *must* use wait4 or waitpid to reap the zombie that
 will be created when the subprocess terminates, but AEWP provides *no*
 way to get the pid. (You cannot use wait or wait3 because those could

NOPE. As soon as the App terminates, any unreaped subprocess will
 become a child
 of, and finally reaped by launchd

That's true, except it's bad form to leave zombies lying around when
your application has an unbounded lifetime, as basically every GUI
application does. It goes from bad to extremely bad if the
authorization process can be repeated an arbitrary number of times,
since you can build up an unlimited number of zombies that way. The
extreme difficulty of reaping the children left behind by AEWP is a
huge deficiency in the API.

Mike
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Can someone point me a Core Animation layer compositing example?

2008-10-24 Thread Michael A. Crawford
I need to learn how to take three or four Core-Animation layers and  
composite them on onto one another while animating, in order to  
simulate a complex gauge.  I'm assuming this will be a lot easier than  
it is in Windows.


The different elements (needles and such) of the gauge will be on  
their own layer and will animate by rotating around the center.   
Additionally, I need for most of the layer to be transparent except  
for the gauge elements.  Any example code you can point to that will  
help me to assemble these different functional elements would be  
greatly appreciated.


-Michael 

smime.p7s
Description: S/MIME cryptographic signature
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Apple Developer Forums

2008-10-24 Thread Stefan Arentz
On Fri, Oct 24, 2008 at 12:15 PM, Randall Meadows [EMAIL PROTECTED] wrote:
 It looks like we're legit to discuss now!

 http://devforums.apple.com/

Personally I think this is a big joke.

You need to be signed up as a paying developer to access the forum.

The forum is closed. It is not indexed by Google. You need to be
logged in to even read articles. What is up with that? I thought the
NDA was lifted.

The forum is moderated by Apple. Bad. I want to discuss anything. Not
having to worry about Apple the dictator closing my account because I
am saying things they don't want people to discuss.

There is no RSS?

Personally I hate forums. Mailing lists are much easier to read and
follow. But that could just be me.

But seriously, what we need is an OPEN discussion platform. Not some
apple moderated forum limited to developers.

 S.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Removing 4 pixels

2008-10-24 Thread Dave DeLong

Hi everyone,

At the top of every NSMenu I can find, with one exception (which I  
will get to), there are four blank pixels.  These pixels separate the  
top of the first menuitem from the top of the menu.  The one exception  
to this is an application's Help menu, where the first menu item (in  
Leopard) is the blue search box.


I'm building a menu that is very similar to the Help menu, and I'd  
like to get rid of those four pixels at the top.  How can I do this?


Thanks,

Dave DeLong
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


GC app not releasing memory until click, even if I send

2008-10-24 Thread Mark Aufflick
Hi all,

I'm going mental here. I have an app, using garbage collection, that
responds to distributed notifications. All the memory allocated by the
method that responds to those notifications builds up (watching in top
or Instruments) until a real UI event is recieved - click on a
menu/window etc.

To try to flog the event loop into draining the pool I post an
NSApplicationDefined event as per
http://www.mikeash.com/?page=pyblog/more-fun-with-autorelease.html and
other documents, but it doesn't clear the memory. I know the event is
being posted because if I subclass NSApplication I can log the events
being recieved in sendEvent:

[NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined
location:NSZeroPoint
   modifierFlags:0
   timestamp:0
windowNumber:0
 context:nil
 subtype:0
   data1:0
   data2:0]
 atStart:YES];

Is there something special I need to do to have the garbaage
collection collect inside a notification observer? If I let the
application run overnight being fed regular notifications, the size
gets over 100Mb of wasted memory, which I assume would be beyond the
garbage collection threshold? Certainly any click on the app drops it
down to 14Mb immediately.

Mark.

-- 
Mark Aufflick
  contact info at http://mark.aufflick.com/about/contact
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: GC app not releasing memory until click, even if I send

2008-10-24 Thread Kyle Sluder
On Fri, Oct 24, 2008 at 11:52 PM, Mark Aufflick [EMAIL PROTECTED] wrote:
 Is there something special I need to do to have the garbaage
 collection collect inside a notification observer?

Run the run loop?

--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 [EMAIL PROTECTED]


Disable Sorting in NSTableView

2008-10-24 Thread Grant Limberg
Is it possible to disable the user's ability to resort the rows in a  
table by clicking on the column header?  I have a table view that  
stores statistics in the order they are received by the program and  
shouldn't be resorted.  Is there a way to do this without removing the  
column headers?


Thanks,

Grant Limberg
[EMAIL PROTECTED]
LinkedIn: http://www.linkedin.com/in/grantlimberg
http://www.glsoftware.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 [EMAIL PROTECTED]


Re: Apple Developer Forums

2008-10-24 Thread Brian Stern


On Oct 24, 2008, at 11:04 PM, Stefan Arentz wrote:

On Fri, Oct 24, 2008 at 12:15 PM, Randall Meadows [EMAIL PROTECTED] 
 wrote:

It looks like we're legit to discuss now!

http://devforums.apple.com/


Personally I think this is a big joke.


But seriously, what we need is an OPEN discussion platform. Not some
apple moderated forum limited to developers.


There are plenty of them.  Just look.  That's of course what makes  
this all a joke.  There are tons of completely open forums, iPhone  
code archived on google.code, huge numbers of blogs with iPhone  
tutorials, all of this for the last six months.


Apple has been peeing in the iPhone development pool for a while.   
Until now they haven't taken a dump in the pool.  I'll say that this  
new forum is a baby-step in the right direction.  But it all remains  
to be seen.


--
Brian Stern
[EMAIL PROTECTED]



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: GC app not releasing memory until click, even if I send

2008-10-24 Thread Bill Bumgarner

On Oct 24, 2008, at 8:52 PM, Mark Aufflick wrote:

I'm going mental here. I have an app, using garbage collection, that
responds to distributed notifications. All the memory allocated by the
method that responds to those notifications builds up (watching in top
or Instruments) until a real UI event is recieved - click on a
menu/window etc.


Yeah... that ain't right.   But I'll need to know more about your  
app


See below.


To try to flog the event loop into draining the pool I post an
NSApplicationDefined event as per
http://www.mikeash.com/?page=pyblog/more-fun-with-autorelease.html and
other documents, but it doesn't clear the memory. I know the event is
being posted because if I subclass NSApplication I can log the events
being recieved in sendEvent:

   [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined
   location:NSZeroPoint
  modifierFlags:0
  timestamp:0
   windowNumber:0
context:nil
subtype:0
  data1:0
  data2:0]
atStart:YES];

Is there something special I need to do to have the garbaage
collection collect inside a notification observer? If I let the
application run overnight being fed regular notifications, the size
gets over 100Mb of wasted memory, which I assume would be beyond the
garbage collection threshold? Certainly any click on the app drops it
down to 14Mb immediately.


OK being fed regular notifications.   Are the notifications  
being handled on the main thread?  Are you running a runloop (I would  
imagine you would have to be to have the above work) in a standard  
fashion?


Any threads?

Have you used the various tools on the system -- Object Graph in  
Instruments, malloc stack logging, malloc history, etc... -- to see  
what objects are hanging about?


---

On to possible reasons why.

Given the lack of information, this is conjecture at the moment.

(1) The further you move away from NSRunLoop, the more likely that you  
are running into artificial rooting caused by the stack.   That is,  
the stack must be scanned conservatively because the compiler does not  
offer any way to know exactly where every object reference on the  
stack might reside.   Thus, NSRunLoop will periodically clear the  
stack -- zero out the stack -- to eliminate any phantom references.
It may be that you have created a situation where this clearing is not  
happening or is incomplete.


You can use objc_clear_stack() -- see /usr/include/objc/objc-auto.h --  
to clear the stack.


See:

http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcAPI.html#//apple_ref/doc/uid/TP40002467-SW14

(2) However, given that the memory is building up over time, this  
indicates that something else is going on.  That the memory is reaped  
when you trigger a UI event indicates that there is a collection class  
or something somewhere that is gathering together the memory over  
time.   This seems unlikely, but possible.


To figure this one out, you'll really need to figure out what is  
hanging around that shouldn't.


If you do, please share.  If you don't want to share ;), file a radar  
and send me the bug number -- at the very least, documenting the  
pitfall is warranted.


(3) I saved the simplest potential explanation for last.

It might be that your program is just different enough from the well  
tested patterns that it fell through a collection crack.  In  
particular, the collector interacts with the AppKit to such that the  
collector is effectively hinted as to when good times to collect might  
be.   This hinting is pretty critical to the collector (for now -- the  
goal, of course, is to eliminate the need for any hinting while  
maximizing performance).


If you were to call [[NSGarbageCollector defaultCollector]  
collectIfNeeded]; at the end of processing notifications, that very  
likely might fix the issue.


If this is the case, filing a bug is warranted.  If it is the case  
that a pure distributed notifications only application does not reap  
garbage, I want to know.


b.bum



smime.p7s
Description: S/MIME cryptographic signature
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: NSImage/NSImageView opacity

2008-10-24 Thread Randall Meadows

On Oct 24, 2008, at 8:00 PM, Ken Ferry wrote:

Yes, -cacheDisplayInRect:toBitmapImageRep: is going to end up  
calling drawRect:.  It's not meant to be invoked _from_ drawRect:.




You can call that from another view, or from a controller, or  
whatever.


That's what I'm doing; I am calling cacheDisplay... on the  
viewToReflect *from* the reflectionView's -drawRect, not its own - 
drawRect.  But when I do that, reflectionView's -drawRect is called,  
not viewToReflect's -drawRect.  That's why I said it all seemed so  
logical, but the behavior I'm seeing is not.



randy
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: GC app not releasing memory until click, even if I send

2008-10-24 Thread Mark Aufflick
Of course. I was trying to get the default autorelease pool to drain
it, but I just need to operate on the defaultCollerctor.

Your last piece of advice alomst worked - I had to:

[[NSGarbageCollector defaultCollector] collectExhaustively];

I'm not doing anything fancy with the runloop - just the Xcode cocoa
application template. I set up the observer via
[NSDistributedNotificationCenter defaultCenter] addObserver:... in
awakeFromNib of a controller. No explicit threads.

Do you think that constitutes a radar? It certainly seems like the
collector should run since events are being received in the run loop
(evidenced by an NSLog in sendEvent).

Thanks so much for your help - I would have beaten release pools to
death before I looked at NSGarbageCollector...

Mark.

On Sat, Oct 25, 2008 at 3:21 PM, Bill Bumgarner [EMAIL PROTECTED] wrote:
 On Oct 24, 2008, at 8:52 PM, Mark Aufflick wrote:

 I'm going mental here. I have an app, using garbage collection, that
 responds to distributed notifications. All the memory allocated by the
 method that responds to those notifications builds up (watching in top
 or Instruments) until a real UI event is recieved - click on a
 menu/window etc.

 Yeah... that ain't right.   But I'll need to know more about your app

 See below.

 To try to flog the event loop into draining the pool I post an
 NSApplicationDefined event as per
 http://www.mikeash.com/?page=pyblog/more-fun-with-autorelease.html and
 other documents, but it doesn't clear the memory. I know the event is
 being posted because if I subclass NSApplication I can log the events
 being recieved in sendEvent:

   [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined
   location:NSZeroPoint
  modifierFlags:0
  timestamp:0
   windowNumber:0
context:nil
subtype:0
  data1:0
  data2:0]
atStart:YES];

 Is there something special I need to do to have the garbaage
 collection collect inside a notification observer? If I let the
 application run overnight being fed regular notifications, the size
 gets over 100Mb of wasted memory, which I assume would be beyond the
 garbage collection threshold? Certainly any click on the app drops it
 down to 14Mb immediately.

 OK being fed regular notifications.   Are the notifications being
 handled on the main thread?  Are you running a runloop (I would imagine you
 would have to be to have the above work) in a standard fashion?

 Any threads?

 Have you used the various tools on the system -- Object Graph in
 Instruments, malloc stack logging, malloc history, etc... -- to see what
 objects are hanging about?

 ---

 On to possible reasons why.

 Given the lack of information, this is conjecture at the moment.

 (1) The further you move away from NSRunLoop, the more likely that you are
 running into artificial rooting caused by the stack.   That is, the stack
 must be scanned conservatively because the compiler does not offer any way
 to know exactly where every object reference on the stack might reside.
 Thus, NSRunLoop will periodically clear the stack -- zero out the stack --
 to eliminate any phantom references.   It may be that you have created a
 situation where this clearing is not happening or is incomplete.

 You can use objc_clear_stack() -- see /usr/include/objc/objc-auto.h -- to
 clear the stack.

 See:

 http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcAPI.html#//apple_ref/doc/uid/TP40002467-SW14

 (2) However, given that the memory is building up over time, this indicates
 that something else is going on.  That the memory is reaped when you trigger
 a UI event indicates that there is a collection class or something somewhere
 that is gathering together the memory over time.   This seems unlikely, but
 possible.

 To figure this one out, you'll really need to figure out what is hanging
 around that shouldn't.

 If you do, please share.  If you don't want to share ;), file a radar and
 send me the bug number -- at the very least, documenting the pitfall is
 warranted.

 (3) I saved the simplest potential explanation for last.

 It might be that your program is just different enough from the well tested
 patterns that it fell through a collection crack.  In particular, the
 collector interacts with the AppKit to such that the collector is
 effectively hinted as to when good times to collect might be.   This hinting
 is pretty critical to the collector (for now -- the goal, of course, is to
 eliminate the need for any hinting while maximizing performance).

 If you were to call [[NSGarbageCollector defaultCollector] collectIfNeeded];
 at the end of processing notifications, that very likely might fix the
 issue.

 If 

Re: Consola application

2008-10-24 Thread Marcus



Hello all,

I have an open source application Consola (which I received from  
one of my

friend). But I do not have its source code.

FYI, there was an Open Source *Bluetooth* Proximity Media Server  
application
Consola. This application  its source code were available around  
Year

2005.

If anybody has source code of that application, then please send it.  
I need

to make certain enhancements to that applicatiion.

Thanks,
Palav



Hello Palav.

I have a copy of that application's source code.
http://www.acc.umu.se/~mk/archive/Consola_v1.1_src.zip

Cheers.
Marcus


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: GC app not releasing memory until click, even if I send

2008-10-24 Thread Bill Bumgarner
Excellent.  Glad that it works.  Still a bug needed, though.  See  
below...


On Oct 24, 2008, at 10:18 PM, Mark Aufflick wrote:

Of course. I was trying to get the default autorelease pool to drain
it, but I just need to operate on the defaultCollerctor.

Your last piece of advice alomst worked - I had to:

[[NSGarbageCollector defaultCollector] collectExhaustively];


I suspect that -collectIfNeeded would work in your long running test  
case.   But there is little harm in calling collectExhaustively as  
long as you are doing so relatively infrequently.  Garbage is garbage  
afterall and a small heap is relatively cheap to scan.



I'm not doing anything fancy with the runloop - just the Xcode cocoa
application template. I set up the observer via
[NSDistributedNotificationCenter defaultCenter] addObserver:... in
awakeFromNib of a controller. No explicit threads.

Do you think that constitutes a radar? It certainly seems like the
collector should run since events are being received in the run loop
(evidenced by an NSLog in sendEvent).


That *definitely* warrants a radar.   It definitely appears that you  
have a pattern of usage that the collector is not dealing with  
correctly!


To summarize:  You have an application whose sole source of events are  
[ideally] from NSDistributedNotificationCenter.  The collector isn't  
reaping garbage in this situation with anywhere near the efficiency  
that it should.  It should not require the hint via either - 
collectIfNeeded or -collectExhaustively.



Thanks so much for your help - I would have beaten release pools to
death before I looked at NSGarbageCollector...


Happy to help,

b.bum



smime.p7s
Description: S/MIME cryptographic signature
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]