Re: Network notifications

2008-04-01 Thread Hamish Allan
On Tue, Apr 1, 2008 at 5:03 AM, Jens Alfke <[EMAIL PROTECTED]> wrote:

>  You want to set a TXT record for the service.

I disagree. If the updates are frequent, this makes a lot of work for
every other machine on the LAN to update their mDNSResponder caches.
Randall mentioned that there's really only going to be one listener,
so why make it everyone else's problem?

Hamish
___

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]


test if another app has hung

2008-04-01 Thread Ben Dougall

Hello,

What's the best way to test if another app has likely hung or not? 
Programmatically of course. I want to be able to kill an often hanging 
app and restart it -- when it's hung that is. (10.3.9+)


Thanks, Ben.

___

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: Question on bitmap fonts

2008-04-01 Thread Tobia Conforto

Aki Inoue wrote:


It appears that this is the intended behavior.

The font contains glyphs that extend beyond the ascender line (the  
accented glyphs) and Cocoa automatically adjusts the default line  
height accordingly to avoid baseline shifts.


But the font doesn't have any glyphs that extend beyond the ascender  
line!


The font is designed for fixed-width 9x18 cells, where the 18px height  
is split between a 14px ascent and a 4px descent.


There are no glyphs that go above 14px from the baseline, nor below  
-4px.  All glyphs fit nicely in the fixed-width cells, and yet when I  
put enough characters in the font, the system adds an additional 4px  
of ascent: an additional inter-line space that is not occupied by any  
glyph and makes the font unusable.


Can you try the two fonts I linked in my previous email, below, and  
tell me what is causing the additional spacing?  They both have  
accented characters, and none of them has any combining chars or other  
strange things.  Yet one displays the bug and the other works perfectly.



Tobia



On 2008/03/31, at 9:23, Tobia Conforto wrote:

Hello

After 1000 messages to this list and no reply, I'm resubmitting my  
question about bitmap fonts, hoping to get any bit of help or any  
pointer at all (docs, other mailing lists, etc.)


Basically, I would like to know what are the best practices and  
recommended programs for preparing bitmap fonts for use in Cocoa  
applications.  I'm also reporting what is probably a bug in either  
OS X or the available font editors.


If there is a list better suited to this question, please point me  
to it.



I'm trying to convert the well known X11 fixed unicode fonts to a  
format usable in Cocoa text editors and terminal programs.  These  
fonts are available under a free license on Markus Kuhn's website: http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html 
 and are provided in source BDF format.


I tried using the free editor Fontforge to convert 9x18.bdf into a  
so-called (by Fontforge) "Apple bitmap-only .dfont" format.  Mostly  
it works, but I've run into a problem that Fontforge's programmers  
can't solve.  See this thread on their list:

http://www.nabble.com/BDF-to-Apple-bitmap-only-dfont,-wrong-line-height-td15155775.html

The problem is that the generated dfont is rendered by OS X with  
4px of additional ascent (or line-height) and we can't figure out  
where it comes from.  If I convert only the ASCII subset of the  
original Unicode font, the line-height is correct.  As soon as I  
add more than a couple of non-ASCII characters, the 4px bug comes  
out.


I tried doing the same conversion using a trial version of the  
commercial BitFonter 3.0 editor ($500) and I got the same results  
as with Fontforge.


I looked into the .dfont file with a hex editor, using this manual  
as a reference http://developer.apple.com/textfonts/TTRefMan/ but I  
couldn't find anything out of place.


Here is a zip http://gruppo4.com/~tobia/osx-font-problem.zip where  
I've put two OS X dfont files I created from 9x18.bdf, using  
Fontforge, plus a text file with the font tables I extracted using  
the hex editor.
In "test3" I converted the full Latin 1 charset (Unicode points <  
256) and it shows the 4px bug; in "test7" I deleted all glyphs  
other than ASCII and a couple of Latin 1 accented letters, and it  
displays correctly in all Cocoa apps.


What am I doing wrong?  What's different in the two files?  Can you  
replicate this bug?  Is this a bug in OS X, a weird setting in the  
original BDF, or a bug shared between Fontforge and BitFonter?


Can you think of any workaround or alternative program I could try?

Tobia

___

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]


Getting Localized System Strings

2008-04-01 Thread Gerriet M. Denkmann
Cocoa uses (automatically) localized strings. I would like to do the  
same.


E.g. using NSTextView and pasting a font, the Edit menu will suddenly  
show Undo "Paste Font".
If the same app is running with German as the preferred language, the  
Edit menu will contain Undo "Schrift einsetzen" (yes, the "Undo" also  
gets translated, but this does not interest me at this point).


When I override this mechanism, doing my own undo handling I have to  
use setActionName: "Paste Font".

But this is only correct if the current language is English.

So I have to do: setActionName: NSLocalizedStringFromTable( @"Paste  
Font", @"UndoStrings",  @"setting font via menu Format → Font");


But this means that I have to create UndoStrings.strings files for  
about 15 languages, which is kind of tedious.
Also: If Apple decides that the correct translation for "Paste Font"  
should be "Schriftart einfügen" instead of "Schrift einsetzen", my  
app would look strange, using different words compared to all other  
apps.


So I want something like:  
NSLocalizedStringFrom_the_Table_used_by_the_System(..).

Or maby I could get at the official translations using NSDefaultManager?

These strings must be somewhere - so how to find them? Neither  
Spotlight nor grep seem to handle utf-16 files (like .strings).



Kind regards,

Gerriet.

___

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: test if another app has hung

2008-04-01 Thread Ben Dougall


On 1 Apr, 2008, at 11:49 am, Ron Fleckner wrote:



On 01/04/2008, at 9:28 PM, Ben Dougall wrote:

Hello,

What's the best way to test if another app has likely hung or not? 
Programmatically of course. I want to be able to kill an often 
hanging app and restart it -- when it's hung that is. (10.3.9+)


Thanks, Ben.



Hi Ben,

This question was exhaustively examined in a thread a few weeks ago.  
Start here: 



HTH,
Ron


Excellent, thanks for the pointer.
Ben.

___

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]


Exploring AppleScript APIs

2008-04-01 Thread Torsten Curdt

Hey,

There is a Cocoa application X that is Apple-scriptable.

Is there any way to find out what functions are supported ...except  
having proper documentation at hand?


Hope that's not too OT.

cheers
--
Torsten
___

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: Getting Localized System Strings

2008-04-01 Thread Jean-Daniel Dupas


The strings you are looking for are in the AppKit ressources, but I  
don't think there are part of the API, the keys can change at anytime  
and you cannot rely on the files names. (in Leopard, the Undo.strings  
file contains a "Paste Font" key, but it's not garantee that it remain  
like that)


Anyway, you can probably copy this Undo.strings file in your  
application.



Le 1 avr. 08 à 11:52, Gerriet M. Denkmann a écrit :
Cocoa uses (automatically) localized strings. I would like to do the  
same.


E.g. using NSTextView and pasting a font, the Edit menu will  
suddenly show Undo "Paste Font".
If the same app is running with German as the preferred language,  
the Edit menu will contain Undo "Schrift einsetzen" (yes, the "Undo"  
also gets translated, but this does not interest me at this point).


When I override this mechanism, doing my own undo handling I have to  
use setActionName: "Paste Font".

But this is only correct if the current language is English.

So I have to do: setActionName: NSLocalizedStringFromTable( @"Paste  
Font", @"UndoStrings",  @"setting font via menu Format → Font");


But this means that I have to create UndoStrings.strings files for  
about 15 languages, which is kind of tedious.
Also: If Apple decides that the correct translation for "Paste Font"  
should be "Schriftart einfügen" instead of "Schrift einsetzen", my  
app would look strange, using different words compared to all other  
apps.


So I want something like:  
NSLocalizedStringFrom_the_Table_used_by_the_System(..).
Or maby I could get at the official translations using  
NSDefaultManager?


These strings must be somewhere - so how to find them? Neither  
Spotlight nor grep seem to handle utf-16 files (like .strings).



Kind regards,

Gerriet.


___

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: test if another app has hung

2008-04-01 Thread Jean-Daniel Dupas


The Window Server considere that an App hangs when it does not process  
High Level events fast enought.
What do you mean by hang ? Is it a daemon that process background  
request but stop to responds?

Is it a graphical application that present a Spinning Wheel ?
Is it a third party app that you want to kill, or have you access to  
the sources ?



Le 1 avr. 08 à 12:28, Ben Dougall a écrit :


Hello,

What's the best way to test if another app has likely hung or not?  
Programmatically of course. I want to be able to kill an often  
hanging app and restart it -- when it's hung that is. (10.3.9+)


Thanks, Ben.

___

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: test if another app has hung

2008-04-01 Thread Ron Fleckner


On 01/04/2008, at 9:28 PM, Ben Dougall wrote:

Hello,

What's the best way to test if another app has likely hung or not?  
Programmatically of course. I want to be able to kill an often  
hanging app and restart it -- when it's hung that is. (10.3.9+)


Thanks, Ben.



Hi Ben,

This question was exhaustively examined in a thread a few weeks ago.   
Start here: 


HTH,
Ron
___

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: Saving NSManagedObject in Core-Data

2008-04-01 Thread Felix Franz

On 01.04.2008, at 02:03, malcom wrote:
This is what I've made (suppose you receive a data from a  
multithreaded socket).


1) You receive the packet
2) Put it into a temp array
3) When you reach a number x of messages you can call the save  
function


The save function repeats these statements for each packet from the  
array:

1) Perform insertObject in a second managedObject (connected to the
same persistent store)
2) Get the list of objectID of the object and save it to another array
3) When all packets was saved perform linkMessages function into main
thread passing the objectids array


According to  you can only pass ObjectIDs to another thread
if the managed objects were saved. I've never used saving in another  
object context,

I don't know if it is causing another headache ...

Maybe it is easier to just pass the data to the main thread and perform
the insertion only in the main context?

The recent thread  has

some interesting posts on this topic.


Cheers,

felix

___

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: Exploring AppleScript APIs

2008-04-01 Thread Jean-Daniel Dupas


Drop the application icon on the "Script Editor" Application. (in / 
Applications/AppleScript/)

It will open it's Scripting dictionary.

Le 1 avr. 08 à 13:34, Torsten Curdt a écrit :


Hey,

There is a Cocoa application X that is Apple-scriptable.

Is there any way to find out what functions are supported ...except  
having proper documentation at hand?


Hope that's not too OT.

cheers
--
Torsten
___

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]


Best Way to Replicate CURL in Cocoa?

2008-04-01 Thread Brad Gibbs

Hi,

I'm trying to communicate with a Linux-based device that sits on the  
local network from multiple Macs (also on the local network).   
Documentation for the Linux device claims that it provides an XML-RPC  
server and that it responds to SOAP requests.  However, XML-RPC and  
SOAP AppleScripts result in repeated failure.  "do shell script curl",  
however, works every time.  I suspect that the device doesn't actually  
respond to tree-based XML with tags, but it does respond when the full  
message (which consists of a method name and 0-5 parameters, depending  
on the method) are all posted in a single string.


Given this, I'm suspecting it responds to HTTP Posts, rather than XML- 
RPC or SOAP requests.  I've seen references to a Cocoa wrapper for  
curl, but they're from 2002.  Looking through Apple's documentation  
for a more up-to-date method for sending HTTP Posts, it appears that I  
could make HTTP Posts from CFNetwork (CFHTTPMessage with a POST  
method) or through NSURLRequest.  The strings I'll be sending will be  
less than 50 characters long.  The device will also be sending  
response strings of approximately the same length that will need to be  
parsed in the Cocoa app.  Again, it doesn't appear that the responses  
are XML (they're all in a single string, no tags).


Messaging to the device will be driven by button presses in the UI.  A  
single button press could invoke up to 5 or 6 messages at once, but  
the button presses will likely be infrequent.  A single instance of  
the app could be running on multiple machines, with each machine  
making requests to the device simultaneously.


Given this information, what would be the most efficient and robust  
method for sending HTTP Posts, CF Network, NSURLRequest or something  
completely different?


Thanks in advance.

Brad
___

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: Custom interface

2008-04-01 Thread colo
Is their no common toolkit like css for Cocoa GUI ?
Or hell just use css for building the apps interface? No a widget but
a real cocoa app.


On 3/31/08, John Stiles <[EMAIL PROTECTED]> wrote:
> Basically you get to rewrite all the controls from scratch :)
>
>  It's not a minor undertaking, so be sure it's worth the effort. Your
>  best bet is to look for open-source code which does what you want, since
>  there are already a ton of open-source Cocoa classes for custom UIs.
>
>  Also, be sure your customer knows what they are talking about. 3/4 of
>  custom UIs look and act really bad. Just looking different for the sake
>  of looking different is a sure-fire recipe for dissatisfied customers.
>
>
>
>  Mr. Gecko wrote:
>  > How would I make a custom interface as in making the buttons windows
>  > and process bar look different. I need this to give my customers a
>  > more clean interface.
>  > ___
>  >
>  > 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/jstiles%40blizzard.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/colo0logo%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: Getting Localized System Strings

2008-04-01 Thread Gerriet M. Denkmann


On 1 Apr 2008, at 12:25, Jean-Daniel Dupas wrote:


The strings you are looking for are in the AppKit ressources, but I  
don't think there are part of the API, the keys can change at  
anytime and you cannot rely on the files names. (in Leopard, the  
Undo.strings file contains a "Paste Font" key, but it's not  
garantee that it remain like that)


Anyway, you can probably copy this Undo.strings file in your  
application.



Le 1 avr. 08 à 11:52, Gerriet M. Denkmann a écrit :
Cocoa uses (automatically) localized strings. I would like to do  
the same.


E.g. using NSTextView and pasting a font, the Edit menu will  
suddenly show Undo "Paste Font".
If the same app is running with German as the preferred language,  
the Edit menu will contain Undo "Schrift einsetzen" (yes, the  
"Undo" also gets translated, but this does not interest me at this  
point).


When I override this mechanism, doing my own undo handling I have  
to use setActionName: "Paste Font".

But this is only correct if the current language is English.

So I have to do: setActionName: NSLocalizedStringFromTable 
( @"Paste Font", @"UndoStrings",  @"setting font via menu Format  
→ Font");


But this means that I have to create UndoStrings.strings files for  
about 15 languages, which is kind of tedious.
Also: If Apple decides that the correct translation for "Paste  
Font" should be "Schriftart einfügen" instead of "Schrift  
einsetzen", my app would look strange, using different words  
compared to all other apps.


So I want something like:  
NSLocalizedStringFrom_the_Table_used_by_the_System(..).
Or maby I could get at the official translations using  
NSDefaultManager?


Thanks a lot. I decided to use it like this:
NSBundle *appBundle = [ NSBundle bundleWithIdentifier:  
@"com.apple.AppKit" ];
NSString *localSetFont = [ appBundle localizedStringForKey: @"Set  
Font" value: nil table: @"Undo"];

Seems to work fine.

Kind regards,

Gerriet.

P.S. How can one paste into Mail without loosing all newlines?

___

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: NSView out of memory problem

2008-04-01 Thread Matt Gough


On 1 Apr 2008, at 14:40, Leslie Smith wrote:

 I'm sure I'm missing something.


Yes. An understanding of Autorelease pools (and presumably Cocoa  
memory management in general)


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

The unoptimal way to fix your memory usage would be:

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom]  ;
[p1 lineToPoint: linetop] ;
[p1 stroke] ;
[pool release];

Matt
___

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]


NSView out of memory problem

2008-04-01 Thread Leslie Smith

Hi:

I have a Cocoa application which draws a (very) large number of line  
segments using the code below in a loop, in drawRect, in a subclass  
of NSView.


p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom]  ;
[p1 lineToPoint: linetop] ;
[p1 stroke] ;

(These are the outputs from a neural network simulator.) I'm just  
using one NSView: if I draw a set of outputs, and then (later) draw  
another set of outputs (filling the rect with white in between), I  
eventually run out of memory. Clearly, I need to free up something  
but I really do not know what. (Well, I should probably create a new  
NSView each time, but I'd like a quicker fix.)


I tried [p1 release] ; after the code above, but that simply made the  
app crash.


I can't seem to find anywhere that tells me how to do this: it looks  
as though once I have drawn something in an NSView, using  
NSBezierPath, the memory used stays used. I'm sure I'm missing  
something.


--Leslie Smith


Professor Leslie S. Smith,
Dept of Computing Science and Mathematics,
University of Stirling,
Stirling FK9 4LA, Scotland
[EMAIL PROTECTED]
Tel (44) 1786 467435 Fax (44) 1786 464551
www http://www.cs.stir.ac.uk/~lss/
UKRI IEEE NNS Chapter Chair: http://www.cs.stir.ac.uk/ieee-nns-ukri/




--
The University of Stirling (a charity registered in Scotland, number
SCO11159) is a university established in Scotland by charter at Stirling,
FK9 4LA.  Privileged/Confidential Information may be contained in this
message.  If you are not the addressee indicated in this message (or
responsible for delivery of the message to such person), you may not
disclose, copy or deliver this message to anyone and any action taken or
omitted to be taken in reliance on it, is prohibited and may be unlawful.
In such case, you should destroy this message and kindly notify the sender
by reply email.  Please advise immediately if you or your employer do not
consent to Internet email for messages of this kind.


___

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: Exploring AppleScript APIs

2008-04-01 Thread Torsten Curdt

So simple! Thanks!! :)

On Apr 1, 2008, at 14:10, Jean-Daniel Dupas wrote:


Drop the application icon on the "Script Editor" Application. (in / 
Applications/AppleScript/)

It will open it's Scripting dictionary.

Le 1 avr. 08 à 13:34, Torsten Curdt a écrit :


Hey,

There is a Cocoa application X that is Apple-scriptable.

Is there any way to find out what functions are supported ...except  
having proper documentation at hand?


Hope that's not too OT.

cheers
--
Torsten
___

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: Getting Localized System Strings

2008-04-01 Thread Jean-Daniel Dupas


Le 1 avr. 08 à 14:47, Gerriet M. Denkmann a écrit :


On 1 Apr 2008, at 12:25, Jean-Daniel Dupas wrote:


The strings you are looking for are in the AppKit ressources, but I  
don't think there are part of the API, the keys can change at  
anytime and you cannot rely on the files names. (in Leopard, the  
Undo.strings file contains a "Paste Font" key, but it's not  
garantee that it remain like that)


Anyway, you can probably copy this Undo.strings file in your  
application.


Thanks a lot. I decided to use it like this:
NSBundle *appBundle = [ NSBundle bundleWithIdentifier:  
@"com.apple.AppKit" ];
NSString *localSetFont = [ appBundle localizedStringForKey: @"Set  
Font" value: nil table: @"Undo"];

Seems to work fine.

Kind regards,

Gerriet.


As I said, it works, but it's not futur-proof, so I would not use it  
in a shipping product.



___

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: Exploring AppleScript APIs

2008-04-01 Thread has

Torsten Curdt wrote:


On Apr 1, 2008, at 14:10, Jean-Daniel Dupas wrote:




There is a Cocoa application X that is Apple-scriptable.

Is there any way to find out what functions are supported ...except
having proper documentation at hand?


Drop the application icon on the "Script Editor" Application. (in /
Applications/AppleScript/)
It will open it's Scripting dictionary.



Some more options:

- ASDictionary  exports  
application dictionaries as plain text and HTML in AppleScript and  
appscript formats. A command line tool for viewing individual class/ 
command definitions and inheritance/relationship graphs is also  
included.


- Python and Ruby appscript both support interactive browsing of  
application dictionaries and object models from the command line. e.g.  
See  for a nice introduction.


- Late Night Software's commercial Script Debugger  provides a slick GUI-based interface for exploring application  
dictionaries and object models.



Be aware that application dictionaries do not, by themselves, provide  
sufficient information to control scriptable applications (a perennial  
bugbear). If the application vendor supplies supplementary  
documentation and example scripts, make use of it. If not (and most  
don't), expect to do some trial-and-error experimentation, and ask  
around the AppleScript community for help and examples. Oh, and file a  
feature request for more comprehensive documentation with the  
developer, of course.


Also, here's a few links of use:

http://lists.apple.com/mailman/listinfo/AppleScript-users/ -- main  
AppleScript mailing list

http://www.macscripter.net/ -- lots of third-party AppleScripts here
http://dougscripts.com/ -- lots of iTunes scripts here

Most AppleScripters aren't trained programmers so a lot of the code  
you'll encounter is less than brilliantly written. However, with a  
decade's worth of collective experience and code behind it, the  
AppleScript community is the primary source of knowledge and  
assistance for dealing with specific applications and related problems.


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.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 [EMAIL PROTECTED]


Re: Custom interface

2008-04-01 Thread Rob Keniger


On 01/04/2008, at 10:58 PM, colo wrote:

Is their no common toolkit like css for Cocoa GUI ?


No. This is largely because Mac applications are supposed to have a  
consistent user interface. You can read more about this in the Apple  
Human Interface Guidelines:


http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/

If you want controls with a custom look you have to modify or replace  
the existing controls.



Or hell just use css for building the apps interface? No a widget but
a real cocoa app.



You could make your application window contain one big WebKit view and  
make your application a hybrid web/Cocoa application. It would be more  
complex than a standard Cocoa app though.


--
Rob Keniger

___

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: NSView out of memory problem

2008-04-01 Thread Matthew Whillock
Blimey! I went to (most) of your lectures! Networks I think it was.  
Software Engineerng MSc 1985/6 or thereabouts...


Anyway, have you considered using +strokeLineFromPoint:toPoint:  
instead? No need for an NSBezierPath instance.


Cheers,
Matt

(Ok then, some of your lectures)


Hi:

I have a Cocoa application which draws a (very) large number of line
segments using the code below in a loop, in drawRect, in a subclass
of NSView.

p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom]  ;
[p1 lineToPoint: linetop] ;
[p1 stroke] ;

(These are the outputs from a neural network simulator.) I'm just
using one NSView: if I draw a set of outputs, and then (later) draw
another set of outputs (filling the rect with white in between), I
eventually run out of memory. Clearly, I need to free up something
but I really do not know what. (Well, I should probably create a new
NSView each time, but I'd like a quicker fix.)

I tried [p1 release] ; after the code above, but that simply made the
app crash.

I can't seem to find anywhere that tells me how to do this: it looks
as though once I have drawn something in an NSView, using
NSBezierPath, the memory used stays used. I'm sure I'm missing
something.

--Leslie Smith

--
Matthew Whillock
[EMAIL PROTECTED]

Mullard Space Science Laboratory
Holmbury St Mary
Surrey RH5 6NT
UK




___

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: NSView out of memory problem

2008-04-01 Thread Graham Cox
Are you sure? This could be just a convenient interface for creating a  
bezier object with the points passed, stroking it and releasing or  
autoreleasing it. The docs say nothing about how it's implemented.


A better idea might be to create ONE bezier object at the top of the  
loop, collect all the lines into it, then stroke it in one go after  
the loop terminates. I do this for drawing grids with many thousands  
of lines and have never hit a memory problem so far.


--
S.O.S.


On 2 Apr 2008, at 12:09 am, Jean-Daniel Dupas wrote:

Yes, an a better way to fix it will be to use a static method:

[NSBezierPath strokeLineFromPoint: linebottom  toPoint: linetop];

It will avoid creation of an object for each segment.


___

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: NSView out of memory problem

2008-04-01 Thread Jean-Daniel Dupas



Le 1 avr. 08 à 14:50, Matt Gough a écrit :


On 1 Apr 2008, at 14:40, Leslie Smith wrote:

I'm sure I'm missing something.


Yes. An understanding of Autorelease pools (and presumably Cocoa  
memory management in general)


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

The unoptimal way to fix your memory usage would be:

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom]  ;
[p1 lineToPoint: linetop] ;
[p1 stroke] ;
[pool release];

Matt


Yes, an a better way to fix it will be to use a static method:

[NSBezierPath strokeLineFromPoint: linebottom  toPoint: linetop];

It will avoid creation of an object for each segment.

___

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: NSView out of memory problem

2008-04-01 Thread Graham Cox


On 1 Apr 2008, at 11:40 pm, Leslie Smith wrote:

Hi:

I have a Cocoa application which draws a (very) large number of line  
segments using the code below in a loop, in drawRect, in a subclass  
of NSView.


p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom]  ;
[p1 lineToPoint: linetop] ;
[p1 stroke] ;

(These are the outputs from a neural network simulator.) I'm just  
using one NSView: if I draw a set of outputs, and then (later) draw  
another set of outputs (filling the rect with white in between), I  
eventually run out of memory. Clearly, I need to free up something  
but I really do not know what. (Well, I should probably create a new  
NSView each time, but I'd like a quicker fix.)


I tried [p1 release] ; after the code above, but that simply made  
the app crash.


I can't seem to find anywhere that tells me how to do this: it looks  
as though once I have drawn something in an NSView, using  
NSBezierPath, the memory used stays used. I'm sure I'm missing  
something.



An observation: this is about as inefficient as you can get for  
drawing a large number of lines.


Here's a few things I'd do:

1. do not construct the bezier path when you handle drawRect: - that  
method is called to draw the output, not create it.


2. use a bezier object to collect the output from the neural simulator  
when it runs. Keep the bezier object around by retaining it in an ivar  
of your view class. You can create the bezier object as part of your  
view's initWithFrame: method, if you like.


3. at the top of the loop, clear the bezier object using - 
removeAllPoints.


4. within the loop, use moveTo/lineTo to collect your output.

5. in your view's drawRect:, just draw - set up the drawing parameters  
(colours, line weight) and stroke the bezier path you made earlier. Do  
not release it, or do anything else. You can erase the background to  
white before stroking the path but note that you are drawing into the  
view, not changing the bezier path content. (Think of your bezier  
object as storing the graphical output from your simulator in a form  
that can later be drawn directly into the view).


6. Certainly you will never be recreating views each time you draw,  
that's simply wrong. Views typically stick around, and in this case, I  
believe your bezier object should too.


7. If you rework your code to do it this way, not only will you not  
run into memory problems, but you should see a dramatic boost in speed  
too.



--
S.O.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]


Re: NSView out of memory problem

2008-04-01 Thread Gorazd Krosl
Hi Leslie,

NSView does not store any drawing. If the code bellow
is
executed in the loop as you are indicating and
possibly several thousand times, each time through the
loop you are creating a new autoreleased NSBezierPath.
If this is the case, you should include
NSAutoreleasePool and drain or free it every so often;
maybe every 100 iterations, to  get rid of accumulated
NSBezierPaths.

Hope that helps.
Gorazd

>p1 = [NSBezierPath bezierPath] ;
>[p1 moveToPoint: linebottom] ;
>[p1 lineToPoint: linetop] ; [p1 stroke] ; 


  __
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot 
with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail 
today or register for free at http://mail.yahoo.ca
___

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: Custom interface

2008-04-01 Thread colo
Thats silly. eh' i'm not going to argue I have no need to just yet, I
still need to learn the detailed basics. But what of using opengl for
the gui then? The Blender app utilizes this to the effect.

On 4/1/08, Rob Keniger <[EMAIL PROTECTED]> wrote:
>
>  On 01/04/2008, at 10:58 PM, colo wrote:
>  > Is their no common toolkit like css for Cocoa GUI ?
>
>
> No. This is largely because Mac applications are supposed to have a
>  consistent user interface. You can read more about this in the Apple
>  Human Interface Guidelines:
>
>  
> http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/
>
>  If you want controls with a custom look you have to modify or replace
>  the existing controls.
>
>
>  > Or hell just use css for building the apps interface? No a widget but
>  > a real cocoa app.
>
>
>
> You could make your application window contain one big WebKit view and
>  make your application a hybrid web/Cocoa application. It would be more
>  complex than a standard Cocoa app though.
>
>  --
>
> Rob Keniger
>
>
>  ___
>
>  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/colo0logo%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: NSView out of memory problem

2008-04-01 Thread Jean-Daniel Dupas


Yes, I am. The doc says nothing but  according to the assembly form of  
this method, it do something like this:


CGContextBeginPath()
CGContextMoveToPoint()
CGContextAddLineToPoint()
CGContextStrokePath()

Most of NSBezier method are just simple wrappers upon CoreGraphics  
equivalent.


An other way is to use CG directly. You can get the graphic context  
using


CGContextRef ctxt = [[NSGraphicsContext currentContext] graphicPort];


Le 1 avr. 08 à 15:17, Graham Cox a écrit :
Are you sure? This could be just a convenient interface for creating  
a bezier object with the points passed, stroking it and releasing or  
autoreleasing it. The docs say nothing about how it's implemented.


A better idea might be to create ONE bezier object at the top of the  
loop, collect all the lines into it, then stroke it in one go after  
the loop terminates. I do this for drawing grids with many thousands  
of lines and have never hit a memory problem so far.


--
S.O.S.


On 2 Apr 2008, at 12:09 am, Jean-Daniel Dupas wrote:

Yes, an a better way to fix it will be to use a static method:

[NSBezierPath strokeLineFromPoint: linebottom  toPoint: linetop];

It will avoid creation of an object for each segment.





___

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: Network notifications

2008-04-01 Thread Randall Meadows

On Apr 1, 2008, at 2:35 AM, Hamish Allan wrote:

On Tue, Apr 1, 2008 at 5:03 AM, Jens Alfke <[EMAIL PROTECTED]> wrote:


You want to set a TXT record for the service.


I disagree. If the updates are frequent, this makes a lot of work for
every other machine on the LAN to update their mDNSResponder caches.
Randall mentioned that there's really only going to be one listener,
so why make it everyone else's problem?


Actually, in practice, it won't (or shouldn't) be SEPs.  These apps  
are designed to run on a computer-to-computer network (via the Airport  
menu bar widget "Create Network"), and if anyone else is one that  
network, well, they shouldn't be, and any problems encountered are  
their fault. :)


And yes, we're taking measures to prevent unauthorized users from  
gathering my data...


I had actually started looking into the TXT record stuff yesterday,  
trying to understand it...thanks for the confirmation.



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: Custom interface

2008-04-01 Thread John Stiles
If you want to use OpenGL for your GUI, that's always an option, but 
again you're on your own here. Cocoa provides very little support for 
this (outside of the generic NSOpenGLView).


Honestly I think most people don't appreciate how much stuff you get 
"for free" in Cocoa, but you learn pretty fast when you get to 
reimplement it yourself! :)



colo wrote:

Thats silly. eh' i'm not going to argue I have no need to just yet, I
still need to learn the detailed basics. But what of using opengl for
the gui then? The Blender app utilizes this to the effect.

On 4/1/08, Rob Keniger <[EMAIL PROTECTED]> wrote:
  

 On 01/04/2008, at 10:58 PM, colo wrote:
 > Is their no common toolkit like css for Cocoa GUI ?


No. This is largely because Mac applications are supposed to have a
 consistent user interface. You can read more about this in the Apple
 Human Interface Guidelines:

 
http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/

 If you want controls with a custom look you have to modify or replace
 the existing controls.


 > Or hell just use css for building the apps interface? No a widget but
 > a real cocoa app.



You could make your application window contain one big WebKit view and
 make your application a hybrid web/Cocoa application. It would be more
 complex than a standard Cocoa app though.

 --

Rob Keniger


 ___

 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/colo0logo%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/jstiles%40blizzard.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: Custom interface

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 6:52 AM, colo wrote:


Thats silly. eh' i'm not going to argue I have no need to just yet, I
still need to learn the detailed basics. But what of using opengl for
the gui then? The Blender app utilizes this to the effect.


You can create any kind of UI you want — look at all the games out  
there. Use custom NSViews, or Core Animation or OpenGL or whatever.  
It's just that AppKit isn't going to help you, because custom UIs  
aren't part of the Mac human interface.


Basically, rather than give you lots of different cheesy themes for  
making bad UIs, Cocoa gives you one theme for making really good ones.


If that sounds restrictive, just think of it as Apple's way of  
protecting you from the derisive laughter of Mac reviewers and users.  
Take a look at popular and well-reviewed Mac apps (aside from games)  
and note the consistency of their user interfaces. They do tend to  
have a few custom controls, but in a good app they're there for a  
reason and fit in with Apple's general HI guidelines.


Then compare this with Flash websites, where it seems like no  
programmer or designer can even get a simple scrollbar to work right.


—Jens


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: Custom interface

2008-04-01 Thread I. Savant
>  Honestly I think most people don't appreciate how much stuff you get
>  "for free" in Cocoa, but you learn pretty fast when you get to
>  reimplement it yourself! :)

  True, but there are many legitimate reasons not to use a standard
UI. FrontRow is a prime example of this. A kiosk application would be
another. If these are the kinds of things the OP interested in doing,
he should take a look at Quartz Composer. It would be far easier than
a straight shot of OpenGL for UI interaction.

  That said, this entire conversation would probably be far more
productive if the OP would explain what he means by "more clean
interface". What's wrong with a standard Cocoa interface for your
project? What IS your project? Be specific.

  If you're suggesting making a plain desktop application with a
completely nonstandard interface, you'll get little support here -
it's a very VERY bad idea and "more clean" is a poor excuse for doing
this. That's like creating a clunky Microsoft Access database as your
CRM system and claiming "because it's cleaner".

  ... right.

  Of course we don't know what the requirements are. You may have a
perfectly valid reason but customizing AppKit might be a perfectly
poor choice ... The best thing to do - as I said - is to explain what
you are trying to accomplish and why Cocoa UI isn't right for the
project. If you do that, list members can actually give meaningful
suggestions.

--
I.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]


Re: NSView out of memory problem

2008-04-01 Thread Matthew Whillock

The class reference has this to say about it:

Strokes a line between two points using the current stroke color and  
the default drawing attributes.

+ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2


So it will just draw a line.

Cheers,
Matt



Are you sure? This could be just a convenient interface for creating a
bezier object with the points passed, stroking it and releasing or
autoreleasing it. The docs say nothing about how it's implemented.

A better idea might be to create ONE bezier object at the top of the
loop, collect all the lines into it, then stroke it in one go after
the loop terminates. I do this for drawing grids with many thousands
of lines and have never hit a memory problem so far.

--
S.O.S.


On 2 Apr 2008, at 12:09 am, Jean-Daniel Dupas wrote:

Yes, an a better way to fix it will be to use a static method:

[NSBezierPath strokeLineFromPoint: linebottom  toPoint: linetop];

It will avoid creation of an object for each segment.




--
Matthew Whillock
[EMAIL PROTECTED]

Mullard Space Science Laboratory
Holmbury St Mary
Surrey RH5 6NT
UK




___

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: Network notifications

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 1:35 AM, Hamish Allan wrote:


I disagree. If the updates are frequent, this makes a lot of work for
every other machine on the LAN to update their mDNSResponder caches.


If they're updating every second, then yes, TXT records would be  
inappropriate. But Randall didn't say whether the updates were that  
frequent.



Randall mentioned that there's really only going to be one listener,
so why make it everyone else's problem?


Did he? In the original message he says "remote apps" (plural). When I  
hear "notification", I think of a to-many broadcast, not a point-to- 
point message.


—Jens

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]

Alternating Button

2008-04-01 Thread Gerriet M. Denkmann
The FindPanel in TextEdit has in the bottom left corner a button  
"Replace All" which changes to "In Selection" when the ⌥-key is  
pressed.


How is this done? I want to have such a changing button in some of my  
own panels.


Kind regards,

Gerriet.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Using UNCs with NSURLConnection

2008-04-01 Thread Valentin Dan
Hi,

 

I’d like to know if there’s any way to use a UNC path with a NSURLConnection 
object ? Can the UNC perhaps be transformed in a NSURL ?

 

Or is there another way to get a remote file from a server that requires 
authentication if I only have the file’s UNC ?

 

Thanks !

 

___

Valentin Dan, Software Developer Direct: +1 905 886 1833 
ext.3047   

Email: HYPERLINK "mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED] 
Office: +40 356-710158

Masstech Group Inc.  Fax:+40 256-220912

HYPERLINK "http://www.masstechgroup.com/"http://www.masstechgroup.com 

 

THIS MESSAGE IS INTENDED ONLY FOR THE ADDRESSEE. IT MAY CONTAIN PRIVILEGED OR 
CONFIDENTIAL INFORMATION.ANY UNAUTHORIZED DISCLOSURE IS STRICTLY PROHIBITED.IF 
YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE NOTIFY US IMMEDIATELY SO THAT 
WE MAY CORRECT THE RECORDS. PLEASE THEN DELETE THE ORIGINAL MESSAGE. THANK YOU.

 

 

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.2/1353 - Release Date: 31.03.2008 
18:21
 
___

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: Best Way to Replicate CURL in Cocoa?

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 5:39 AM, Brad Gibbs wrote:

Given this, I'm suspecting it responds to HTTP Posts, rather than  
XML-RPC or SOAP requests.


But both those protocols do use HTTP POSTs. (XML-RPC can use alternate  
transports, but in practice it's almost always over HTTP.)


I've seen references to a Cocoa wrapper for curl, but they're from  
2002.  Looking through Apple's documentation for a more up-to-date  
method for sending HTTP Posts, it appears that I could make HTTP  
Posts from CFNetwork (CFHTTPMessage with a POST method) or through  
NSURLRequest.


Pretty much every Cocoa app that does HTTP uses NSURLRequest. It's  
definitely the way to go for what you're doing. Create a mutable one,  
then use its HTTP-specific setters to configure the method and headers  
and set a body.


—Jens

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: NSView out of memory problem

2008-04-01 Thread Andre Schnoor





p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom] ;
[p1 lineToPoint: linetop] ; [p1 stroke] ;





You could keep a permanent bezier path at a convenient location (e.g.  
your view) and empty it instead of releasing it. This worked fine for  
my app:


[localPath removeAllPoints];
[localPath moveToPoint: linebottom];
[localPath lineToPoint: linetop];
[localPath stroke];

This is btw. even slightly faster than allocating a new one.

Andre

___

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: Network notifications

2008-04-01 Thread Randall Meadows

On Apr 1, 2008, at 9:13 AM, Jens Alfke wrote:

On 1 Apr '08, at 1:35 AM, Hamish Allan wrote:


I disagree. If the updates are frequent, this makes a lot of work for
every other machine on the LAN to update their mDNSResponder caches.


If they're updating every second, then yes, TXT records would be  
inappropriate. But Randall didn't say whether the updates were that  
frequent.


I would expect maybe 5-10 over a 2-3 minute period, and then a  
downtime of about the same; lather, rinse, repeat for several hours at  
a time.  Does that fall within some definition of "frequent"?



Randall mentioned that there's really only going to be one listener,
so why make it everyone else's problem?


Did he? In the original message he says "remote apps" (plural). When  
I hear "notification", I think of a to-many broadcast, not a point- 
to-point message.


Yes, currently in practice it'll probably be one-to-one, but I'm  
writing for the future possibilities.

___

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: Alternating Button

2008-04-01 Thread Jean-Daniel Dupas
I dont think there is an automatic way to have it (except for menu),  
but you can have a look at the flagsChanged: event


Le 1 avr. 08 à 17:24, Gerriet M. Denkmann a écrit :

The FindPanel in TextEdit has in the bottom left corner a button  
"Replace All" which changes to "In Selection" when the ⌥-key is  
pressed.


How is this done? I want to have such a changing button in some of  
my own panels.


Kind regards,

Gerriet.

___

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: Alternating Button

2008-04-01 Thread Jean-Daniel Dupas

Sorry for the previous unfinished message.

I dont think there is an automatic way to have it (except for menu  
items), but you can have a look at the flagsChanged: method of  
NSResponder.



Le 1 avr. 08 à 17:24, Gerriet M. Denkmann a écrit :
The FindPanel in TextEdit has in the bottom left corner a button  
"Replace All" which changes to "In Selection" when the ⌥-key is  
pressed.


How is this done? I want to have such a changing button in some of  
my own panels.


Kind regards,

Gerriet.

___

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: Best Way to Replicate CURL in Cocoa?

2008-04-01 Thread Brad Gibbs

Thanks for the reply.



On Apr 1, 2008, at 8:51 AM, Jens Alfke wrote:



On 1 Apr '08, at 5:39 AM, Brad Gibbs wrote:

Given this, I'm suspecting it responds to HTTP Posts, rather than  
XML-RPC or SOAP requests.


But both those protocols do use HTTP POSTs. (XML-RPC can use  
alternate transports, but in practice it's almost always over HTTP.)


Fair point.  I didn't use the correct terminology (which stems from  
the fact that I'm stumbling around a bit while learning this).  I  
think it's more accurate to say that the device doesn't respond well  
to the tags in XML-RPC or SOAP.  It does better with a single string.





I've seen references to a Cocoa wrapper for curl, but they're from  
2002.  Looking through Apple's documentation for a more up-to-date  
method for sending HTTP Posts, it appears that I could make HTTP  
Posts from CFNetwork (CFHTTPMessage with a POST method) or through  
NSURLRequest.


Pretty much every Cocoa app that does HTTP uses NSURLRequest. It's  
definitely the way to go for what you're doing. Create a mutable  
one, then use its HTTP-specific setters to configure the method and  
headers and set a body.


—Jens


___

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: Network notifications

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 8:25 AM, Randall Meadows wrote:

If they're updating every second, then yes, TXT records would be  
inappropriate. But Randall didn't say whether the updates were that  
frequent.


I would expect maybe 5-10 over a 2-3 minute period, and then a  
downtime of about the same; lather, rinse, repeat for several hours  
at a time.  Does that fall within some definition of "frequent"?


I'd say that's reasonable, if there won't be a lot of machines  
publishing this kind of stuff at once on the same subnet.


The only actual case I've seen where Bonjour traffic became a problem  
was on Apple's campus networks, after 10.2 shipped. That was a  
combination of very large subnets with hundreds of machines, most of  
them running iChat, and some inefficiencies in the original mDNS  
implementation that were then addressed in 10.3.


Yes, currently in practice it'll probably be one-to-one, but I'm  
writing for the future possibilities.


Using TXT records is still a lot easier than anything else you could  
do. In the spirit of "Do The Simplest Thing That Could Possibly  
Work",  try it this way first. If it causes any problems, you could re- 
implement it using a TCP socket that the publisher sends notifications  
over, or something like that.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Using UNCs with NSURLConnection

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 8:42 AM, Valentin Dan wrote:

I’d like to know if there’s any way to use a UNC path with a  
NSURLConnection object ? Can the UNC perhaps be transformed in a  
NSURL ?


I had to look up UNC on Wikipedia; I think what you're talking about  
is a type of path string used on Windows to identify resources on a  
network?


http://en.wikipedia.org/wiki/Path_%28computing%29#Uniform_Naming_Convention

The issue here isn't the syntax, it's the protocol. Since this is from  
Windows, I'd guess that resolving a UNC involves some combination of  
ActiveDirectory to locate resources on the network, and SMB to access  
the files. Mac OS X has some support for ActiveDirectory (via  
OpenDirectory APIs) and SMB (presumably using Unix system calls to  
mount filesystems).


But I'm pretty certain that, even if you could map a UNC into a URL,  
NSURLConnection doesn't support the URL schemes needed to access it.  
Out of the box it basically supports http:, https:, ftp: and file:.


You could try some web-searching to see if anyone else has written Mac  
code to work with UNCs.


—Jens

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: Question on bitmap fonts

2008-04-01 Thread Aki Inoue

From the look of it, I think there is floating-point rounding involved.

After all, the graphics system is treating it as a scalable font so  
the notion of bitmap (or pixel-based) font design doesn't apply.


Aki

On 2008/04/01, at 9:48, Tobia Conforto wrote:


Thank you!
I hadn't thought of using gdb :-)

Now I only need to understand why y = -2.6643 instead of  
-2.6651



Tobia


On 1 Apr 2008, at 18:36, Aki Inoue wrote:

This is the information returned from the font.

(gdb) p glyphBBox
$30 = {
origin = {
  x = 0,
  y = -2.6643
},
size = {
  width = 6,
  height = 12
}
}

(gdb) p ascender
$31 = 9.3302
(gdb) p descender
$32 = 2.6651
(gdb) p 12 - 2.6643
$33 = 9.33569996

The bounding box is for Capital Letter A with grave accent.  As you  
can see, it's too close and sticking out a little.


Aki


___

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: Question on bitmap fonts

2008-04-01 Thread John Stiles
If it's rounding, that would be pretty severe. I'd expect at least 6 or 
7 viable digits.


Aki Inoue wrote:


From the look of it, I think there is floating-point rounding involved.

After all, the graphics system is treating it as a scalable font so 
the notion of bitmap (or pixel-based) font design doesn't apply.


Aki

On 2008/04/01, at 9:48, Tobia Conforto wrote:


Thank you!
I hadn't thought of using gdb :-)

Now I only need to understand why y = -2.6643 instead of -2.6651


Tobia


On 1 Apr 2008, at 18:36, Aki Inoue wrote:

This is the information returned from the font.

(gdb) p glyphBBox
$30 = {
origin = {
  x = 0,
  y = -2.6643
},
size = {
  width = 6,
  height = 12
}
}

(gdb) p ascender
$31 = 9.3302
(gdb) p descender
$32 = 2.6651
(gdb) p 12 - 2.6643
$33 = 9.33569996

The bounding box is for Capital Letter A with grave accent.  As you 
can see, it's too close and sticking out a little.


Aki


___

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/jstiles%40blizzard.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: Question on bitmap fonts

2008-04-01 Thread Tobia Conforto

Thank you!
I hadn't thought of using gdb :-)

Now I only need to understand why y = -2.6643 instead of -2.6651


Tobia


On 1 Apr 2008, at 18:36, Aki Inoue wrote:

This is the information returned from the font.

(gdb) p glyphBBox
$30 = {
 origin = {
   x = 0,
   y = -2.6643
 },
 size = {
   width = 6,
   height = 12
 }
}

(gdb) p ascender
$31 = 9.3302
(gdb) p descender
$32 = 2.6651
(gdb) p 12 - 2.6643
$33 = 9.33569996

The bounding box is for Capital Letter A with grave accent.  As you  
can see, it's too close and sticking out a little.


Aki

___

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]


ERROR: __CFURLCache::StepSQLStatement

2008-04-01 Thread Kimo
I randomly get the following error message when using my Core Data app  
that uses a SQLite store:


ERROR: __CFURLCache::StepSQLStatement - step failed (exceed retry) -  
ErrCode: 5


No exceptions are thrown, and nothing else (that I'm aware of) seems  
to be effected by this error.  Does anyone know what this error  
means?  Should I correct it or not worry about it?


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]


CoreAnimation with and manual animation...

2008-04-01 Thread Jesse Grosjean
I'd like to create something like a spaceship with core animation.  
That is the object should be animated on screen, but it's velocity  
will always be changing. Because of this I'm not sure if using core  
animations build in animation system makes sense, because it seems  
like most of those animations are mean to be pre-planned from point a  
to point b.


In my app it seems like it would be simpler to just setup a timer and  
just directly update the ships position based on it's velocity for  
each time interval from my timer. I'd still want to use the built in  
core animation animations for other properties such as transparency,  
filters, etc. But for layer position it seems like it would be easiest  
to control that directly...


So my question is does that seem like a sensible approach, or is there  
some aspect of core animation that I'm just not understanding? At the  
moment I haven't done much programming, just reading through the docs  
and trying to figure the best way to approach the problem.


I guess the my question really is, what's the best way to animate a  
layer who's velocity is changing based on user input?


Thanks,
Jesse
___

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: ERROR: __CFURLCache::StepSQLStatement

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 10:22 AM, Kimo wrote:

ERROR: __CFURLCache::StepSQLStatement - step failed (exceed retry) -  
ErrCode: 5


That's an internal error from CFNetwork's URL cache (which happens to  
use a sqlite database.) Nothing to do with CoreData.


—Jens

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: Getting Localized System Strings

2008-04-01 Thread Gary L. Wade
>
>Thanks a lot. I decided to use it like this:
>NSBundle *appBundle = [ NSBundle bundleWithIdentifier:  
>@"com.apple.AppKit" ];
>NSString *localSetFont = [ appBundle localizedStringForKey: @"Set  
>Font" value: nil table: @"Undo"];
>Seems to work fine.
>

That's really not a good thing to do unless Apple has documented those keys, 
and I don't recall reading anywhere that they have; if they haven't, you should 
submit a bug for them if you want them to remain where they are for the next 
release, and you probably should just say, "Give us some keys for common UI 
text and where they were, are, and will be, so we can rely on those like you 
have for icons."

A better solution without official documentation is to see if the strings you 
want are provided with AppleGlot's installation.  I remember a large number of 
strings like these were made available in its dictionaries.  Also, there used 
to be a place on Microsoft's site that had a similar set of dictionaries for 
your use, but I've lost track of the link.  And, depending on your favorite 
open source project's license, you might be able to use 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]


Fixing my massive memory leak with NSImage/CALayer

2008-04-01 Thread Nathan Vander Wilt
I want to pop up photographs inside their own Core Animation layers,  
but I get huge real memory usage that never goes down.


I have an FRPhoto class whose instances manage other metadata for the  
image, and also have a convenience method to get an NSImage* as follows:


- (NSImage*)image {
if (!cachedImage) {
cachedImage = [[NSImage alloc] initByReferencingFile:filename];
}
return cachedImage;
}

...which I use to show the photo, in my view's method:

- (void)showPhoto:(FRPhoto*)photo {
CALayer* layer = [CALayer layer];
	CGImageRef image = photo image] representations] objectAtIndex:0]  
CGImage];

layer.contents = (id)image;
layer.frame = CGRectMake(0.0f, 0.0f, 50.0f, 50.0f);
layer.contentsGravity = kCAGravityResizeAspect;
[interactionLayer addSublayer:layer];
[layersForPhotos setObject:layer forKey:photo];
}

To put the FRPhoto into the layersForPhotos dictionary, I just  
implemented a lazy retained "copy":


- (id)copyWithZone:(NSZone*)zone {
(void)zone;
return [self retain];
}

These FRPhoto instances are kept basically indefinitely, so when I  
hide the photo (also in the view) I make sure to call -[NSImage  
recache]:


- (void)hidePhoto:(FRPhoto*)photo {
CALayer* layer = [layersForPhotos objectForKey:photo];
[layersForPhotos removeObjectForKey:photo];
[layer removeFromSuperlayer];
layer.contents = nil;
[[photo image] recache];
}


So by my reckoning: The CALayer should be autoreleased. And its  
contents, too, were supposed to be an autoreleased CGImage, and I set  
that property to nil just in case the layer itself is somehow sticking  
around. The NSImage that my FRPhoto holds on to should have  
"invalidate[d] and free[d] the offscreen caches of all image  
representations". But yet my memory usage just goes up and up and up,  
every photo I view. Images I have looked at already pop right back up,  
so they definitely act like they're still cached somewhere.


Even after many non-photo-showing event cycles, or just leaving it be  
for a few minutes, absolutely no significant amount of memory has been  
released according to both Instruments' ObjectAlloc and the Activity  
Monitor. By the time I've look at a dozen images my RAM is totally  
overwhelmed, making iPhoto's 15 second beachballs every couple minutes  
look pretty attractive, compared to total system-wide gridlock.


What am I doing wrong? How can I get these images out of memory?

thanks,
-natevw

___

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]


PDF file in NSTextAttachment

2008-04-01 Thread fred . redcliffe

Dear all

I am trying to add a pdf image to an NSTextAttachment.

I create a file wrapper from a pdf image on disk and insert it into my  
textstorage, with no problem, which draws fine on screen but then when  
I want to print the document it draws the image at low resolution.  
Also when the text is copied into another text editor such as TextEdit  
it is fine on screen but also prints at low resolution. However taking  
it into Pages seems to work fine and it prints at high resolution.  
Experimenting, I have found that Pages does not at all behave like a  
standard NSTextView which is a bit of a pain as it is difficult to  
create consistency between different applications, but that is another  
story.


For now can anybody help me with a way to get a text attachment form a  
pdf file to draw at high res when printing.


Thanks

fred


___

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: PDF file in NSTextAttachment

2008-04-01 Thread Douglas Davidson


On Apr 1, 2008, at 11:33 AM, [EMAIL PROTECTED] wrote:


I am trying to add a pdf image to an NSTextAttachment.

I create a file wrapper from a pdf image on disk and insert it into  
my textstorage, with no problem, which draws fine on screen but then  
when I want to print the document it draws the image at low  
resolution. Also when the text is copied into another text editor  
such as TextEdit it is fine on screen but also prints at low  
resolution. However taking it into Pages seems to work fine and it  
prints at high resolution. Experimenting, I have found that Pages  
does not at all behave like a standard NSTextView which is a bit of  
a pain as it is difficult to create consistency between different  
applications, but that is another story.


For now can anybody help me with a way to get a text attachment form  
a pdf file to draw at high res when printing.


File a bug, but depending on the result you want, you can in your own  
application set a custom text attachment cell for your attachment with  
any image you wish, or even use a custom cell subclass to do arbitrary  
drawing.


Douglas Davidson

___

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: ERROR: __CFURLCache::StepSQLStatement

2008-04-01 Thread Bill


On Apr 1, 2008, at 10:45 AM, Jens Alfke wrote:



On 1 Apr '08, at 10:22 AM, Kimo wrote:

ERROR: __CFURLCache::StepSQLStatement - step failed (exceed retry)  
- ErrCode: 5


That's an internal error from CFNetwork's URL cache (which happens  
to use a sqlite database.) Nothing to do with CoreData.


—Jens


Is my app causing it to happen?  If so, should I try and correct it?   
Or can I safely ignore it?

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]


KVO question on Tree Controllers

2008-04-01 Thread Jeff LaMarche
I've registered to receive notifications from an NSTreeController  
instance loaded from a nib, like so:


[treeController addObserver:self
forKeyPath:@"selection"
options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
context:NULL];

I've also tried using @"selectedObjects" rather than @"selection". Now  
this notifies me when the selection changes, except it doesn't notify  
me if the user clicked somewhere resulting in an empty selection, nor  
when the selection is currently empty and the user selects on the same  
object that was previously selected.


I need to know when the selection becomes empty, not just when it  
changes from one node to another node. Is there another keyPath or  
notification I can register for that will do that?


TIA,
Jeff

___

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: Alternating Button

2008-04-01 Thread Gerriet M. Denkmann


On 1 Apr 2008, at 18:16, Jean-Daniel Dupas wrote:


I dont think there is an automatic way to have it (except for menu  
items), but you can have a look at the flagsChanged: method of  
NSResponder.


Le 1 avr. 08 à 17:24, Gerriet M. Denkmann a écrit :
The FindPanel in TextEdit has in the bottom left corner a button  
"Replace All" which changes to "In Selection" when the ⌥-key is  
pressed.


How is this done? I want to have such a changing button in some of  
my own panels.


Well, I did have a look at the flagsChanged: method of NSResponder.

My window has the following responder chain:

//  field editor of myTextField
<_NSKeyboardFocusClipView: 0x6b5920>
   //  myTextField
//  contentView
   //  window
(Mail.app did again eat all newlines when I pasted the text above.  
How can this be avoided? This kind of starts to get annoying.)


Now the question: where to override flagsChanged: ?
Or subclass NSPanel and override sendEvent ?
Or put a subclass of NSResponder on top of the responder chain? How  
to keep it there (overriding makeFirstResponder in NSWindow?)



Kind regards,

Gerriet.

___

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]


Need for a creator code?

2008-04-01 Thread Marc Respass

Hi All,

I haven't registered for a creator code since System 7.5. Apple has  
information and registration page (http://developer.apple.com/datatype/index.html 
) about it but no indication if it's actually still required. Can  
anyone tell me if it is still required or maybe point me at the right  
information?


Thanks a lot
Marc
___

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: Need for a creator code?

2008-04-01 Thread Ricky Sharp


On Apr 1, 2008, at 2:59 PM, Marc Respass wrote:


Hi All,

I haven't registered for a creator code since System 7.5. Apple has  
information and registration page (http://developer.apple.com/datatype/index.html 
) about it but no indication if it's actually still required. Can  
anyone tell me if it is still required or maybe point me at the  
right information?



Here's a FAQ, but it's kinda vague on the "why":



While not required, you can still use creator codes for your  
documents.  I do this myself as well as to provide an extension.  It's  
useful to disambiguate cases where your app works with files that have  
a common extension.  Those files created by your app can have the  
proper creator code set on them.  Otherwise, users may need to  
manually specify what app to open the document.


I also know that you're still required to register a creator code for  
at least one other thing (cannot think of it now).  Bonjour service?   
I know I recently saw this on some page of the developer site; it  
reminded you to register a creator code for some reason.


I think it may also useful when dealing with Apple Events.  Though  
that may only be needed when working with events at a lower level?   
The high-level Cocoa APIs may not need such info.


___
Ricky A. Sharp mailto:[EMAIL PROTECTED]
Instant Interactive(tm)   http://www.instantinteractive.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: Need for a creator code?

2008-04-01 Thread Marc Respass

On Apr 1, 2008, at 4:22 PM, Ricky Sharp wrote:


On Apr 1, 2008, at 2:59 PM, Marc Respass wrote:


Hi All,

I haven't registered for a creator code since System 7.5. Apple has  
information and registration page (http://developer.apple.com/datatype/index.html 
) about it but no indication if it's actually still required. Can  
anyone tell me if it is still required or maybe point me at the  
right information?



Here's a FAQ, but it's kinda vague on the "why":



While not required, you can still use creator codes for your  
documents.  I do this myself as well as to provide an extension.   
It's useful to disambiguate cases where your app works with files  
that have a common extension.  Those files created by your app can  
have the proper creator code set on them.  Otherwise, users may need  
to manually specify what app to open the document.


I also know that you're still required to register a creator code  
for at least one other thing (cannot think of it now).  Bonjour  
service?  I know I recently saw this on some page of the developer  
site; it reminded you to register a creator code for some reason.


I think it may also useful when dealing with Apple Events.  Though  
that may only be needed when working with events at a lower level?   
The high-level Cocoa APIs may not need such info.


Thanks Ricky. Good info. I'll register.

Marc
___

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: Need for a creator code?

2008-04-01 Thread Andrew Farmer

On 01 Apr 08, at 12:59, Marc Respass wrote:
I haven't registered for a creator code since System 7.5. Apple has  
information and registration page (http://developer.apple.com/datatype/index.html 
) about it but no indication if it's actually still required. Can  
anyone tell me if it is still required or maybe point me at the  
right information?


Type and creator codes have been deprecated since Tiger, which  
introduced UTIs. (Maybe even longer; I'm not sure.) Either way, you  
can safely forget they ever existed.


I'm just surprised that page is still active.
___

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: Need for a creator code?

2008-04-01 Thread Jeff LaMarche


On Apr 1, 2008, at 4:22 PM, Ricky Sharp wrote:

Here's a FAQ, but it's kinda vague on the "why":




Not only are they vague, they refer you to documents that are marked  
as "legacy".  I was actually surprised to see they left creator codes  
in Xcode 3. 
___


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]


[Meeting] Toronto Area Cocoa and WebObjects Developer Group - April 8

2008-04-01 Thread Karl Moskowski
The next meeting of tacow / Cocoaheads Toronto will be held on  
Tuesday, April 8 at 6:30 PM at Ryerson University.


Apple's Steve Hayman will be talking about the iPhone SDK.

More info and directions are available at .

Thanks and see you there.


Karl Moskowski <[EMAIL PROTECTED]>
Voodoo Ergonomics Inc. 

___

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: Custom interface

2008-04-01 Thread Ricky Sharp


On Apr 1, 2008, at 10:13 AM, I. Savant wrote:


 Of course we don't know what the requirements are. You may have a

perfectly valid reason but customizing AppKit might be a perfectly
poor choice ... The best thing to do - as I said - is to explain what
you are trying to accomplish and why Cocoa UI isn't right for the
project. If you do that, list members can actually give meaningful
suggestions.



Well said.

And, if choosing to do your own UI (I did this for my "math drills"  
app for kids), be aware that the following can add quite a bit of  
additional work:


- accessibility
- resolution independence
- potential need for IB palettes/plug-ins

These, and perhaps more I'm missing, are things you get for free when  
using the standard UI.


___
Ricky A. Sharp mailto:[EMAIL PROTECTED]
Instant Interactive(tm)   http://www.instantinteractive.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]


UTIs and CFBundleDocumentTypes

2008-04-01 Thread Rick Mann
I'm trying to use the editor you get when you get info on a target in  
Xcode to add support to my application to open files ending in ".gpx".


I've added a second line to that editor with what I thought was the  
appropriate information. But I'm confused, because these lines create  
CFBundleDocumentTypes entries, not UTExportedTypeDeclarations, and I'm  
not sure how the two interact; it seems like they are a bit redundant.  
The docs here don't say much:


http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Concepts/DocTypePList.html

Any other places I should look? Thanks!

--
Rick

___

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: Custom interface

2008-04-01 Thread glenn andreas


On Apr 1, 2008, at 3:45 PM, Ricky Sharp wrote:



On Apr 1, 2008, at 10:13 AM, I. Savant wrote:


Of course we don't know what the requirements are. You may have a

perfectly valid reason but customizing AppKit might be a perfectly
poor choice ... The best thing to do - as I said - is to explain what
you are trying to accomplish and why Cocoa UI isn't right for the
project. If you do that, list members can actually give meaningful
suggestions.



Well said.

And, if choosing to do your own UI (I did this for my "math drills"  
app for kids), be aware that the following can add quite a bit of  
additional work:


- accessibility
- resolution independence
- potential need for IB palettes/plug-ins

These, and perhaps more I'm missing, are things you get for free  
when using the standard UI.



Though you can get fairly simple "custom image" based buttons for free  
with the standard UI.  Just set the image and alternate image, set the  
button to not be bordered, and set the behavior as desired (on/off,  
highlight, etc...).


This will give you the accessibility, resolution independence, and IB  
support automatically.  Combine it with a custom window with an image  
background and no title-bar and you can get a simple "custom UI" with  
very little work.


Alternatively, you can work like Widgets do and use a WebKit view with  
the appropriate set of images (especially if you use SVG based  
images), JavaScript and CSS support to get a more complex custom UI  
with a bit more work, but still get some of the "free" benefits (or at  
least get those that web-pages have, such as resolution independence  
and at least some accessibility).


Now as to how appropriate it is to make your own customized UI, that's  
a different matter (though the general answer is "rarely, but there  
are special cases").




Glenn Andreas  [EMAIL PROTECTED]
  wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next  
generation of fractal art




___

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: Need for a creator code?

2008-04-01 Thread Marc Respass

On Apr 1, 2008, at 4:26 PM, Andrew Farmer wrote:

On 01 Apr 08, at 12:59, Marc Respass wrote:
I haven't registered for a creator code since System 7.5. Apple has  
information and registration page (http://developer.apple.com/datatype/index.html 
) about it but no indication if it's actually still required. Can  
anyone tell me if it is still required or maybe point me at the  
right information?


Type and creator codes have been deprecated since Tiger, which  
introduced UTIs. (Maybe even longer; I'm not sure.) Either way, you  
can safely forget they ever existed.


I'm just surprised that page is still active.


Oh. Looks like I'm off the hook. The UTI, I expect, is the bundle  
identifier, no? Do you happen to have a link to information about use  
of UTIs vs Creator codes? I tried a number of searches on the  
developer site and could not find anything about it. What are the  
ramifications of having a creator code? What if the code is all upper  
case? Any ideas?


Thanks a lot
Marc
___

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: CGDisplayReconfigurationCallBack

2008-04-01 Thread Trygve Inda
What exactly would I put in here?

It calls into my code with

void DisplayReconfigurationCallBack (CGDirectDisplayID display,
CGDisplayChangeSummaryFlags flags, void *userInfo)
{
if (flags & kCGDisplayAddFlag)
{
// do stuff
}
else if (flags & kCGDisplayRemoveFlag)
{
// do different stuff
}
}

Assuming my code does not do anything untold, what could the system do that
would cause it to fail?

Trygve

> It does not say to not use longjmp, it sais to not use longjmp to jump
> outside this function.
> 
> Just encapsulate your code in a @try / @catch()  block to ensure that
> even if an exception occurs (@throw use longjmp in the 32 bits
> runtime), it will jump in your catch block and not outside your
> callback.
> In the same way, if you are using C++ call in the call back, you have
> to use a try/catch block to avoid that an exception trigger a non-
> local return.
> 
> Le 30 mars 08 à 15:31, Trygve Inda a écrit :


___

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: Cocoa Tutoring in SF Bay Area

2008-04-01 Thread E. Wing
Also, check out NSCoderNight. It is kind of an offshoot of CocoaHeads.
It is a less formal thing where people just show up to work on their
own projects. Usually people there can help you with questions. It
meets every Tuesday.

http://nscodernight.com/


If you're thinking about paid mentoring, I think Scott Stevenson used
to do that. Scott Steveson also helps organize the Silicon Valley
chapter of CocoaHeads and often appears at NSCoderNight (in Campbell).

http://theocacao.com/document.page/274


-Eric


On 3/30/08, Adam Gerson <[EMAIL PROTECTED]> wrote:
> "CocoaHeads is a group devoted to discussion of Apple Computer's Cocoa
> Framework for programming on MacOS X. During monthly meetings, members
> present on their projects and offer tutorials on various programming
> topics."
>
> http://cocoaheads.org/us/SiliconValleyCalifornia/index.html
>
>
> On Sat, Mar 29, 2008 at 12:50 PM, Brad Gibbs <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I'm new to Cocoa programming. I have a specific application I would
> > like to create and feel I have a good idea of the application's
> > requirements, but I'm looking for advice on how to structure the code
> > most efficiently. I'm hoping to meet with someone for an hour or two
> > initially to discuss the project and get some advice on how to proceed.
> >
> > Are there any resources like this in the SF Bay Area? The program
> > involves sending HTTP Posts to an RPC Server on a local network and
> > receiving and parsing responses.
> >
> > Thanks in advance.
> >
> > Brad
> > ___
> >
> > 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/agersonl%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/ewmailing%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: CoreAnimation with and manual animation...

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 10:44 AM, Jesse Grosjean wrote:

n my app it seems like it would be simpler to just setup a timer and  
just directly update the ships position based on it's velocity for  
each time interval from my timer. I'd still want to use the built in  
core animation animations for other properties such as transparency,  
filters, etc. But for layer position it seems like it would be  
easiest to control that directly...


You're right. Last year I was fooling around with hooking CA up to a  
2D physics engine, and I just let the engine tell me where and when to  
position the objects, and set their position properties accordingly.


For best results, disable animations for this, otherwise CA will try  
to interpolate positions and things won't move correctly. I was doing  
this by using a CATransaction to disable all animations, but I think  
in hindsight it might be better just to to adjust the layers'  
animation dictionaries to clear out the animation for the "position"  
key.


(Using an existing physics engine is a great way to go, if you want to  
do this. I was using Box2D, but there's another similar one called  
Chipmunk. The math for this stuff gets really hairy — I've just  
started reading "Physics For Game Developers", and it's fascinating  
but I'm so glad I don't have to implement that myself!)


—Jens

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]

Southern California Coders?

2008-04-01 Thread Casey Becking
Sorry to take any ones time if this has been discussed before. I was curious
if there was any group meeting for Southern California coders to get
together?
___

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: test if another app has hung

2008-04-01 Thread Martin Redington


I went to check the referenced thread, as this is something I wanted  
to do occasionally, when I noticed that I was the OP for it.


The discussion was exhaustive, and veered OT at the end, but I'm not  
sure that I ever discerned how one would do this efficiently.


This was probably the most informative quote (from Eric Buck), but  
its still not clear to me how you check from outside the Window Server.


"I believe the Mac OS X window server periodically
sends events to the event queue of all applications
that have a connection to the window server.  If an
application does not remove the event from its queue,
the window server changes the cursor to the beach ball
automatically.  The only thing the beach ball means is
that an application is not taking events out of its
queue fast enough."

There were some AppleScript based approaches, but they all seemed to  
involve activating the app ...


Spin Control/Activity Monitor/Force Quit seem to have some access to  
hang data, but I haven't tried looking to see how they do it.



On 1 Apr 2008, at 11:49, Ron Fleckner wrote:



On 01/04/2008, at 9:28 PM, Ben Dougall wrote:

Hello,

What's the best way to test if another app has likely hung or not?  
Programmatically of course. I want to be able to kill an often  
hanging app and restart it -- when it's hung that is. (10.3.9+)


Thanks, Ben.



Hi Ben,

This question was exhaustively examined in a thread a few weeks  
ago.  Start here: 


HTH,
Ron
___

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/m.redington% 
40ucl.ac.uk


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]


iPhone Development: Any desktop-equiv frameworks to avoid?

2008-04-01 Thread Frederick C. Lee

Greetings:
   This is just a cursory question from a neophyte.

Are there any desktop-equivalent libraries/frameworks that are  
detrimental to iPhone development?
For example AppKit vs UIKit; or any particular libraries within the  
Foundation framework?


Any opinions/discussion would further clarify the iPhone-development  
environment.


Regards,

Ric.
___

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]


DataSource for NSTableView with ButtonCell

2008-04-01 Thread Thomas Bartelmess

Hello List,

i've created a NSTableview with Interface Builder. In one of my  
Collums is a NSButton. I've no idea how to set up the DataSource for  
this.


Can anyone help me?

Thanks a lot
Thomas Bartelmess

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


Finding out about new windows.

2008-04-01 Thread Paul FitzGerald
I have a need to find a way for my application to find out when new  
windows are opened within it.
The specific case I'm currently looking at is when the print dialog is  
opened and the user chooses "Save as PDF...". This action will open a  
file save dialog and I need to know when this happens. I don't see any  
events that can notify me that this window has opened.
Of course what I really want to know is when a window is supposed to  
become visible.


OK, I won't leave you wondering...
I'm working on a kiosk application and my main window is far above the  
print dialogs so they don't display. If I can know when they are to  
display I can grab them and pull them forward. Currently when my main  
window delegate received a windowDidResignMain: message I go look for  
"lost" windows and pul them forward. This gets me the print dialog but  
since I am no longer active any secondary dialogs get left behind my  
main window. Thus locking up the machine (time to reboot).


I'm using the method outlined in this link to make my application very- 
front-most...

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/AdvancedDrawing/chapter_9_section_4.html

Paul FitzGerald
___

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: Need for a creator code?

2008-04-01 Thread has

Ricky Sharp wrote:


I also know that you're still required to register a creator code for
at least one other thing (cannot think of it now).


Component Manager components use them for identification. Not that too  
many folks should need to write CM-based plugins these days; most will  
use the CF/NSBundle architecture instead.




I think it may also useful when dealing with Apple Events.


You can use creator codes in AEAddressDescs (see typeApplSignature),  
which are used to identify applications, though again there are newer  
alternatives (e.g. typeApplicationBundleID).


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.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 [EMAIL PROTECTED]


Re: CoreAnimation with and manual animation...

2008-04-01 Thread Jesse Grosjean

Jens,

Thanks for your reply.

What I'm doing now is something like this:

[CATransaction begin];
	[CATransaction setValue:[NSNumber numberWithFloat:0]  
forKey:kCATransactionAnimationDuration];


for (CALayer *each in [rootLayer.sublayers copy]) { 
[each step]; // calculate and assign self new position
}

[CATransaction commit];

I've also looked at the physics engine stuff, looks like great fun,  
but this project is actually super simple so I probably won't bother  
with including a physics engine for now.


Jesse

On Apr 1, 2008, at 6:17 PM, Jens Alfke wrote:


On 1 Apr '08, at 10:44 AM, Jesse Grosjean wrote:

n my app it seems like it would be simpler to just setup a timer  
and just directly update the ships position based on it's velocity  
for each time interval from my timer. I'd still want to use the  
built in core animation animations for other properties such as  
transparency, filters, etc. But for layer position it seems like it  
would be easiest to control that directly...


You're right. Last year I was fooling around with hooking CA up to a  
2D physics engine, and I just let the engine tell me where and when  
to position the objects, and set their position properties  
accordingly.


For best results, disable animations for this, otherwise CA will try  
to interpolate positions and things won't move correctly. I was  
doing this by using a CATransaction to disable all animations, but I  
think in hindsight it might be better just to to adjust the layers'  
animation dictionaries to clear out the animation for the "position"  
key.


(Using an existing physics engine is a great way to go, if you want  
to do this. I was using Box2D, but there's another similar one  
called Chipmunk. The math for this stuff gets really hairy — I've  
just started reading "Physics For Game Developers", and it's  
fascinating but I'm so glad I don't have to implement that myself!)


—Jens


___

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: NSView out of memory problem

2008-04-01 Thread Graham Cox
As I said, it says nothing about how it's implemented. Chances are, it  
will avoid creation of an unnecessary NSBezierPath object, but relying  
on that being the case is folly.



On 2 Apr 2008, at 2:23 am, Matthew Whillock wrote:

The class reference has this to say about it:

Strokes a line between two points using the current stroke color and  
the default drawing attributes.

+ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2


So it will just draw a line.

Cheers,
Matt


Are you sure? This could be just a convenient interface for  
creating a

bezier object with the points passed, stroking it and releasing or
autoreleasing it. The docs say nothing about how it's implemented.




___

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: iPhone Development: Any desktop-equiv frameworks to avoid?

2008-04-01 Thread Shawn Erickson
On Tue, Apr 1, 2008 at 3:34 PM, Frederick C. Lee <[EMAIL PROTECTED]> wrote:
> Greetings:
> This is just a cursory question from a neophyte.
>
>  Are there any desktop-equivalent libraries/frameworks that are
>  detrimental to iPhone development?
>  For example AppKit vs UIKit; or any particular libraries within the
>  Foundation framework?
>
>  Any opinions/discussion would further clarify the iPhone-development
>  environment.

iPhone SDK is under NDA (non-disclosure agreement) and cannot be
discussed via a channel such as this list.

-Shawn
___

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]


converting Carbon printing to Cocoa

2008-04-01 Thread Chinh Nguyen
My currently Carbon app can not only print the contents of a document  
in memory but also one from a disk without loading it.  It does this  
by using PMSessionBeginDocument(), PMSessionBeginPage(), etc... and  
drawing each line of the document (in my own file format).  When  
printing a file off disk, this method is very efficient since you  
don't have to wait for the document to finish loading (which can be  
potentially very large) before printing and it consumes very little  
memory since it only needs to maintain a buffer of just one line as it  
creates pages to print.


Cocoa makes printing my document in memory very easy but I can't find  
equivalent methods that give me the level of control I need for  
printing a file of indeterminate size without loading it.  Is what I'm  
attempting possible or am I just going to have to load my document  
before printing it?


PS. [[NSPrintPanel printPanel] runModal] seems to crash and I can't  
figure out why.


-Chinh Nguyen
 [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: test if another app has hung

2008-04-01 Thread John Stiles
I have a vague recollection that the mechanism used by Activity Monitor 
and friends is not public API, unfortunately.



Martin Redington wrote:


I went to check the referenced thread, as this is something I wanted 
to do occasionally, when I noticed that I was the OP for it.


The discussion was exhaustive, and veered OT at the end, but I'm not 
sure that I ever discerned how one would do this efficiently.


This was probably the most informative quote (from Eric Buck), but its 
still not clear to me how you check from outside the Window Server.


"I believe the Mac OS X window server periodically
sends events to the event queue of all applications
that have a connection to the window server.  If an
application does not remove the event from its queue,
the window server changes the cursor to the beach ball
automatically.  The only thing the beach ball means is
that an application is not taking events out of its
queue fast enough."

There were some AppleScript based approaches, but they all seemed to 
involve activating the app ...


Spin Control/Activity Monitor/Force Quit seem to have some access to 
hang data, but I haven't tried looking to see how they do it.



On 1 Apr 2008, at 11:49, Ron Fleckner wrote:



On 01/04/2008, at 9:28 PM, Ben Dougall wrote:

Hello,

What's the best way to test if another app has likely hung or not? 
Programmatically of course. I want to be able to kill an often 
hanging app and restart it -- when it's hung that is. (10.3.9+)


Thanks, Ben.



Hi Ben,

This question was exhaustively examined in a thread a few weeks ago.  
Start here: 



HTH,
Ron
___

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/m.redington%40ucl.ac.uk

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/jstiles%40blizzard.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: CGDisplayReconfigurationCallBack

2008-04-01 Thread Jean-Daniel Dupas

As we are on the cocoa list, I assume you are using obj-c.
If you are using plain C API in your code, you should not have problem.
But  if "// do stuff" contains some obj-c calls that can raise an  
exception, you have to make sure to catch it.


void DisplayReconfigurationCallBack (CGDirectDisplayID display,  
CGDisplayChangeSummaryFlags flags, void *userInfo)

{
   if (flags & kCGDisplayAddFlag)
   {
@try {
// do stuff
} @catch (NSException *exception) {
		// an error occured (but should not). You can ignore it if you want.  
you can log it, etc...

}
   }
   else if (flags & kCGDisplayRemoveFlag)
   {
   // do different stuff
   }
}

Le 2 avr. 08 à 00:12, Trygve Inda a écrit :


void DisplayReconfigurationCallBack (CGDirectDisplayID display,
CGDisplayChangeSummaryFlags flags, void *userInfo)
{
   if (flags & kCGDisplayAddFlag)
   {
   // do stuff
   }
   else if (flags & kCGDisplayRemoveFlag)
   {
   // do different stuff
   }
}


___

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]


[NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread Martin Redington


I'm running /sbin/md5 via an NSTask on a number of files (3,000 or  
so, with a new NSTask each time).


This is on 10.4.11, with Xcode 2.4.1

My Debug and Release builds seem to be running out of filehandles, or  
something similar, as evidenced by the following symptoms:


1) [NSPipe pipe] starts to returns nil
2) This always happens at the same point, indicating some kind of  
hard resource limit.
3) lsof -p PID shows an increasing number of open filehandles during  
the md5 calculation


My md5 method looks more or less as pasted below (I've stripped a few  
irrelevant details and some logging).


The problem always occurs on something like the 250th invocation of  
the md5ChecksumForPath method (its always the same, but I just  
cleared the log).


Oddly, when run in the debugger, I don't seem to see this issue, and  
the process runs to completion, even though the number of open files,  
as shown by lsof, reaches 3000+


Once it completes, all of the extra filehandles get released (it's  
back down to 90 right now).


Am I missing some kind of cleanup here?

I realise there are probably alternatives to NSTask/md5 here (such as  
reading the files myself, and calling the MD5 from ),  
but this issue apart, what I've got right now seems to work fine.


One other piece of info - this all happens in a worker thread. In the  
case of running under the debugger, this thread has terminated now  
that the process is complete, so the cleanup may have occurred then.




- (NSString *) md5ChecksumForPath:(NSString *)absolutePath
{
NSString *md5Checksum = nil;

md5Count++;

// I added the pool to try and make sure that old pipes get  
autoreleased.

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

NSArray *args = [NSArray arrayWithObjects:@"-q", absolutePath,  
nil];

NSTask *md5Task = [[NSTask alloc] init];
[md5Task setLaunchPath:@"/sbin/md5"];
[md5Task setArguments:args];

// This starts to return nil, always at the same point
NSPipe *thePipe = [NSPipe pipe];
NSFileHandle *readHandle = [thePipe fileHandleForReading];

// Actual failure occurs here. Throws setObject:forKey: with nil  
object.

[md5Task setStandardOutput:thePipe];

[md5Task launch];

NSData *outputData = nil;

while ((outputData = [readHandle availableData]) && [outputData  
length]) {
md5Checksum = [[NSString alloc] initWithData:outputData  
encoding:NSUTF8StringEncoding];

}

[md5Task release];

[pool release];

[md5Checksum autorelease];

return md5Checksum;
}

___

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]


[NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread Martin Redington


I'm running /sbin/md5 via an NSTask on a number of files (3,000 or  
so, with a new NSTask each time).


This is on 10.4.11, with Xcode 2.4.1

My Debug and Release builds seem to be running out of filehandles, or  
something similar, as evidenced by the following symptoms:


1) [NSPipe pipe] starts to returns nil
2) This always happens at the same point, indicating some kind of  
hard resource limit.
3) lsof -p PID shows an increasing number of open filehandles during  
the md5 calculation


My md5 method looks more or less as pasted below (I've stripped a few  
irrelevant details and some logging).


The problem always occurs on something like the 250th invocation of  
the md5ChecksumForPath method (its always the same, but I just  
cleared the log).


Oddly, when run in the debugger, I don't seem to see this issue, and  
the process runs to completion, even though the number of open files,  
as shown by lsof, reaches 3000+


Once it completes, all of the extra filehandles get released (it's  
back down to 90 right now).


Am I missing some kind of cleanup here?

I realise there are probably alternatives to NSTask/md5 here (such as  
reading the files myself, and calling the MD5 from ),  
but this issue apart, what I've got right now seems to work fine.


One other piece of info - this all happens in a worker thread. In the  
case of running under the debugger, this thread has terminated now  
that the process is complete, so the cleanup may have occurred then.




- (NSString *) md5ChecksumForPath:(NSString *)absolutePath
{
NSString *md5Checksum = nil;

md5Count++;

// I added the pool to try and make sure that old pipes get  
autoreleased.

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

NSArray *args = [NSArray arrayWithObjects:@"-q", absolutePath,  
nil];

NSTask *md5Task = [[NSTask alloc] init];
[md5Task setLaunchPath:@"/sbin/md5"];
[md5Task setArguments:args];

// This starts to return nil, always at the same point
NSPipe *thePipe = [NSPipe pipe];
NSFileHandle *readHandle = [thePipe fileHandleForReading];

// Actual failure occurs here. Throws setObject:forKey: with nil  
object.

[md5Task setStandardOutput:thePipe];

[md5Task launch];

NSData *outputData = nil;

while ((outputData = [readHandle availableData]) && [outputData  
length]) {
md5Checksum = [[NSString alloc] initWithData:outputData  
encoding:NSUTF8StringEncoding];

}

[md5Task release];

[pool release];

[md5Checksum autorelease];

return md5Checksum;
}

___

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: CoreAnimation with and manual animation...

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 3:54 PM, Jesse Grosjean wrote:


What I'm doing now is something like this:

[CATransaction begin];
	[CATransaction setValue:[NSNumber numberWithFloat:0]  
forKey:kCATransactionAnimationDuration];


I was actually setting the kCATransactionDisableActions property  
instead. I don't know if it makes a difference; it might be more  
efficient.


—Jens

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: Fixing my massive memory leak with NSImage/CALayer

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 11:07 AM, Nathan Vander Wilt wrote:

The NSImage that my FRPhoto holds on to should have "invalidate[d]  
and free[d] the offscreen caches of all image representations".


That doesn't mean the image representations themselves are flushed,  
though. They're still there, typically holding onto big uncompressed  
pixmaps. All -recache does is flush extra copies of those pixmaps that  
were copied into VRAM to speed up blitting.


If you want the pixmaps out of memory, you have to dealloc the  
NSImages themselves.


—Jens

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: Finding out about new windows.

2008-04-01 Thread Kyle Sluder
I'm pretty sure this is no longer the recommended way to do a kiosk
application.  Instead, you can use SetSystemUIMode to hide the menubar
and dock (or replace the Finder as the first app launched).

TN2062 < http://developer.apple.com/technotes/tn2002/tn2062.html > has
more information.

--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]


Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread Jim Correia

On Apr 1, 2008, at 7:19 PM, Martin Redington wrote:

I'm running /sbin/md5 via an NSTask on a number of files (3,000 or  
so, with a new NSTask each time).


I know the "unix way" is to string together small purpose built tools  
via pipes.


But it strikes me that NSTask is the wrong hammer for this nail.  
Computing an md5 programatically yourself is probably the better  
solution, regardless of the leaky file descriptor problem you are  
having.


Jim

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread stephen joseph butler
On Tue, Apr 1, 2008 at 6:20 PM, Martin Redington <[EMAIL PROTECTED]>
wrote:

> I'm running /sbin/md5 via an NSTask on a number of files (3,000 or
> so, with a new NSTask each time).


This would run a lot faster (and avoid fd issues) if you used libcrypto. Try
"man EVP_DigestInit" to get an idea of where to start.

If the files will always be fairly small, you can load them into an NSData
instance and follow the advice here: <
http://www.cocoadev.com/index.pl?MDFive>
___

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: ERROR: __CFURLCache::StepSQLStatement

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 12:06 PM, Bill wrote:

Is my app causing it to happen?  If so, should I try and correct  
it?  Or can I safely ignore it?


IIRC, sqlite error 5 means the database is locked. I think the only  
way that could happen is if you have multiple copies of your app/ 
process running at the same time, and one of them is hung or stopped  
at a breakpoint or something.


If that's not the case, this is probably nothing your app is doing.

—Jens

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: Need for a creator code?

2008-04-01 Thread Jean-Daniel Dupas


Le 1 avr. 08 à 22:26, Andrew Farmer a écrit :


On 01 Apr 08, at 12:59, Marc Respass wrote:
I haven't registered for a creator code since System 7.5. Apple has  
information and registration page (http://developer.apple.com/datatype/index.html 
) about it but no indication if it's actually still required. Can  
anyone tell me if it is still required or maybe point me at the  
right information?


Type and creator codes have been deprecated since Tiger, which  
introduced UTIs. (Maybe even longer; I'm not sure.) Either way, you  
can safely forget they ever existed.


I'm just surprised that page is still active.


As you cannot embed an UTI in a document, UTI is useless to identify  
the document type if the document does not provide an extension or an  
HFS Type.

Or maybe I miss something ?

___

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: Southern California Coders?

2008-04-01 Thread James Merkel

On Tue, 1 Apr 2008 15:23:40, Casey Becking wrote:

Sorry to take any ones time if this has been discussed before. I was  
curious

if there was any group meeting for Southern California coders to get
together?


Well, Southern California is a pretty big area. I have seen reference  
to Lake Forest meetings.


Are there any groups in the San Diego area?

Jim Merkel

 
___


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

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

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

This email sent to [EMAIL PROTECTED]


Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread Jean-Daniel Dupas


Le 2 avr. 08 à 01:36, stephen joseph butler a écrit :
On Tue, Apr 1, 2008 at 6:20 PM, Martin Redington <[EMAIL PROTECTED] 
>

wrote:


I'm running /sbin/md5 via an NSTask on a number of files (3,000 or
so, with a new NSTask each time).



This would run a lot faster (and avoid fd issues) if you used  
libcrypto. Try

"man EVP_DigestInit" to get an idea of where to start.



And this would not require libcrypto dependency if you use  
CommonDigest that is part of the Mac OS X libSystem. (usr/include/ 
CommonCrypto/CommonDigest.h) and that is not more complexe than EVP:


extern unsigned char *CC_MD5(const void *data, CC_LONG len, unsigned  
char *md);



___

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: Need for a creator code?

2008-04-01 Thread Rainer Brockerhoff
At 15:21 -0700 01/04/08, [EMAIL PROTECTED] wrote:
>From: Andrew Farmer <[EMAIL PROTECTED]>
>References: <[EMAIL PROTECTED]>
>In-Reply-To: <[EMAIL PROTECTED]>
>Date: Tue, 1 Apr 2008 13:26:58 -0700
>Message-ID: <[EMAIL PROTECTED]>
>
>On 01 Apr 08, at 12:59, Marc Respass wrote:
>>I haven't registered for a creator code since System 7.5. Apple has 
>>information and registration page 
>>(http://developer.apple.com/datatype/index.html) about it but no indication 
>>if it's actually still required. Can anyone tell me if it is still required 
>>or maybe point me at the right information?
>
>Type and creator codes have been deprecated since Tiger, which introduced 
>UTIs. (Maybe even longer; I'm not sure.) Either way, you can safely forget 
>they ever existed.

Type and Creator codes are alive and well in 10.5.x, and I haven't seen any 
mention that they're deprecated.

They're still used by LaunchServices to bind documents to applications. UTIs 
haven't substituted them, mostly because there's no field in HFS+ that directly 
defines a UTI for a specific file; instead the UTI is deduced from type, 
creator and extension (perhaps also from file contents in some cases).

What actually happens is that file type is checked first, then file extension, 
then file creator. LaunchServices matches them, in that order, to registered 
applications. The same metadata are also used to produce UTIs for that file, 
which are also used for matching.

It's still useful to register a creator code for your application if you have 
documents/files that have no extensions (in that case, also use a type), or 
that have some otherwise common extension, but still need to show your app's 
document icon. All-lowercase code are reserved.

There used to be some problems with using codes that contained MacRoman 
characters with the high bit set - the codes use MacRoman but the PkgInfo files 
(which are mostly obsolete these days) used UTF8. I suppose that should work 
now, although I haven't checked.

Registering a code is much faster now - you get a response within minutes, 
instead of the week it used to take in the System 7 days.

-- 
Rainer Brockerhoff  <[EMAIL PROTECTED]>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
 In their own business even sages err."
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
___

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: Finding out about new windows.

2008-04-01 Thread Rob Napier
This is a good part of the solution. You also want to consider your window
level. Rather than taking over the entire screen, move your window level up
to NSModalPanelWindowLevel-1 and put a masking window at
NSModalPanelWindowLevel-2. That way the modal dialog will pop up over your
app.

-Rob

On Tue, Apr 1, 2008 at 7:29 PM, Kyle Sluder <[EMAIL PROTECTED]>
wrote:

> I'm pretty sure this is no longer the recommended way to do a kiosk
> application.  Instead, you can use SetSystemUIMode to hide the menubar
> and dock (or replace the Finder as the first app launched).
>
> TN2062 < http://developer.apple.com/technotes/tn2002/tn2062.html > has
> more information.
>
> --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/robnapier%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>



-- 
Rob Napier -- Software and Security Consulting -- http://robnapier.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: Finding out about new windows.

2008-04-01 Thread Ricky Sharp


On Apr 1, 2008, at 6:29 PM, Kyle Sluder wrote:


I'm pretty sure this is no longer the recommended way to do a kiosk
application.  Instead, you can use SetSystemUIMode to hide the menubar
and dock (or replace the Finder as the first app launched).

TN2062 < http://developer.apple.com/technotes/tn2002/tn2062.html > has
more information.



Definitely go this route (it's what I do).  I also recently added PDF  
generation features in my full-screen app and it works a-ok with all  
AppKit dialogs.


Capturing the screen is primarily used for games such that all UI will  
be rendered/controlled without AppKit.  In fact, you cannot expect  
captured screens to work at all with AppKit.  It may or may not work  
depending upon the computer, graphics card, etc.


___
Ricky A. Sharp mailto:[EMAIL PROTECTED]
Instant Interactive(tm)   http://www.instantinteractive.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: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread Martin Redington


On 2 Apr 2008, at 00:33, Jim Correia wrote:


On Apr 1, 2008, at 7:19 PM, Martin Redington wrote:

I'm running /sbin/md5 via an NSTask on a number of files (3,000 or  
so, with a new NSTask each time).


I know the "unix way" is to string together small purpose built  
tools via pipes.


But it strikes me that NSTask is the wrong hammer for this nail.  
Computing an md5 programatically yourself is probably the better  
solution, regardless of the leaky file descriptor problem you are  
having.


Well, I think I've solved the leak.

[md5Task waitUntilExit];

before

[md5Task release];

does the trick. No fd leaks, and it seems a lot faster generally.  
You'd kind of hope that NSTask would clean up in its dealloc method,  
but apparently not.


Jim - any particular reason why you'd not use NSTask?

I guess I'm paying the fork/exec overhead, and some interprocess  
piping and (a very small bit of) extra I/O for each NSTask. I will  
actually be caching a lot of the output, so I expect the numbers to  
be much smaller on subsequent scans, although even once off, 3,000  
spawns does seem a bit gratuitous. Performance was much better than I  
expected though - about 12 minutes for the md5 phase.


I'm still in pre-optimisation mode right now, and I'll probably  
migrate to the openssl MD5 method in any case, but I'm interested to  
hear if there's any other reason apart from the above.













___

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: Cocoa Tutoring in SF Bay Area

2008-04-01 Thread Joel Norvell
Hi Brad,
Based on the description of your application, I think you'll find Brent
Simmons' excellent XML-RPC Class for Cocoa helpful.  And as Eric Wing pointed
out, you can't go wrong with Cocoaheads and NSCoder Night!
Sincerely,
Joel

http://ranchero.com/cocoa/xmlrpc/




  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.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: KVO question on Tree Controllers

2008-04-01 Thread Adam Gerson
What is bound to your NSTreeController? If its something like an
OutlineView you can have the delegate impliment
outlineViewSelectionDidChange. I tested it in my app and it does get
called when the OutlineView selection is changes to empty.

Adam


On Tue, Apr 1, 2008 at 3:11 PM, Jeff LaMarche <[EMAIL PROTECTED]> wrote:
> I've registered to receive notifications from an NSTreeController
>  instance loaded from a nib, like so:
>
>  [treeController addObserver:self
> forKeyPath:@"selection"
> options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
> context:NULL];
>
>  I've also tried using @"selectedObjects" rather than @"selection". Now
>  this notifies me when the selection changes, except it doesn't notify
>  me if the user clicked somewhere resulting in an empty selection, nor
>  when the selection is currently empty and the user selects on the same
>  object that was previously selected.
>
>  I need to know when the selection becomes empty, not just when it
>  changes from one node to another node. Is there another keyPath or
>  notification I can register for that will do that?
>
>  TIA,
>  Jeff
>
>  ___
>
>  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/agersonl%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: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread John Stiles
I haven't experimented with CC_MD5, but we do have code which calculates 
MD5s (calculated via simple C code).
Is CC_MD5 optimized e.g. using SSE or AltiVec? Should I expect to see a 
perf boost if I swapped in this code instead of our regular C code?



Jean-Daniel Dupas wrote:


Le 2 avr. 08 à 01:36, stephen joseph butler a écrit :

On Tue, Apr 1, 2008 at 6:20 PM, Martin Redington <[EMAIL PROTECTED]>
wrote:


I'm running /sbin/md5 via an NSTask on a number of files (3,000 or
so, with a new NSTask each time).



This would run a lot faster (and avoid fd issues) if you used 
libcrypto. Try

"man EVP_DigestInit" to get an idea of where to start.



And this would not require libcrypto dependency if you use 
CommonDigest that is part of the Mac OS X libSystem. 
(usr/include/CommonCrypto/CommonDigest.h) and that is not more 
complexe than EVP:


extern unsigned char *CC_MD5(const void *data, CC_LONG len, unsigned 
char *md);



___

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/jstiles%40blizzard.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: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread Martin Redington


On 2 Apr 2008, at 00:46, Jean-Daniel Dupas wrote:



Le 2 avr. 08 à 01:36, stephen joseph butler a écrit :
On Tue, Apr 1, 2008 at 6:20 PM, Martin Redington  
<[EMAIL PROTECTED]>

wrote:


I'm running /sbin/md5 via an NSTask on a number of files (3,000 or
so, with a new NSTask each time).



This would run a lot faster (and avoid fd issues) if you used  
libcrypto. Try

"man EVP_DigestInit" to get an idea of where to start.



And this would not require libcrypto dependency if you use  
CommonDigest that is part of the Mac OS X libSystem. (usr/include/ 
CommonCrypto/CommonDigest.h) and that is not more complexe than EVP:


extern unsigned char *CC_MD5(const void *data, CC_LONG len,  
unsigned char *md);


Ah, that's interesting, although I think I have other libcrypto  
dependencies anyway.


It looks like the incremental functions are the ones I want. The  
duplicate files tend to be small in practice (surprisingly so,  
actually), but can be of arbitrary sizes.





___

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/m.redington% 
40ucl.ac.uk


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]


  1   2   >