scaling a transformed view

2011-04-20 Thread Alexander Cohen
Hi,

I've come upon a problem i can't seem to get my head around. I have a view that 
has a rotation transform on it and i need to be able to pull at one of it's 
corners and scale the view based on the amount pulled. I also need to keep the 
opposite corner of the pulled corner pinned to it's location. Does anyone have 
any pointers or sample code that might point me in the right direction?

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


Re: inter-process locks

2011-02-19 Thread Alexander Cohen
Yeah, that seems like a good option but since its based off of flock, it has 
the same issues. Things like apps crashing or not unlocking by error will 
prevent other processes from obtaining the lock even though the lock is not 
'really' in use anymore.

AC

On Feb 19, 2011, at 1:58 PM, Michael Babin wrote:

> On Feb 19, 2011, at 12:29 PM, Alexander Cohen wrote:
> 
>> Is there anyway to do interprocess locks using cocoa ( like a Mutex in Win32 
>> )? The best i've found is not cocoa and uses flock but the man pages say its 
>> advisory only which is kindof scary.
> 
> NSDistributedLock:
> <http://developer.apple.com/library/mac/#documentation/cocoa/reference/Foundation/Classes/NSDistributedLock_Class/Reference/Reference.html>
> 
> Although I've never used it in practice. The current project I'm working on 
> uses a scheme based on flock.
> 


The information contained in this e-mail and any accompanying attachments may 
contain information that is privileged, confidential or otherwise protected 
from disclosure. If you are not the intended recipient of this message, or if 
this message has been addressed to you in error, please immediately alert the 
sender by reply e-mail and then delete this message and any attachments. Any 
dissemination, distribution or other use of the contents of this message by 
anyone other than the intended recipient is strictly prohibited. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email or any attachments.
___

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

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

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

This email sent to arch...@mail-archive.com


inter-process locks

2011-02-19 Thread Alexander Cohen
Hello,

Is there anyway to do interprocess locks using cocoa ( like a Mutex in Win32 )? 
The best i've found is not cocoa and uses flock but the man pages say its 
advisory only which is kindof scary.

any help appreciated.

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


localizing a cmd line app

2011-01-26 Thread Alexander Cohen
Does anyone have any pointers on localizing a cmd line app? Like how can i have 
different Localizable.strings for different languages in the cmd line app? I 
know i could use a bundle specifically for this but that seems like a bit too 
much.

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


Re: bouncing an NSScrollView like UIScrollView

2010-11-06 Thread Alexander Cohen

On Nov 6, 2010, at 7:02 PM, Kyle Sluder wrote:

> On Nov 6, 2010, at 3:41 PM, Alexander Cohen  wrote:
> 
>> Has anyone tried getting the NSScrollView to bounce around when it hits the 
>> content edges just like the UIScrollView does? Is there any open source code 
>> out there that might do this or at least point me in the right direction?
> 
> Why would you want to do this? This isn't how NSScrollViews behave.
> 
> Well, yet, anyway. There were hints of iOS-ness in scrollviews in the demo of 
> Lion last month. Perhaps you should hold off on this and see what things look 
> like when Apple starts shipping 10.7 betas.

An app i am  working on needs this effect. It's not to complicated to do but it 
is complicated to get it right and the way poeple expect it work. So instead of 
reinventing the wheel, i wanted to check and make sure nothing existed already.

AC___

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

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

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

This email sent to arch...@mail-archive.com


bouncing an NSScrollView like UIScrollView

2010-11-06 Thread Alexander Cohen
Has anyone tried getting the NSScrollView to bounce around when it hits the 
content edges just like the UIScrollView does? Is there any open source code 
out there that might do this or at least point me in the right direction?

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


Re: Choosing a correct font size when resizing

2010-10-26 Thread Alexander Cohen
Thats an interesting take, let me try that.

thx

AC

On Oct 26, 2010, at 11:07 AM, Ross Carter wrote:

> On Oct 26, 2010, at 10:29 AM, Alexander Cohen wrote:
> 
>> I have a specific layout that has known font sizes for certain page 
>> dimensions. I need to take that layout and resize it to fit it in multiple 
>> different places in my app. I can't just apply that resize ratio to the 
>> fonts, it just does not work. Is there a known way in cocoa to figure out 
>> the correct ratio for a font when resizing it so it fits within the rest of 
>> my layout and gives me same look but resized.
> 
> I'm not sure I understand the question, but you might trying scaling, with 
> either NSAffineTransform or adjusting the view bounds.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/alexcohen%40toomuchspace.com
> 
> This email sent to alexco...@toomuchspace.com

___

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

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

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

This email sent to arch...@mail-archive.com


Choosing a correct font size when resizing

2010-10-26 Thread Alexander Cohen
Hi,

I have a specific layout that has known font sizes for certain page dimensions. 
I need to take that layout and resize it to fit it in multiple different places 
in my app. I can't just apply that resize ratio to the fonts, it just does not 
work. Is there a known way in cocoa to figure out the correct ratio for a font 
when resizing it so it fits within the rest of my layout and gives me same look 
but resized.

I could just create an image and resize that and display it in a ImageView but 
this seems to me like a waste of resources especially when ported to iOS.

Any help appreciated,

thx
AC___

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

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

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

This email sent to arch...@mail-archive.com


Re: Framework Major versions

2010-10-18 Thread Alexander Cohen
Thanks Nick, this will help a lot, i don't think its explained anywhere in the 
docs. You are spot on for why i need to do it. We've got some very old software 
that relies on things that have been deprecated for a long time and now we need 
to remove them. I think the best option is to rev the major version.

AC

On Oct 18, 2010, at 8:12 PM, Nick Zitzmann wrote:

> 
> On Oct 18, 2010, at 4:50 PM, Alexander Cohen wrote:
> 
>> I'm about to make a change in the Major version of a framework ( new version 
>> will be B ). I've read through the docs and all but i'm not sure i 
>> understand how to set it up so i keep version A in my build but also build 
>> the new version B.
>> 
>> Has anyone done this
> 
> Yes.
> 
>> and what should i do? 
> 
> You need to either move version A off to a separate project with the same 
> target, or clone the target in the same project, with a new major version & 
> its associated changes. Then you build both targets, and the framework 
> versions will be merged with the same bundle. I think the "current" symlink 
> is set to whatever version was built most recently.
> 
> Keep in mind that framework versioning is usually unnecessary, unless you 
> have added variables to a fragile superclass, or if you've removed some 
> obsolete stuff that might still be in use by old code, or if a bug fix in the 
> framework is causing regressions in existing apps, or something similar. IOW, 
> you probably don't need to do this if you added new content, or if the 
> framework is private & you also own the dependencies. So it would help to 
> know why you want to do this...
> 
> Nick Zitzmann
> <http://www.chronosnet.com/>
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/alex%40toomuchspace.com
> 
> This email sent to a...@toomuchspace.com

___

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

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

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

This email sent to arch...@mail-archive.com


Framework Major versions

2010-10-18 Thread Alexander Cohen
Hello,

I'm about to make a change in the Major version of a framework ( new version 
will be B ). I've read through the docs and all but i'm not sure i understand 
how to set it up so i keep version A in my build but also build the new version 
B.

Has anyone done this and what should i do? Should i just keep A around and add 
it in a run script build phase?

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


CFSockets callbacks not firing when menus are being tracked in cocoa app

2010-09-20 Thread Alexander Cohen
Hi,

I have a cocoa app that uses a library which uses CFSockets. Those sockets run 
loop sources are added to all known run loop modes ( common, default, event 
tracking and modal ). I would expect that the socket callbacks would fire 
during menu tracking but they dont. Is this a know issues, by design or is it 
just not possible?

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


NSView alphaValue animation on 10.5

2010-09-08 Thread Alexander Cohen
Hi,

I've got a lot of code that depends on 10.6's use of NSView's animator and 
setAlphaValue for showing and hiding animations. Now, i need to bring this to 
10.5. On 10.5, to animate the alphaValue, i learnt that the NSView needs to be 
backed by a layer. I tried doing that and it created mayhem, so i don't think i 
can go that route. I could use NSViewAnimation but that would create 2 sets of 
code and i'd rather just stick with [[view animator] setAlphaValue:val]. Does 
anyone have any idea how to get something working without having to if/else all 
these calls?

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


Resizing and NSImage to a new NSImage but keeping all metadata

2010-08-30 Thread Alexander Cohen
Hi,

I need to take an NSImage, scale it down a bit while drawing it into an new 
NSImage and all along keep all the metadata associated with the original image 
( such as the color profile, etc, ... ). Are there any example out there that 
show how to do this.

I've tried creating a new NSImage of the correct size, adding a new bitmap rep 
to it ( that already has the copied metadata ) then drawing into that image but 
i always end up with an NSImage that does not have my bitmap rep in it anymore 
but only a CGImageCachedRep ( or somthing similar to that class name ) that 
does not contain the metadata anymore.

Any help appreciated.

thx

AC


___

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

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

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

This email sent to arch...@mail-archive.com


overriding every method of an object

2010-07-16 Thread Alexander Cohen
Hello,

Is there a way for a subclass to override every method of its superclass?

thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


Re: Finding Application support folder without Cocoa or Carbon

2010-07-12 Thread Alexander Cohen
Beautiful, thank you.

AC

On Jul 12, 2010, at 4:21 PM, Kevin Perry wrote:

> You can use the C API in /usr/include/NSSystemDirectories.h.
> 
> On Jul 12, 2010, at 1:17 PM, Alexander Cohen wrote:
> 
>> Hello,
>> 
>> I need to find the system Application Support folder without using either 
>> Carbon or Cocoa, i can use CoreFoundation though. Is there a way to do this?
>> 
>> thx
>> 
>> AC___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/kperry%40apple.com
>> 
>> This email sent to kpe...@apple.com
> 

___

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

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

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

This email sent to arch...@mail-archive.com


Finding Application support folder without Cocoa or Carbon

2010-07-12 Thread Alexander Cohen
Hello,

I need to find the system Application Support folder without using either 
Carbon or Cocoa, i can use CoreFoundation though. Is there a way to do this?

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


Re: changes to NSView's frame in its window

2010-06-23 Thread Alexander Cohen
Wow, nice to know. Probably not a good idea to count on it though, right?

AC

On Jun 23, 2010, at 3:38 PM, Michael Ash wrote:

> On Wed, Jun 23, 2010 at 1:33 PM, Alexander Cohen  
> wrote:
>> Hello,
>> 
>> I have a view in an NSScrollView's document view that has a small child 
>> window attached to it, meaning the window follows that view wherever it 
>> goes. But when i scroll the scrollview, not much changes for that view. So 
>> i'm wondering if there is anyway to get changes to a views "global" frame. 
>> If i'm missing something obvious, please do tell.
> 
> This is not exactly what it's intended for, but if you override
> -resetCursorRects, it'll be called any time your view moves within its
> window.
> 
> 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/alex%40toomuchspace.com
> 
> This email sent to a...@toomuchspace.com

___

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

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

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

This email sent to arch...@mail-archive.com


changes to NSView's frame in its window

2010-06-23 Thread Alexander Cohen
Hello,

I have a view in an NSScrollView's document view that has a small child window 
attached to it, meaning the window follows that view wherever it goes. But when 
i scroll the scrollview, not much changes for that view. So i'm wondering if 
there is anyway to get changes to a views "global" frame. If i'm missing 
something obvious, please do tell.

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


NSAttributedString with columns

2010-06-14 Thread Alexander Cohen
Hello,

I would like to use an NSAttributed string in order to render a type of 
key/value 2 column display in a NSTextField. As of now, i'm using tabs between 
key's and value's on each line but some values need to wrap to the next line 
and i would like them to wrap to the start of value column and not wrap all the 
way to the beginning og the new line. Is this possible using attributes and an 
NSAttaributedString. Heres an example:

- The results i get:
key value
key 
key value

-- What i want:
key value
key 
key value



thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


Not responding in activity viewer

2010-03-02 Thread Alexander Cohen
Hello,

I've got a very simple launch Agent that always shows up as not-responding in 
the activity monitor on 10.4 and 10.5 This is issue does not happen on 10.6. 
The app is very simple and does not do much. It has no UI but does link against 
Carbon since it uses GetNextProcess. It has 2 threads, the main thread which 
pretty much just sits there in the main runLoop, and the other that does some 
work then sleeps for 2 seconds and repeats.

Here some code:

void*
otherThread()
{
while (1)
{
doSOmeStuff()
sleep(2);
}

return NULL;
}

int
main( int argc, char* argv[] )
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];

startOtherThread();

[[NSRunLoop currentRunLoop] run];

[pool release];
}

Any ideas why my app appears non-responsive to the activity monitor?

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


Re: cross-process file open notifications

2010-02-03 Thread Alexander Cohen
Unfortunately, the files i need to watch could be anywhere on the system. So i 
would need something more like a filename only watch and not a complete path.

AC

On Feb 3, 2010, at 6:15 PM, Jerry Krinock wrote:

> 
> On 2010 Feb 03, at 14:28, Jens Alfke wrote:
> 
>> FSEvents notifies you when a particular directory (or anything inside it) 
>> changes.
> 
> Or, preferably, if your process does not need to be running to do other 
> stuff, you could set up a launchd task to watch a particular directory and 
> launch your process when anything in it changes.
> 
> http://developer.apple.com/MacOsX/launchd.html
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/alex%40toomuchspace.com
> 
> This email sent to a...@toomuchspace.com

___

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

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

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

This email sent to arch...@mail-archive.com


Re: cross-process file open notifications

2010-02-03 Thread Alexander Cohen
I can't put any code into the dylib. It's library that's not being developed 
anymore but many users have it and use it. We have a new approach but the dylib 
has a sort of lock on some things we need. Because of this, we've decided to 
watch for usage of this dylib and when there is no usage, we can enable our new 
approach. As of now, all i can do is poll for new processes and run lsof on the 
to see what files they are using. I consider this approach very bad but i can't 
think of anything better.

AC

On Feb 3, 2010, at 5:28 PM, Jens Alfke wrote:

> 
> On Feb 3, 2010, at 1:50 PM, Alexander Cohen wrote:
> 
>> Is there any way in cocoa to get some sort of notifications when any process 
>> opens or closes any file?
> 
> I'm pretty sure there isn't. The rate at which those notifications were sent 
> would be pretty horrific (ever run fs_usage on all processes?) Even the 
> private file notification firehose that's consumed by Spotlight only tracks 
> modifications, not opening.
> 
>> The reason i need this is because i need to watch the system and do a 
>> certain task every time a particular dylib is loaded by an application.
> 
> Can you put code into the dylib itself that will do this? Like a +load method?
> 
> 
> On Feb 3, 2010, at 1:57 PM, Dave Carrigan wrote:
> 
>>> The FSEvents API is most likely what you're looking for.
>> Come to think of it, FSEvents might not tell you about files being opened, 
>> so it might not be exactly what you want, after all.
> 
> No, FSEvents notifies you when a particular directory (or anything inside it) 
> changes.
> 
> —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/alex%40toomuchspace.com
> 
> This email sent to a...@toomuchspace.com

___

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

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

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

This email sent to arch...@mail-archive.com


cross-process file open notifications

2010-02-03 Thread Alexander Cohen
Is there any way in cocoa to get some sort of notifications when any process 
opens or closes any file? The reason i need this is because i need to watch the 
system and do a certain task every time a particular dylib is loaded by an 
application.

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


Julian date

2010-01-07 Thread Alexander Cohen
Hello,

How should i go about creating a NSDate object from a julian date 
NSTimeInterval.

thx

AC___

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

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

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

This email sent to arch...@mail-archive.com


NSCoder and CGColorRef

2009-11-05 Thread Alexander Cohen

How would one go about encoding a CGColorRef into a NSCoder?

thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


Ruby Grammar for TDParseKit

2009-11-02 Thread Alexander Cohen

Hello,

Has anyone created a grammar file for Ruby for use with TDParseKit.  
Seems like thats pretty much the best option out there ( it rocks ),  
but i'd rather check for a grammar file before i start a new one.


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


Re: waiting for async callback in main thread

2009-10-27 Thread Alexander Cohen


On Oct 27, 2009, at 3:42 PM, Jens Alfke wrote:



On Oct 27, 2009, at 12:11 PM, Alexander Cohen wrote:

100% agree with you, and that's what i would normally do. But  
unfortunately, this time i must wait in the mainthread for the  
callback. I know it's wrong, but this time i've gotta do it.


Then use a while loop to run the runloop until your callback's been  
invoked. The reason this is described as wrong is because it blocks  
the main thread; but if you have to block the main thread, this is  
the way to do it.


Excellent. I remember reading somewhere that because of changes in  
10.6 to the way the runLoop works, it was a bad idea to do this. But  
for now its working and until someone tells me otherwise, this'll do.


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


Re: waiting for async callback in main thread

2009-10-27 Thread Alexander Cohen


On Oct 27, 2009, at 2:04 PM, Jens Alfke wrote:



On Oct 27, 2009, at 10:40 AM, Alexander Cohen wrote:

Now, i would like to be able to wait for that callback on the main  
thread like this:


[object addObserverForCallback]
... wait for callback ...
continue on processing with the state of the object

The only way i see i can do that is by running the NSRUnLoop myself  
but if i understand correctly, it is wrong to do that. So i guess  
my question is what is the corect way to wait in the main thread  
without stopping the NSRunLoop?


It's actually wrong (in most cases) to wait in the main thread at  
all. Blocking the main thread prevents events from being handled and  
results in the dreaded beachball cursor.


What you should be doing instead is structuring your code  
asynchronously. Set up the callbacks, then keep the app running  
normally and handle the callbacks when they occur. It's definitely a  
bit more complex to code this way, but it keeps your app responsive  
while avoiding the greater complexity of multi-threading.


100% agree with you, and that's what i would normally do. But  
unfortunately, this time i must wait in the mainthread for the  
callback. I know it's wrong, but this time i've gotta do it.


AC
___

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

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

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

This email sent to arch...@mail-archive.com


waiting for async callback in main thread

2009-10-27 Thread Alexander Cohen

Hi,

I'm working with and SDK that lets me observe objects. When the state  
of the object changes i receive a callback. The docs for the SDK say  
that the main NSRunLoop needs to stay active and responsive for me to  
receive the callbacks. Now, i would like to be able to wait for that  
callback on the main thread like this:


[object addObserverForCallback]
... wait for callback ...
continue on processing with the state of the object

The only way i see i can do that is by running the NSRUnLoop myself  
but if i understand correctly, it is wrong to do that. So i guess my  
question is what is the corect way to wait in the main thread without  
stopping the NSRunLoop?


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


Re: watch changes to any properties on an object

2009-09-03 Thread Alexander Cohen


On Sep 3, 2009, at 3:44 PM, Quincey Morris wrote:


On Sep 3, 2009, at 12:14, Alexander Cohen wrote:

Ah, ok, this is more like what i wanted to hear! :) I understand  
how @dynamic works, but how to I get to funnel all calls to  
@dynamic properties to the same call such as setValue:forKey: or  
something like that where i can parse the key and update my  
internal data and set the flags i need to set.


No, you're barking up the wrong tree.

There's no "how @dynamic works". @dynamic is a compiler directive  
telling it that getter/setter method implementations exist, but just  
not in the current compilation unit. There no standard general  
mechanism for supplying the implementation.


In the case of Core Data specifically, the built-in implementations  
(call them "dynamic" if you want, but that's the same as their being  
compiled as "@dynamic") are simply efficient versions of what you  
would otherwise have to hand-code. We don't know if they're funneled  
through one funnel, several funnels, or a different function for  
every property -- that's an implementation detail.


(IAC, Core Data doesn't mark objects as changed in *those* dynamic  
methods, but (presumably -- another implementation detail) in the  
primitive dynamic methods.)


I don't how you're ever going to be able to have a class detect  
invocations of its subclasses' properties, unless you have the class  
muck around in the runtime, replacing methods on the fly.


A better solution, IMO, is to realize that you're considering a  
design requirement for your data model, and to design the solution  
right into the model. For example, if this is a self-contained class  
hierarchy that you're implementing, you could make it a requirement  
of subclasses that they invoke something (a superclass method) or  
inform something (a controller of some kind) when they modify data  
values.


I'm with you. I've realized that's the way to go. Concerning CoreData,  
i was looking for info or ideas on the implementation details. thx for  
the info.


AC
___

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

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

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

This email sent to arch...@mail-archive.com


Re: watch changes to any properties on an object

2009-09-03 Thread Alexander Cohen
Overriding willChangeValueForKey: was one of the first things i tried  
before posting and I noticed it was not being called, i thought it was  
weird but nothing more. Good to know that overriding it was  
deprecated. Thx for the info on how CoreData manages it's saves. I was  
hoping to not have to create setters for all the values that can  
change my dirty flag but i guess ill have to. I guess what i'm looking  
for is a method like setSelector:forChangesOnProperties:.


thx

AC

On Sep 3, 2009, at 3:30 PM, Ben Trumbull wrote:

Well, @dynamic doesn't have anything to do with KVO.  It's just  
storage and accessors for properties.  Core Data knows when non- 
dynamic modeled properties change too.  It sets a dirty flag, just  
as you would have to.  Most of that happens in - 
willChangeValueForKey:.  Unfortunately, overriding that method was  
deprecated in 10.5.  KVO no longer guarantees overrides will be  
called.


In terms of knowing what to save, Core Data only tracks that at an  
object level, and uses snapshot deltas to compute the changed  
property set at the end.


Some people invert the observing relationship to work around this.   
You can add code in your setters to set a dirty flag, or within your  
setters manually call a notify method on another object.  If you  
have fewer objects, you could just use NSNotifications.


Almost certainly worth filing an enhancement request at bugreport.apple.com

- Ben


Ok, thats what i thought. But just for implementation ideas, how does
CoreData know when one of it's @dynamic properties is changed? It  
must

set some sort of flag somewhere in order to know what to write out
when it needs to save. How does it handle that?

thx

AC

On Sep 3, 2009, at 12:27 PM, Jens Alfke wrote:



On Sep 3, 2009, at 8:24 AM, Alexander Cohen wrote:


I have a base object that needs to know when any of it's properties
or subclasses properties have changed and set a dirty flag on
itself. Is there a way to do this?


No, not in general. Key-value observing requires knowing the exact
property name(s) in advance. You'll need to set the 'dirty' flag
manually.

˜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/alexcohen%40toomuchspace.com

This email sent to alexco...@toomuchspace.com


___

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

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

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

This email sent to arch...@mail-archive.com


Re: watch changes to any properties on an object

2009-09-03 Thread Alexander Cohen
Ah, ok, this is more like what i wanted to hear! :) I understand how  
@dynamic works, but how to I get to funnel all calls to @dynamic  
properties to the same call such as setValue:forKey: or something like  
that where i can parse the key and update my internal data and set the  
flags i need to set.


thx

AC

On Sep 3, 2009, at 2:43 PM, Jens Alfke wrote:



On Sep 3, 2009, at 11:32 AM, Alexander Cohen wrote:

Ok, thats what i thought. But just for implementation ideas, how  
does CoreData know when one of it's @dynamic properties is changed?  
It must set some sort of flag somewhere in order to know what to  
write out when it needs to save. How does it handle that?


@dynamic properties are assigned implementations on the fly at  
runtime. NSManagedObject's implementation of the setter method  
includes setting the dirty flag, I suppose.


So actually my "no" wasn't strictly true. You can track changes to  
arbitrary dynamic properties, including those defined in subclasses,  
because they all funnel through a common implementation.


—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/alexcohen%40toomuchspace.com

This email sent to alexco...@toomuchspace.com


___

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

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

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

This email sent to arch...@mail-archive.com


Re: watch changes to any properties on an object

2009-09-03 Thread Alexander Cohen
Ok, thats what i thought. But just for implementation ideas, how does  
CoreData know when one of it's @dynamic properties is changed? It must  
set some sort of flag somewhere in order to know what to write out  
when it needs to save. How does it handle that?


thx

AC

On Sep 3, 2009, at 12:27 PM, Jens Alfke wrote:



On Sep 3, 2009, at 8:24 AM, Alexander Cohen wrote:

I have a base object that needs to know when any of it's properties  
or subclasses properties have changed and set a dirty flag on  
itself. Is there a way to do this?


No, not in general. Key-value observing requires knowing the exact  
property name(s) in advance. You'll need to set the 'dirty' flag  
manually.


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


watch changes to any properties on an object

2009-09-03 Thread Alexander Cohen

Hello,

I have a base object that needs to know when any of it's properties or  
subclasses properties have changed and set a dirty flag on itself. Is  
there a way to do this?


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


Re: microsoft file formats in cocoa

2009-05-17 Thread Alexander Cohen
I've looked at the file format spec a bit and i'm not sure i really  
want to get into it. It's something like 200 pages long.


thx

AC

On May 17, 2009, at 6:27 AM, Тимофей Даньшин wrote:

TextEdit doesn't render quite a lot of things in doc files, such as  
footnotes, headers/footers, comments and lots of other things.

I've tried to find a library that would do that, but failed.

If you do find anything like that (or reinvent it for that  
matter ;) ), please, let me know as well.


Timofey

On May 17, 2009, at 10:37 AM, Thomas Davie wrote:



Op 17 May 2009, om 02:02 heeft Alexander Cohen het volgende  
geschreven:


Does anyone know of any libraries that can read microsoft formats  
( xls, ppt, doc, etc, ... )? I'd rther not reinent the wheel if  
something is already out there.


For .doc, go look at the TextEdit sources - it's in the sample code.

Bob
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/ok5.admin 
%40gmail.com


This email sent to ok5.ad...@gmail.com




___

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

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

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

This email sent to arch...@mail-archive.com


microsoft file formats in cocoa

2009-05-16 Thread Alexander Cohen
Does anyone know of any libraries that can read microsoft formats  
( xls, ppt, doc, etc, ... )? I'd rther not reinent the wheel if  
something is already out there.


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


Re: NSRunLoop / CFRunLoop

2009-02-13 Thread Alexander Cohen




Le 13 févr. 09 à 21:54, Alexander Cohen a écrit :


Hi,

Not sure if this is the right place to ask since my question is  
about CFRunLoop, not Cocoa but CoreFoundation. If not, please  
direct me to the right list.


I'm looking for a way to get the main CFRunLoop on tiger. On  
leopard, there is a simple call for it but i'm stuck with tiger for  
now. And while i'm at it, i'd like to do something like [obj  
performSelectorOnMainThread...] in CoreFoundation using CFRunLoops.  
I'm sure it's possible but i'm not sure where to start.


thx


To get the main runloop, you can save it in a global variable at  
program startup, and return it when requested.


There is no easy way to mimic performSelectorOnMainThread: as there  
is no easy way to serialize a function call (unlike in Cocoa where  
you can easily serialize a method call using NSInvocation to send it  
on the main thread).


To do inter-thread messaging using only low-level frameworks, you  
are stuck with the traditional facilities (socket, pipes, etc.)


Just by curiosity, what prevent you to use the Foundation framework ?


I'm in some C++ code and cannot use Foundation, only CF. I did find a  
solution though. The solution is to create a RunLoopSource and pass it  
an object ( C++ ) that knows what function to call in it's context.  
When the source is signaled, i'm in the main thread ( cause i added it  
to the main thread's RunLoop ), works like a charm. Is this something  
that is good or am I doing this all wonrg? :)


thx
AC___

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

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

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

This email sent to arch...@mail-archive.com


NSRunLoop / CFRunLoop

2009-02-13 Thread Alexander Cohen

Hi,

Not sure if this is the right place to ask since my question is about  
CFRunLoop, not Cocoa but CoreFoundation. If not, please direct me to  
the right list.


I'm looking for a way to get the main CFRunLoop on tiger. On leopard,  
there is a simple call for it but i'm stuck with tiger for now. And  
while i'm at it, i'd like to do something like [obj  
performSelectorOnMainThread...] in CoreFoundation using CFRunLoops.  
I'm sure it's possible but i'm not sure where to start.


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


NSScrollView begin/end scrolling

2009-01-06 Thread Alexander Cohen

Hi,

Is there a way to get notified of when a scrollView begins and ends a  
scrolling session?


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


NSCoding, objects that can

2008-12-23 Thread Alexander Cohen
Hi, i have a class that contains an NSDictionary. That dictionary is  
encoded in encodeWithCoder:. Once in a while, a user might put in  
something liek a CGColorSpaceRef or something similar and everything  
stops working. Is there a way to find out if bjects in the dictionary  
can actually be encoded. Keep in mind that they might not always be  
Obj-C objects. I guess i'm looking for a ObjecTypeCanBeEncoded method  
or something like that.


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


NSCoding, objects that can

2008-12-23 Thread Alexander Cohen
Hi, i have a class that contains an NSDictionary. That dictionary is  
encoded in encodeWithCoder:. Once in a while, a user might put in  
something liek a CGColorSpaceRef or something similar and everything  
stops working. Is there a way to find out if bjects in the dictionary  
can actually be encoded. Keep in mind that they might not always be  
Obj-C objects. I guess i'm looking for a ObjecTypeCanBeEncoded method  
or something like that.


thx

AC
___

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

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

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

This email sent to arch...@mail-archive.com


NSArrayController and moving around its contents.

2008-12-08 Thread Alexander Cohen
I have a custom view that pretty much shows an ordered list of items  
in a grid ( kindof like iPhoto ). This custom view exposes a content  
binding. Items in this grid can be reordered by drag n drop. Then this  
occurs, i have an NSIndexSet of selected indexes and a drop index  
where i need to move all the items to. Whats the best way to do this?  
If i just had a normal array, it would be easy just by removing and  
adding them back in the right place. But with the array controller, if  
i remove then add back in i get two content changes which could  
possibly make the view flickr since on content changes, there is some  
fade in and moving animations. Am i missing something obvious like a  
moveObjectsAtIndexes:toIndex: ?


thx

AC
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSArray represented in 2 different views at same time

2008-12-08 Thread Alexander Cohen

Hi,

I've got a list of objects in an NSArray and i'm currently managing  
them with an NSArrayController and a view that is binded to it. Now i  
need to be able to show that same view in a new window with the same  
content but with possibly different selections and sort descriptors. I  
also need to update the content display in both views when an item is  
added or removed. I guess the closest approach i can think of is  
iTunes when you double click an item in its source list and it opens  
up a new window with the same content.


My question is how should I approach this. Should i have an array  
controller for each view and have them notify each other of changes?  
Does anyone have any experience with this sort of workflow and if so,  
how did you manage all of this.


thx

AC
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSArrayController trouble

2008-11-30 Thread Alexander Cohen
Hi, Im getting the following line in the console when sending the  
'removeObjectsAtArrangedObjectIndexes:' message to an  
NSArrayController instance.


-[NSCFArray removeObjectAtIndex:]: mutating method sent to immutable  
object


I understand what it means but i'm not sure why it's happening. Is  
there anything i need to set up in order for the contents of the  
arrayController to be mutable?


thx

AC
___

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

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

2008-11-19 Thread Alexander Cohen
Excellent. I did read the docs but i guess i stopped reading before  
the end of the page.


thx

AC

On Nov 19, 2008, at 10:24 AM, Etienne Guérard wrote:


Did you read the documentation reference for NSWindow?

NSWindowDidChangeScreenNotification
Posted whenever a portion of an NSWindow object's frame moves onto  
or off of a screen.


NSWindowDidChangeScreenProfileNotification
Posted whenever the display profile for the screen containing the  
window changes.


Beware that those notifications are effective on 10.4 only.

EG


Is there a callback available when the display profile is changed by
the user or programmatically? Also, is there a calllabck available
when the user drags a window between different screens?



This message and any attachments (the "message") are confidential  
and intended solely for the addressee(s). Any unauthorised use or  
dissemination is prohibited. E-mails are susceptible to alteration.  
Neither DxO Labs nor any of its subsidiaries or affiliates shall be  
liable for the message if altered, changed or falsified.
Ce message et toutes les pieces jointes (ci-apres le "message") sont  
confidentiels et etablis a l'intention exclusive de ses  
destinataires. Toute utilisation ou diffusion non autorisee est  
interdite. Tout message electronique est susceptible d'alteration.  
DxO Labs et ses filiales declinent toute responsabilite au titre de  
ce message s'il a ete altere, modifie ou falsifie.




___

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

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

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

This email sent to [EMAIL PROTECTED]


display callbacks

2008-11-19 Thread Alexander Cohen

Hi,

Is there a callback available when the display profile is changed by  
the user or programmatically? Also, is there a calllabck available  
when the user drags a window between different screens?


thx

AC
___

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

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

2008-11-18 Thread Alexander Cohen

You are absolutely right. thank you.

AC

On Nov 18, 2008, at 6:33 PM, Michael Ash wrote:

On Tue, Nov 18, 2008 at 4:15 PM, Alexander Cohen <[EMAIL PROTECTED] 
> wrote:

Hi,

I have a window controller that i'm creating dynamically in the
applicationDidFinishLaunching: app delegate notification. In this  
window
controllers windowDidLoad:, i'm adding subviews to it's content  
view. When i
create it then call showWindow: on it, the window shows up on  
screen without
any subviews in then it seems to update with all the subviews in  
it, this
causes a sort of visible flash. Has anyone seen this and does  
anyone have

any idea why this might be happening?


Uncheck the "Visible at Launch" checkbox in IB. With that box checked,
the window gets displayed right when the nib loads, before your
windowDidLoad method (no colon, note, it does not take a parameter) is
invoked. You then add subviews to it after it's already visible,
leading to a flash. And then of course your window controller tells
the window to become visible, but this does nothing because it already
is.

If you uncheck that box, the window will be invisible when first
loaded from the nib. This will allow you to do whatever setup you need
and then the showWindow: method will make it visible "manually"
afterwards.

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/alex%40toomuchspace.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]


window flash

2008-11-18 Thread Alexander Cohen

Hi,

I have a window controller that i'm creating dynamically in the  
applicationDidFinishLaunching: app delegate notification. In this  
window controllers windowDidLoad:, i'm adding subviews to it's content  
view. When i create it then call showWindow: on it, the window shows  
up on screen without any subviews in then it seems to update with all  
the subviews in it, this causes a sort of visible flash. Has anyone  
seen this and does anyone have any idea why this might be happening?


thx

AC
___

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

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

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

This email sent to [EMAIL PROTECTED]


window flash

2008-11-18 Thread Alexander Cohen

Hi,

I have a window controller that i'm creating dynamically in the  
applicationDidFinishLaunching: app delegate notification. In this  
window controllers windowDidLoad:, i'm adding subviews to it's content  
view. When i create it then call showWindow: on it, the window shows  
up on screen without any subviews in then it seems to update with all  
the subviews in it, this causes a sort of visible flash. Has anyone  
seen this and does anyone have any idea why this might be happening?


thx

AC
___

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

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

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

This email sent to [EMAIL PROTECTED]


sending email with attachement from cocoa

2008-09-26 Thread Alexander Cohen
Is there a way to use a url request to open mail with all its fields  
completed but most importantly, contain an image attachement?


thx

AC
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.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: MobileMe upload file to iDisk

2008-07-16 Thread Alexander Cohen


On Jul 16, 2008, at 6:08 PM, Nick Zitzmann wrote:



On Jul 16, 2008, at 3:16 PM, Alexander Cohen wrote:

Is there an API that can be used to transfer files to a MobileMe  
iDisk?



Yes, but as others have mentioned, the DotMacKit framework hasn't  
been updated in years, is obsolete, and I will be surprised if it  
ever gets updated. You can still use it if you want, but then you  
can't use Leopard's GC or 64-bit features in your app (or, at least,  
in the 64-bit builds). Alternately, you can use a DAV library or  
framework, such as CURL or ConnectionKit, to upload to MobileMe.


Is it possible to use a DAV library to to get folder listings, upload  
and download files to my home (private) section of my MobileMe iDisk.  
Also, what URL would i use in the HTTP requests, would it be  
www.me.com/?


I know this is a bit off-topic, is there a better list for this?

thx

AC

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.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: MobileMe upload file to iDisk

2008-07-16 Thread Alexander Cohen

Does it support WebDAV?

AC

On Jul 16, 2008, at 5:21 PM, glenn andreas wrote:



On Jul 16, 2008, at 4:16 PM, Alexander Cohen wrote:

Is there an API that can be used to transfer files to a MobileMe  
iDisk?


thx



There use to be - the "dot Mac" SDK provided that sort of thing.   
There is even a mailing list about it (though it's all but dead now- 
a-days)


There is yet to be any public comment about any update to support  
mobileMe features, or what exactly the future of the dot Mac SDK is  
(it doesn't even support 64 bits in its current form)



Glenn Andreas  [EMAIL PROTECTED]
<http://www.gandreas.com/> wicked fun!
quadrium | flame : flame fractals & strange attractors : build,  
mutate, evolve, animate




___

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

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

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


MobileMe upload file to iDisk

2008-07-16 Thread Alexander Cohen

Is there an API that can be used to transfer files to a MobileMe iDisk?

thx

AC
___

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

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

2008-06-10 Thread Alexander Cohen


On Jun 10, 2008, at 8:50 PM, Douglas Davidson wrote:



On Jun 10, 2008, at 5:42 PM, Alexander Cohen wrote:

Thats what i though but here is my problem, and i'm sure im not the  
only who has it. I am currently working on localizing apps for  
mulitple languages. I would like to have an easy way to set the  
locale without going into the system prefs and trying once again to  
guess which settings i need to change to get my locale to zh_CN, or  
zh_TW, KO or anything else.


Locale is not the same as localization.  It sounds like what you are  
interested in is localization.  If you want to launch a specific  
application instance in a specific localization, you can do so by  
specifying command-line arguments.  For example,


/Applications/TextEdit.app/Contents/MacOS/TextEdit -AppleLanguages  
"(de)"


will launch TextEdit in German.  You should also be able to set  
command-line arguments in Xcode.  The first argument here is - 
AppleLanguages, the name of the default.  The second is an array of  
strings, so that you could (for example) use "(de,en)" to specify a  
preference order of German first, English second.  The quotes are  
for the shell.


Nice, i didnt know that. Im not sure this completely fullfills my  
needs, but it will do for now.


thx

AC
___

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

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

2008-06-10 Thread Alexander Cohen
Thats what i though but here is my problem, and i'm sure im not the  
only who has it. I am currently working on localizing apps for  
mulitple languages. I would like to have an easy way to set the locale  
without going into the system prefs and trying once again to guess  
which settings i need to change to get my locale to zh_CN, or zh_TW,  
KO or anything else.


thx

A


On Jun 10, 2008, at 8:01 PM, Deborah Goldsmith wrote:

Not a supported way, no. We don't encourage applications to change  
system-wide settings.


Deborah Goldsmith
Apple Inc.
[EMAIL PROTECTED]

On Jun 10, 2008, at 8:05 AM, Alexander Cohen wrote:

Is there a way to change the locale from cocoa as if i was to go  
into System Preferences and change the language then the format?


thx

AC
___

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

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

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


changing locale

2008-06-10 Thread Alexander Cohen
Is there a way to change the locale from cocoa as if i was to go into  
System Preferences and change the language then the format?


thx

AC
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.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: Cover Flow in Cocoa?

2008-05-28 Thread Alexander Cohen


On May 28, 2008, at 11:08 AM, Jens Alfke wrote:



On 28 May '08, at 1:04 AM, Steve Harrison wrote:

On another thread on the Apple Mailing Lists, Alexander Cohen said  
that there is an API in Leopard for CoverFlow (see archived post  
here: "http://www.cocoabuilder.com/archive/message/cocoa/2007/11/6/192424 
"):


Yeah, but that's private API. I wouldn't use that in a serious app,  
as it could change incompatibly or be taken out in any future OS  
release. (The former is quite likely: a primary reason why  
frameworks or classes don't get made public is that Apple hasn't  
polished their APIs yet. Making something public involves committing  
to supporting binary compatibility with it, which really limits what  
you can do with the API, and Apple doesn't take that lightly.)


I agree with you on that. The only reason i would see for using them  
is that the CoverFlow Private API is pretty much interchangeable with  
the ImageKit Browser API. This does at least show some sort of  
consistency and might point to the IKImageFlow being made public soon  
(I hope).


AC
___

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

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

2008-04-16 Thread Alexander Cohen
Just noticed that by using the NOrmalize functions i can get what i  
need.


thx

AC

On Apr 16, 2008, at 11:43 AM, Alexander Cohen wrote:

I have an NSString that contains this Unicode character: '\u00e9'. I  
have another app that represents the same character as 'e\u0301'. Is  
there any way to transform one to the other so that isEqualToString  
returns YES?


thx

AC
___

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

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

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


NSString and utf16

2008-04-16 Thread Alexander Cohen
I have an NSString that contains this Unicode character: '\u00e9'. I  
have another app that represents the same character as 'e\u0301'. Is  
there any way to transform one to the other so that isEqualToString  
returns YES?


thx

AC
___

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

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

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

This email sent to [EMAIL PROTECTED]


listing users

2008-04-16 Thread Alexander Cohen
Whats the best way in cocoa to get a list of users on a machine for  
10.4 and up?


thx

AC
___

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

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

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

This email sent to [EMAIL PROTECTED]


[OFF] unicode characters

2008-04-09 Thread Alexander Cohen
Sorry for the off-topic post but this is the best place to get info  
( lots of smart people ).


I have a string that is composed unicode characters. I want to be able  
to transform that string into all ascii characters by transforming all  
non-ascii characters into their ascii equivalent.


ex:

ü = u
é = e

Anyone know of a way to do that or do i need a lookup table with all  
characters and their equivalents?


thx

AC___

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

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

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

This email sent to [EMAIL PROTECTED]


DO problems

2008-03-18 Thread Alexander Cohen
Hi, i have a server and client communication through DO. Connections  
are all set up then the client send a message to the server with  
itself as the first argument. The server should then just reply right  
away to the client using the first argument as the proxy. Problem is,  
im getting the error below when trying to send the response form the  
server back to the client. Any ideas what might be happening?


 server received hello
 *** NSDistantObject initWithCoder: 0x2 not given away for conn  
0x171a62f0

exceptionHandler:shouldHandleException:
-[NSConcretePortCoder decodeInvocation]: no local target


thanks

AC
___

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

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

2008-03-12 Thread Alexander Cohen

Thanks, ill look into this. Its much better than nothing.

AC

On 12-Mar-08, at 2:00 PM, John Stiles wrote:


You can dive into BSD to get some values which might help you.

  vm_statisticsvmstats;
  mach_msg_type_number_t   count;
  kern_return_t  result = host_statistics(mach_host_self(),  
HOST_VM_INFO, (host_info_t) &vmstats, &count);


  uint64 freeMem= uint64(vmstats.free_count +  
vmstats.inactive_count) * uint64(vm_page_size);


I am not 100% sure if this will work for you, since it's been a  
while since I've looked at this stuff, but it's worth experimenting  
with. It might be telling you about physical RAM, not process  
address space, which are both interesting but have different failure  
modes (VM thrashing, failures in malloc).




Nick Zitzmann wrote:


On Mar 12, 2008, at 11:40 AM, Alexander Cohen wrote:

Is there any way to be notified when my app is running low on  
memory?


Not really.

My app is very memory intensive and needs to have a lot of images  
in memory at the same time, id like to be able to clear some cache  
if memory gets too low.



If you're using Leopard, then consider releasing a 64-bit version  
of your application.


If you're using Tiger, then consider using the NSZone API with  
zones that will not grow (zero granularity). Then, if object  
allocation isn't working, then at least your app won't crash.


Either way, if your app creates lots of temporary objects, then you  
should wrap them in NSAutoreleasePools.


Nick Zitzmann
<http://www.chronosnet.com/>

___

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

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

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


memory warnings

2008-03-12 Thread Alexander Cohen
Is there any way to be notified when my app is running low on memory?  
My app is very memory intensive and needs to have a lot of images in  
memory at the same time, id like to be able to clear some cache if  
memory gets too low.


thx

AC
___

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

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

2008-03-04 Thread Alexander Cohen

thx, works like a charm.

AC

On 4-Mar-08, at 12:49 PM, [EMAIL PROTECTED] wrote:



On 4 Mar 2008, at 18:43, Alexander Cohen wrote:


Hi,

Whats the best way to get an NSString from a wstring?



This is what I do:

@interface NSString (wstring_additions)
+(NSString*) stringWithwstring:(const std::wstring&)string;
-(std::wstring) getwstring;
@end

@implementation NSString (wstring_additions)

#if TARGET_RT_BIG_ENDIAN
	const NSStringEncoding kEncoding_wchar_t =  
CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingUTF32BE);

#else
	const NSStringEncoding kEncoding_wchar_t =  
CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingUTF32LE);

#endif

+(NSString*) stringWithwstring:(const std::wstring&)ws
{
char* data = (char*)ws.data();
unsigned size = ws.size() * sizeof(wchar_t);

	NSString* result = [[[NSString alloc] initWithBytes:data  
length:size encoding:kEncoding_wchar_t] autorelease];

return result;
}

-(std::wstring) getwstring
{
NSData* asData = [self dataUsingEncoding:kEncoding_wchar_t];
	return std::wstring((wchar_t*)[asData bytes], [asData length] /  
sizeof(wchar_t));

}


Matt


___

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

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

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

This email sent to [EMAIL PROTECTED]


NSString from wstring

2008-03-04 Thread Alexander Cohen

Hi,

Whats the best way to get an NSString from a wstring?

thanks

AC
___

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

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

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

This email sent to [EMAIL PROTECTED]