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]





  Lesen Sie Ihre E-Mails auf dem Handy.
www.yahoo.de/go
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


NSWindow z-depth

2008-04-01 Thread Mike R. Manzano
Is there a way to get a window's z-depth in relation to my app's other  
windows?


Mike

___

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

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

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

This email sent to [EMAIL PROTECTED]


Accessing a windows share

2008-04-01 Thread Valentin Dan

Hi,

Same question with a new spin :) ...

How can I access (from Cocoa, Objective-C code) a path like : 
\\192.1.1.1\c$\SomeDir\AnotherOne\SomePicture.jpg  ?

I need to load that picture in a table view, so I need the NSData object and 
the connection should be able to authenticate (perhaps a NSURLConnection ?).

Thanks !


___
Valentin Dan, Software Developer Direct: +1 905 886 1833 
ext.3047   
Email: [EMAIL PROTECTED] Office: +40 356-710158
Masstech Group Inc.  Fax:+40 256-220912
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.
 
 
-Original Message-
From: Jens Alfke [mailto:[EMAIL PROTECTED] 
Sent: 1 aprilie 2008 19:15
To: Valentin Dan
Cc: cocoa-dev@lists.apple.com; Constantin Sirb; Dan Tascau
Subject: Re: Using UNCs with NSURLConnection


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

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

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: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-01 Thread Jens Alfke


On 1 Apr '08, at 4:53 PM, Martin Redington wrote:

You'd kind of hope that NSTask would clean up in its dealloc method,  
but apparently not.


But you're not (and shouldn't be) calling -dealloc, you're calling - 
release. My guess is that the NSTask retains itself while the process  
is running, so as not to leave anything dangling, then releases itself  
when it exits. If you don't wait for the task to exit, but start lots  
of others as fast as you can, you're probably piling up lots of tasks  
at once. Collect about 84, and suddenly you can't start any more.



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.


It's vastly slower to do this by forking a process.
NSTask can be annoying to deal with (I've had trouble getting it to  
cooperate, and you're running into problems too.)
It's more code than simply calling CommonDigest, and it's less clear  
to the reader what's going on.


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.


That's 0.25 seconds per file. I think you can do better than that,  
unless the files are really big.


Also, you're aware that MD5 shouldn't be used for anything security- 
related anymore? Last I heard it's pretty close to being fully broken.  
SHA-1 is a lot more secure, and has a larger output which itself makes  
collisions less likely.


—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 7:47 PM, Nathan Vander Wilt wrote:

Looks like I'll have to design a smarter architecture to keep the  
right images in memory at the right time.


IKImageBrowserView (new in 10.5) pretty much does this for you. If its  
look and feel are compatible with what you're doing (it's not very  
customizable) it's definitely the easiest way to go.


If you're doing it yourself, though, and need maximum control over  
image memory usage, consider using CGImage instead. It doesn't cache  
anything for you, so it's easier to tell what it's 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: HUD panel is deallocating itself after close

2008-04-01 Thread Sam Krishna

Hey Jon,

Thanks... I literally figured that out 90 seconds before you emailed  
me. :-D


Sam

On Apr 2, 2008, at 1:23 AM, Jonathan Hess wrote:


Hey Sam -

Uncheck 'release when closed' option in the IB inspector for your  
HUD window if it is checked.


Good Luck -
Jon Hess

On Apr 1, 2008, at 10:12 PM, Sam Krishna wrote:


(Leopard 10.2.5, x86)

As a simple project, I'm trying to implement a HUD panel inside of  
the TextEdit codebase. The HUD panel is in a separate nib  
("HUD.nib") that has it's own controller which is separate from the  
File's Owner class.


I have two classes:

(1) Launcher.[hm] --- this is the File's Owner class.
(2) HUDControlller.[hm]

I've re-wired the "Find..." sub-menu item to launch the panel when  
firing showFindPanel:


The HUD panel opens successfully the first time when I use Cmd-F to  
"find" something. However, when I close the panel and try to re- 
open it, the system acts as if the panel has inadvertently been  
freed.  Here's the backtrace:



Current language:  auto; currently objective-c
Program received signal:  “EXC_BAD_ACCESS”.
(gdb) bt
#0  0x906176e8 in objc_msgSend ()
#1  0x0001b142 in -[PanelController showFindPanel:]  
(self=0x143c4d30, _cmd=0x1fdf8, sender=0x135530) at /Volumes/elyon/ 
achilles/Projects/Regex/Prototypes/TextEdit/PanelController.m:30
#2  0x0001b322 in -[Detector showFindPanel:] (self=0x135530,  
_cmd=0x1fdf8, sender=0x12f6c0) at /Volumes/elyon/achilles/Projects/ 
Regex/Prototypes/TextEdit/Detector.m:136

#3  0x9188fe56 in -[NSApplication sendAction:to:from:] ()
#4  0x9193e7cc in -[NSMenu performActionForItemAtIndex:] ()
#5  0x9193e4d1 in -[NSCarbonMenuImpl  
performActionWithHighlightingForItemAtIndex:] ()

#6  0x9193e157 in -[NSMenu performKeyEquivalent:] ()
#7  0x9193c9fd in -[NSApplication _handleKeyEquivalent:] ()
#8  0x91859b36 in -[NSApplication sendEvent:] ()
#9  0x917b70f9 in -[NSApplication run] ()
#10 0x9178430a in NSApplicationMain ()
#11 0x00016985 in main (argc=1, argv=0xb6b0) at
--

For the record, the code isn't doing anything special. All I did  
was re-wire the main menu's Find->Find...  submenu item to my  
Launcher class in the Edit.nib file. I then used NSBundle to load  
the secondary xib, set the File's Owner of the 2nd xib to Launcher,  
and had it point to the HUDController, which in turn performs - 
makeKeyAndOrderFront: on the HUD Panel when using Cmd-F.


Any ideas?

Sam


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jhess%40apple.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: HUD panel is deallocating itself after close

2008-04-01 Thread Jonathan Hess

Hey Sam -

Uncheck 'release when closed' option in the IB inspector for your HUD  
window if it is checked.


Good Luck -
Jon Hess

On Apr 1, 2008, at 10:12 PM, Sam Krishna wrote:


(Leopard 10.2.5, x86)

As a simple project, I'm trying to implement a HUD panel inside of  
the TextEdit codebase. The HUD panel is in a separate nib  
("HUD.nib") that has it's own controller which is separate from the  
File's Owner class.


I have two classes:

(1) Launcher.[hm] --- this is the File's Owner class.
(2) HUDControlller.[hm]

I've re-wired the "Find..." sub-menu item to launch the panel when  
firing showFindPanel:


The HUD panel opens successfully the first time when I use Cmd-F to  
"find" something. However, when I close the panel and try to re-open  
it, the system acts as if the panel has inadvertently been freed.   
Here's the backtrace:



Current language:  auto; currently objective-c
Program received signal:  “EXC_BAD_ACCESS”.
(gdb) bt
#0  0x906176e8 in objc_msgSend ()
#1  0x0001b142 in -[PanelController showFindPanel:]  
(self=0x143c4d30, _cmd=0x1fdf8, sender=0x135530) at /Volumes/elyon/ 
achilles/Projects/Regex/Prototypes/TextEdit/PanelController.m:30
#2  0x0001b322 in -[Detector showFindPanel:] (self=0x135530,  
_cmd=0x1fdf8, sender=0x12f6c0) at /Volumes/elyon/achilles/Projects/ 
Regex/Prototypes/TextEdit/Detector.m:136

#3  0x9188fe56 in -[NSApplication sendAction:to:from:] ()
#4  0x9193e7cc in -[NSMenu performActionForItemAtIndex:] ()
#5  0x9193e4d1 in -[NSCarbonMenuImpl  
performActionWithHighlightingForItemAtIndex:] ()

#6  0x9193e157 in -[NSMenu performKeyEquivalent:] ()
#7  0x9193c9fd in -[NSApplication _handleKeyEquivalent:] ()
#8  0x91859b36 in -[NSApplication sendEvent:] ()
#9  0x917b70f9 in -[NSApplication run] ()
#10 0x9178430a in NSApplicationMain ()
#11 0x00016985 in main (argc=1, argv=0xb6b0) at
--

For the record, the code isn't doing anything special. All I did was  
re-wire the main menu's Find->Find...  submenu item to my Launcher  
class in the Edit.nib file. I then used NSBundle to load the  
secondary xib, set the File's Owner of the 2nd xib to Launcher, and  
had it point to the HUDController, which in turn performs - 
makeKeyAndOrderFront: on the HUD Panel when using Cmd-F.


Any ideas?

Sam


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jhess%40apple.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]


HUD panel is deallocating itself after close

2008-04-01 Thread Sam Krishna

(Leopard 10.2.5, x86)

As a simple project, I'm trying to implement a HUD panel inside of the  
TextEdit codebase. The HUD panel is in a separate nib ("HUD.nib") that  
has it's own controller which is separate from the File's Owner class.


I have two classes:

(1) Launcher.[hm] --- this is the File's Owner class.
(2) HUDControlller.[hm]

I've re-wired the "Find..." sub-menu item to launch the panel when  
firing showFindPanel:


The HUD panel opens successfully the first time when I use Cmd-F to  
"find" something. However, when I close the panel and try to re-open  
it, the system acts as if the panel has inadvertently been freed.   
Here's the backtrace:



Current language:  auto; currently objective-c
Program received signal:  “EXC_BAD_ACCESS”.
(gdb) bt
#0  0x906176e8 in objc_msgSend ()
#1  0x0001b142 in -[PanelController showFindPanel:] (self=0x143c4d30,  
_cmd=0x1fdf8, sender=0x135530) at /Volumes/elyon/achilles/Projects/ 
Regex/Prototypes/TextEdit/PanelController.m:30
#2  0x0001b322 in -[Detector showFindPanel:] (self=0x135530,  
_cmd=0x1fdf8, sender=0x12f6c0) at /Volumes/elyon/achilles/Projects/ 
Regex/Prototypes/TextEdit/Detector.m:136

#3  0x9188fe56 in -[NSApplication sendAction:to:from:] ()
#4  0x9193e7cc in -[NSMenu performActionForItemAtIndex:] ()
#5  0x9193e4d1 in -[NSCarbonMenuImpl  
performActionWithHighlightingForItemAtIndex:] ()

#6  0x9193e157 in -[NSMenu performKeyEquivalent:] ()
#7  0x9193c9fd in -[NSApplication _handleKeyEquivalent:] ()
#8  0x91859b36 in -[NSApplication sendEvent:] ()
#9  0x917b70f9 in -[NSApplication run] ()
#10 0x9178430a in NSApplicationMain ()
#11 0x00016985 in main (argc=1, argv=0xb6b0) at
--

For the record, the code isn't doing anything special. All I did was  
re-wire the main menu's Find->Find...  submenu item to my Launcher  
class in the Edit.nib file. I then used NSBundle to load the secondary  
xib, set the File's Owner of the 2nd xib to Launcher, and had it point  
to the HUDController, which in turn performs -makeKeyAndOrderFront: on  
the HUD Panel when using Cmd-F.


Any ideas?

Sam


___

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

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

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

This email sent to [EMAIL PROTECTED]


NSManagedObject data only shows up in view sometimes

2008-04-01 Thread Adam Gerson
I have a classic NSTreeController / NSOutlineView situation. The
TreeController has a SortDescriptor on it. I am programatically adding
a leaf node to a group node. It does not appear in the OutlineView
when I first add it. When I inspect the CoreData .xml file the leaf
node is there and it appears to have the right relationships. Then if
I launch the program again there is a 50/50 chance the leaf node will
appear. I just keep launching and quitting the program without making
any changes to the data. Sometimes the child is is the OutlineView and
sometimes it is not.

With a SortDescriptor applied what other changes could cause the
OutlineView to sometimes show a node and sometimes not on different
launches?

Thanks,
Adam
___

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

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

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

This email sent to [EMAIL PROTECTED]


activate my application while dragging on other application window

2008-04-01 Thread Apparao Mulpuri
I want to activate my application while dragging on other application window?.

Is it implementable in Cocoa?

- Apparao.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 Nathan Vander Wilt

On Apr 1, 2008, at 4:24 PM, Jens Alfke wrote:

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.


Okay, I was confusing "representations" with "caches" -- using lazy  
initialization for the representations is equivalent to allocating the  
representations eventually. A more careful reading of http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Images/chapter_7_section_2.html 
 explains "-recache" in the correct context. Looks like I'll have to  
design a smarter architecture to keep the right images in memory at  
the right time.


It was really frustrating to see my app balloon up like that without  
understanding what was going on. Thanks much for your help!


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


Re: Finding out about new windows.

2008-04-01 Thread Paul FitzGerald

Thanks Rob.
I thought I looked through all the window notifications. Maybe I just  
overlooked this. I'll try.
This really is a stop-gap measure. I want to be implementing the  
drawing of all the dialogs myself but need to get this out with a  
reasonable solution in the mean time.


Paul


On Apr 1, 2008, at 5:48 PM, Rob Napier wrote:

You can get what you're looking for by observing  
NSWindowDidBecomeKeyNotification or several of the others. Look at  
the Notifications section at the bottom of NSWindow's documentation.  
Should be something like


[[NSNotificationCenter defaultCenter] addObserver:self selector:...  
name:NSWindowDidBecomeKeyNotification object:nil];


object:nil means you want this notification no matter what window  
(of your application) posts it.


I'm surprised you need to capture the display this way though if  
you're going to put windows on top of it (rather than draw with  
Quartz). I'd be interested in what was causing you trouble. My  
experience is that sticking windows on top of a captured display is  
more hassle than it solves (hassles like this one). But I can  
imagine things going the other way.


-Rob

On Tue, Apr 1, 2008 at 8:27 PM, Paul FitzGerald <[EMAIL PROTECTED]>  
wrote:

Thanks Ricky, Kyle and Rob.
I do appreciate your comments, but none of this addresses my question.

I started working from TN2062 several months ago and only after a ton
of research and experimentation found that this alone does not meet my
needs (for reasons I won't get into here). I do, in fact, still have
the kiosk stuff outlined in that technote implemented and have the
GCaptureAllDisplays stuff on top of that.
Anyway, that's water under the bridge.

What I really want to know is how I can get notified when windows
become active in my app.

Paul


On Apr 1, 2008, at 4:53 PM, Ricky Sharp wrote:
>
> On Apr 1, 2008, at 6:29 PM, Kyle Sluder wrote:
>
> On Apr 1, 2008, at 3:46 PM, Paul FitzGerald wrote:
>>
>>> 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

>> 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/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 P

Deletion+processPendingChanges+transient attributes

2008-04-01 Thread Quincey Morris
I was surprised to see a Core Data object throw an exception during  
'processPendingChanges' because the object couldn't handle  
'setValue:nil forKey:'.


AFAICT, this happened under the following conditions:

-- the object had been inserted into the managed object context
-- the object had then been deleted from the context (some of the  
objects being created eventually get deleted)

-- no save had ever been done to the persistent store
-- 'processPendingChanges' was in the middle of faulting out the  
object that had been deleted
-- 'processPendingChanges' was trying to set every attribute of the  
object to nil
-- the attribute in question was of type 'undefined' and marked  
transient
-- there were custom accessors for the attribute's key that get and  
set it as a NSRect


(I don't think it matters how the object came to be deleted -- I  
suspect that the same exception would occur whenever it was deleted  
from the context. Also, the undefined/transient attribute with custom  
scalar/struct accessors is a standard Core Data coding pattern. I  
copied the code from the documentation.)


What's surprising about this is Core Data's apparent assumption that  
an 'undefined' attribute is nevertheless represented by some kind of  
Objective C object, and is therefore setting it to nil is safe.  
Clearly, in this case, there is no object and setting the attribute to  
nil is senseless, and I would have expected Core Data not to try  
anything tricky like this precisely because the attribute's type is  
'undefined'.


So is this to be regarded as a bug in Core Data? A bug in my  
understanding?


(I had earlier noticed and worked around a cousin to this issue: if a  
transient/undefined attribute is implemented by a managed object that  
can return nil for the corresponding key, then there's a validation  
error at save time if the attribute is not also marked optional.  
Again, if the attribute type is 'undefined', I would have expected  
Core Data to make no assumptions about how to interpret the value of  
the key.)



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 Dave Sopchak

Ah, a subject near and dear to my heart.

I agree with Rainer, UTIs can be deduced from file types, extensions  
and file creators, but I would sure like it if one could set a UTI for  
a document and have this take care of things, not the other way around.


Also, it certainly seems that UTIs do not do anything to function as  
creator codes. Maybe we need a Universal Creator Identifier as well ;)


I love Cocoa, but I absolutely hate file extensions. Sure, they're  
nice for compatibility with those "other" operating systems, but I get  
tired of


.jpg
.xcodeproj
.iMovieProject
.extensionskeepgettinglongerandlonger

I tried looking around both Carbon (where UTIs seemed to be embraced  
first for files) and Cocoa, and cannot find a reasonable way to set a  
file's UTI and forgetaboutit, so that it's recognized by the system as  
belonging to a specific application, without putting in an extension  
or type/creator code. UTIs are clearly an improvement over 32 bit type  
codes, but what do I have to do? Would the UTI be associated with the  
file's metadata? I think maybe, but in this case I would expect a  
specific way for the system to look for this and cannot find  
documentation to this end. It seems silly to have UTIs and have them  
serve in what seems to me a superfluous manner.


Any advice would be welcome.

I would love (LOVE!) Apple to allow me a way to use UTIs as an  
effective way to make file extensions optional, like in the good old  
days.


Thanks for any and all. Apologies for the rant.

Dave


On Apr 1, 2008, at 4:44 PM, Rainer Brockerhoff wrote:


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/d.sopchak%40comcast.net

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Southern California Coders?

2008-04-01 Thread Scott Ellsworth
On Tue, Apr 1, 2008 at 3:23 PM, Casey Becking <[EMAIL PROTECTED]> 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?

I run the Lake Forest chapter of Cocoaheads - our next meeting is next
Wednesday.  Topic is likely to be the iPhone, though I will know for
sure once I write the preso.

There is also an LA chapter if you are closer to SMO.

Scott
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


(SOLVED?) Re: yearly NSDraggingInfo -draggedImage question

2008-04-01 Thread Nathan Vander Wilt



On Mar 21, 2008, at 10:47 AM, Sherm Pendley wrote:


Well, the glib answer is that it returns whatever the dragging  
source passed as the first argument to - 
dragImage:at:offset:event:pasteboard:source:slideBack:.


Seriously though, I can't explain what you're seeing, but I can  
duplicate it. In my tests, I couldn't get anything other than NULL  
from -draggedImage for dragged files from either Finder or Xcode. I  
even tried pasting a custom icon onto a file, which made no  
difference. What I suspect is that both apps are passing NULL to the  
above method, and so that's what gets passed along to your app.


I finally got back into some drag and drop portions of my code, this  
time also programming my own drag source. In that case (when the drag  
source is the app itself) calling -[ draggedImage]  
produces a pointer to the image, as you describe above.


The interesting thing is that this image pointer is the same pointer  
as passed in. Since this is in the source application's address space,  
the dragging internals would have to make a copy in memory accessible  
from the dragging destination application's space for things to work.  
So I wonder if it doesn't just return nil in that case.


The window server does display this image when other apps are active  
though, and even in other Spaces. (But of course there's the  
obligatory Spaces SNAFU: if the drag is rejected the image zips to its  
original location but in the CURRENT space, instead of zipping off  
toward the space where it came from. Bug filed.) And of course, the  
big gaping hole in that theory is that the pasteboard data itself can  
be transferred between apps. This is done through the pasteboard  
daemon, so the dragging sender object would have to put the image into  
the NSPasteboard it has. Perhaps possible, but not likely.


Oh, and I apologize for the snarky tone of my first response. Thanks  
for being a good sport about it. :-)


No problem, I was pretty curt in my first post. I'd seen the same  
question go unanswered a few times before, so I guess I didn't want to  
waste time beating around the bush again. I was glad to just get a  
reply at first!


Maybe I've done enough handwaving above that someone can confirm or  
deny my allegations. I hypothesize that the image could be transferred  
between applications but the App Kit implementors never found it worth  
doing so. Thus it's the documentation that needs to be fixed to warn  
that -draggedImage: will likely return nil; the framework is behaving  
correctly.[/hypothesis]


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]


Re: Is there a Source List control in Cocoa

2008-04-01 Thread Markus Spoettl

On Apr 1, 2008, at 5:57 PM, Rob Keniger wrote:


http://developer.apple.com/samplecode/SourceView



Excellent, thanks Rob!

Regards
Markus
--
__
Markus Spoettl

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Is there a Source List control in Cocoa

2008-04-01 Thread Markus Spoettl

On Apr 1, 2008, at 5:50 PM, Rob Napier wrote:
It won't exactly match Mail or iTunes, but the new Leopard way of  
doing what you're talking about is to use an NSTableView or  
NSOutlineView and call:


   [tableView  
setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSurceList 
]



Great, thanks Rob!

Regards
Markus
--
__
Markus Spoettl

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Is there a Source List control in Cocoa

2008-04-01 Thread Rob Keniger


On 02/04/2008, at 10:45 AM, Markus Spoettl wrote:
 I'm new to all things Cocoa so please forgive me if this sounds  
stupid:


I'm looking for a way to implement a Source List / Sidebar (like in  
Mail or iTunes)? Is there something that comes with Xcode 3 (on  
Leopard) or does one have to do this by hand?


Any pointers much appreciated!



http://developer.apple.com/samplecode/SourceView

--
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: Is there a Source List control in Cocoa

2008-04-01 Thread Rob Napier
It won't exactly match Mail or iTunes, but the new Leopard way of doing what
you're talking about is to use an NSTableView or NSOutlineView and call:

   [tableView
setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSurceList]

-Rob

On Tue, Apr 1, 2008 at 8:45 PM, Markus Spoettl <
[EMAIL PROTECTED]> wrote:

> Hello,
>
>   I'm new to all things Cocoa so please forgive me if this sounds
> stupid:
>
> I'm looking for a way to implement a Source List / Sidebar (like in
> Mail or iTunes)? Is there something that comes with Xcode 3 (on
> Leopard) or does one have to do this by hand?
>
> Any pointers much appreciated!
>
> Thanks
> Markus
> --
> __
> Markus Spoettl
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> 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: KVO question on Tree Controllers

2008-04-01 Thread Rob Keniger


On 02/04/2008, at 5:11 AM, Jeff LaMarche wrote:
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?



I observe @"selectionIndexPaths" which seems to do the job.

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

2008-04-01 Thread Rob Napier
You can get what you're looking for by observing
NSWindowDidBecomeKeyNotification or several of the others. Look at the
Notifications section at the bottom of NSWindow's documentation. Should be
something like

[[NSNotificationCenter defaultCenter] addObserver:self selector:...
name:NSWindowDidBecomeKeyNotification object:nil];

object:nil means you want this notification no matter what window (of your
application) posts it.

I'm surprised you need to capture the display this way though if you're
going to put windows on top of it (rather than draw with Quartz). I'd be
interested in what was causing you trouble. My experience is that sticking
windows on top of a captured display is more hassle than it solves (hassles
like this one). But I can imagine things going the other way.

-Rob

On Tue, Apr 1, 2008 at 8:27 PM, Paul FitzGerald <[EMAIL PROTECTED]> wrote:

> Thanks Ricky, Kyle and Rob.
> I do appreciate your comments, but none of this addresses my question.
>
> I started working from TN2062 several months ago and only after a ton
> of research and experimentation found that this alone does not meet my
> needs (for reasons I won't get into here). I do, in fact, still have
> the kiosk stuff outlined in that technote implemented and have the
> GCaptureAllDisplays stuff on top of that.
> Anyway, that's water under the bridge.
>
> What I really want to know is how I can get notified when windows
> become active in my app.
>
> Paul
>
>
> On Apr 1, 2008, at 4:53 PM, Ricky Sharp wrote:
> >
> > On Apr 1, 2008, at 6:29 PM, Kyle Sluder wrote:
> >
> > On Apr 1, 2008, at 3:46 PM, Paul FitzGerald wrote:
> >>
> >>> 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
>
> >> 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/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: test if another app has hung

2008-04-01 Thread has

Martin Redington wrote:


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



Shouldn't do, as long as you check to see if the application is  
running first. That said, you may not want to use AppleScript itself  
as it has issues running in background threads and running it on the  
main thread will block your own app's main event loop. You could knock  
up your own code using AEBuildAppleEvent and AESendMessage, or here's  
one I did earlier with objc-appscript (NSThread stuff not included):



// To generate default glue: osaglue -o DefaultGlue

#import "DefaultGlue/ASDefaultGlue.h"
#define TARGET_APP_ID @"com.apple.finder"
#define TIMEOUT_IN_SECONDS 120

// Target the application
	ASDefaultApplication *app = [[ASDefaultApplication alloc]  
initWithBundleID: TARGET_APP_ID];

// Check if it's running
if ([app isRunning]) {
// Send no-op event
NSError *error;
[[[app launch] timeout: TIMEOUT_IN_SECONDS] sendWithError: 
&error];
OSStatus err = [error code];
/*
 * Check for unexpected termination or timeout error
 * (Note: event timeout should give error -1712 (errAETimeout),
 * but AESendMessage may return error -609 (connectionInvalid)
 * instead - another reason to check for both codes.
 */
if (err == connectionInvalid || err == errAETimeout)
NSLog(@"Unresponsive.");
else
NSLog(@"OK");
} else
NSLog(@"Not running.");
[app release];


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]


Is there a Source List control in Cocoa

2008-04-01 Thread Markus Spoettl

Hello,

  I'm new to all things Cocoa so please forgive me if this sounds  
stupid:


I'm looking for a way to implement a Source List / Sidebar (like in  
Mail or iTunes)? Is there something that comes with Xcode 3 (on  
Leopard) or does one have to do this by hand?


Any pointers much appreciated!

Thanks
Markus
--
__
Markus Spoettl

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 7:27 PM, Paul FitzGerald wrote:


Thanks Ricky, Kyle and Rob.
I do appreciate your comments, but none of this addresses my question.

I started working from TN2062 several months ago and only after a  
ton of research and experimentation found that this alone does not  
meet my needs (for reasons I won't get into here). I do, in fact,  
still have the kiosk stuff outlined in that technote implemented and  
have the GCaptureAllDisplays stuff on top of that.

Anyway, that's water under the bridge.

What I really want to know is how I can get notified when windows  
become active in my app.



But the reason you outlined you need that info is to force them  
forward in front of the captured display window.  That's the problem;  
you cannot mix AppKit with a captured display.


As I wrote, even if it works on your specific system (e.g. using the  
accessibility API to receive notifications), it may not work at all on  
others.


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

2008-04-01 Thread Martin Wierschin
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.


This is a bug that was introduced in Leopard that affects PDF and EPS  
images. I don't believe there's any way to coerce the attachment (or  
the NSImage even) to not use the cached (low quality) image data. You  
have to tell the NSImageRep draw itself directly to avoid the issue.


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.


Pages uses WebKit, not NSTextView and friends.

~Martin

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 Paul FitzGerald

Thanks Ricky, Kyle and Rob.
I do appreciate your comments, but none of this addresses my question.

I started working from TN2062 several months ago and only after a ton  
of research and experimentation found that this alone does not meet my  
needs (for reasons I won't get into here). I do, in fact, still have  
the kiosk stuff outlined in that technote implemented and have the  
GCaptureAllDisplays stuff on top of that.

Anyway, that's water under the bridge.

What I really want to know is how I can get notified when windows  
become active in my app.


Paul


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


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

On Apr 1, 2008, at 3:46 PM, Paul FitzGerald wrote:


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



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]


Problems with custom NSScrollView/ NSTableView

2008-04-01 Thread mike woodworth


Hey all,

I've made a whole set of custom controls, including custom  
NSScrollers, a NSScrollVIew to use them in, and an NSTableView based  
off these.  What I can't figure out is my table is set to show  
Scrollers when needed, but when they appear, I get a white corner  
where the two Scrollers meet (in the bottom right of my table).


How can I draw in this space?

mike
--
Mike Woodworth
[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 Jerry Krinock

On 2008 Apr, 01, at 16:53, Martin Redington wrote:

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.


The reason why you want to avoid NSTask whenever possible is because  
the more interfaces you have to jump through, the more things can go  
wrong and give you extra work to do, as you have just experienced.   
Use well-defined API wherever available.  Your projects will complete  
closer to their scheduled date and be less likely to break in the field.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: core data and sqlite db store problem

2008-04-01 Thread Adam Swift


On Mar 31, 2008, at 10:23 AM, Scott Guyer wrote:


Thanks Jeff,

 That would explain it.  Crikey...whole lotta Zs in the CD created  
SQLite schema.  :)


In XCode, there is an Design -> Data Model -> Import... menu item.   
It is looking to import an XML file of a particular format.  Any  
pointers to this format?  Could this be a way for me to bootstrap  
data into my CD created SQLite DB file?




The Design -> Data Model -> Import... menu item can be used to import  
a schema from a compiled datamodel file (eg. MyModel.mom) into a data  
model design document (MyModel.xcdatamodel).  There's no direct  
support for importing data from external data sources (raw sqlite  
files, etc).



Thanks again.


On Mar 31, 2008, at 12:51 PM, Jeff LaMarche wrote:

Core data stores metadata as well as data in the sqlite3 file and  
follows a very specific naming convention for the regular data  
tables and columns. You'd probably be better off writing a small  
migration utility to import the data you need than to try create a  
sqlite3 database in the right format. Also, if you use this  
mechanism, when you distribute your app, none of that data will go  
with it.


Why don't you move out your sqlite3 file and let it create a new  
one, then go in and look at the tables and structure, and you'll  
get an idea of what I'm talking about.


HTH
Jeff
On Mar 31, 2008, at 12:45 PM, Scott Guyer wrote:


Hi,

I'm just learning core data and have already stumbled on  
something.  I created a CD application using the XCode template.   
I've created a sqlite3 .db file with data and a matching core data  
model in xcode.  My code fails here...


 url = [NSURL fileURLWithPath: [applicationSupportFolder  
stringByAppendingPathComponent: @"my.db"]];
 persistentStoreCoordinator = [[NSPersistentStoreCoordinator  
alloc] initWithManagedObjectModel: [self managedObjectModel]];
 if (![persistentStoreCoordinator  
addPersistentStoreWithType:NSSQLiteStoreType configuration:nil  
URL:url options:nil error:&error]){

 [[NSApplication sharedApplication] presentError:error];
 }

with an error saying that the db file cannot be opened because it  
is not in the right format.  "The file might be corrupted,  
truncated, or in a different format than you expect."  That's  
quite odd to me, since I can interact with that db file on the  
command line using sqlite3 just fine.  Anyone have any ideas/ 
suggestions?


Much appreciated!

___

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

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

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

This email sent to [EMAIL PROTECTED]




___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aswift%40apple.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]


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

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


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]


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


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


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]


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]


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]


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]


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

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


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


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


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


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


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


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]


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


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]

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]


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]


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


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

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


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]


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

  1   2   >