Re: Custom NSSlider

2011-06-16 Thread Vyacheslav Karamov

I'm currently support project which use custom NSSlider.


16-Jun-11 04:18, Nick пишет:

Hello
I am wondering if there are any free custom NSSlider controles available
with changed knob and trackbar images?
The ones similar to QuickTime Player and iTunes (for a player application).
Does everyone implement them from scratch by subclassing the cell class?
Thank you
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/ubuntulist%40yandex.ru

This email sent to ubuntul...@yandex.ru




___

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

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

2011-06-16 Thread Nick
Basically I was looking for some freely available fancy controls, that are
suitable for players. Like AlphaControls for Delphi (for Windows) or
something. Specifically for custom sliders.

(I am writing a custom player that can play files over network, and, on the
movie view, when the user moves the mouse cursor, he can see some fancy
controls for playback control, instead of coco native ones - which in a
player look very  inappropriate).

If you know some websites with this, but for Mac, could you please share? :)

Thanks,
Nick
___

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

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


Hiding/Showing UIAgent application window

2011-06-16 Thread Nava Carmon
Hi,

I have an UIAgent application with one window. I want to hide/show it from 
another application.How do I do it with cocoa? Seems like hide/unhide methods 
of NSRunningApplication doesn't affect UIAgent processes.

Thanks

Nava Carmon
ncar...@mac.com

"Think good and it will be good!"

___

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

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

2011-06-16 Thread Vyacheslav Karamov

Look towards BWToolkit.
But note: you should better use XCode 3.2.6, not 4.0.2, cause XCode 4.x 
lack of plug-ins support.


16-Jun-11 11:20, Nick пишет:
Basically I was looking for some freely available fancy controls, that 
are suitable for players. Like AlphaControls for Delphi (for Windows) 
or something. Specifically for custom sliders.


(I am writing a custom player that can play files over network, and, 
on the movie view, when the user moves the mouse cursor, he can see 
some fancy controls for playback control, instead of coco native ones 
- which in a player look very inappropriate).


If you know some websites with this, but for Mac, could you please 
share? :)


Thanks,
Nick


___

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

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


NSConnection - both ways

2011-06-16 Thread Nava Carmon
Hi,

I'd like to establish connection between two processes. I'm using NSConnection 
from the server side:
Server Process
NSConnection *theConnection;

//theConnection = [NSConnection defaultConnection];
theConnection = [[NSConnection alloc] init];
[theConnection setRootObject:self];
[theConnection registerName:@"MyServer"];

and get the proxy object on the other side. 
Client Process
NSConnection *theConnection;

theConnection = [NSConnection connectionWithRegisteredName:@"MyServer" 
host:nil];
self.remoteObject = [[theConnection rootProxy] retain];

And it works ok. My question is how do I establish the connection to both ways, 
so I can get the distributed object of the client in server, like both 
processes will serve as server and client for each other?

I tried to do the same other way with another name, but it didn't work for some 
reason.

Thanks

Nava Carmon
ncar...@mac.com

"Think good and it will be good!"

___

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

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

2011-06-16 Thread Bing Li
Dear Conrad, Jens, Tony, Scott, Wade and all,

I appreciate so much for your replies. I learn a lot from the interactions
with you. Since I am new, your patience is so valuable to me!

I just got the problem. At least, right now, there is no the leak. When
receiving messages, I put them into a queue. However, I forgot implementing
a dealloc for it and I also did not release it when the connection was
disconnected. After the bug was fixed, the leaking issue was solved.

But I still have a question. The queue is actually derived from NSArray. It
should be empty after when the connection was disconnected. Why was there
such a huge leak?

For the TCP issues, I planned to change my current solution. I will send the
length of the buffer first and then send the real data. I have ever done
that on .NET. The difference is that this time I need to exchange messages
among different OSs (Java/Linux and iOS). So XML is used. On .NET, I just
use its serialization technique. I am not sure if I need to consider little
endian/big endian issues? My iMac is an Intel CPU. I don't need to do that,
right? What about iPad/iPhone?

When implementing multi-threading, NSOperationQueue is used in my system. I
don't create threads explicitly unless in some specific cases, for example,
a streaming control thread pool.

The major reason I intend to use sockets is that I attempt to design a P2P
communication protocol when transmitting data over the Internet. I also did
that successfully on .NET. I think a controllable socket is more flexible
although its programming is difficult a little bit.

I will learn Cocoa programming continually and carefully. Thanks so much for
your help again!

Best regards,
Bing



On Thu, Jun 16, 2011 at 4:10 AM, Conrad Shultz <
con...@synthetiqsolutions.com> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 6/15/11 12:50 PM, Bing Li wrote:
> > Jens,
> >
> > Thanks so much for your suggestions!
> >
> > I wonder why it works fine according to Activity Monitor if such a huge
> leak
> > exists. The consumed memory in the Activity Monitor is stable and much
> > smaller unless some threads are created at a high concurrent moment.
> After
> > the threads are dead, the consumed memory becomes stable and small. I
> feel
> > weird for this.
>
> Honestly, I feel like you are not listening to the excellent responses
> people are giving you.
>
> 1) Activity Monitor is not a profiling tool.  Don't use it as such.  Use
> Leaks/Allocations, maybe with some heapshot analysis thrown in as I
> believe I mentioned a while back.
>
> 2) Analyze your code with the Clang static analyzer ("Build & Analyze").
>  This will shake out many common memory issues (and more).
>
> 3) Recognize that posting snippets of the code that you THINK might be
> responsible for a leak does not mean that people on the list can
> actually help you find it.  For example, even if you are doing
> everything completely properly inside a function, if that function
> returns some object, the calling code can still leak that object.
>
> 4) It seems as if much of your code is multi-threaded.  All else being
> equal, this makes such problems even harder to debug.  If I were having
> such serious issues, I would probably spend some time trying to get the
> task to work on the main thread and only once that is thoroughly
> debugged would I break it up across threads.  (This won't work for every
> type of problem, but if it can work for you, I'd do it.)
>
> 5) As others have commented, there is substantial evidence that your
> code probably has issues other than memory management.  If you are, for
> example, smashing the stack in your C code, all bets are off and you
> really need to fix that first.
>
> It's been so long since you first started posting that I've forgotten
> what you are trying to do.  You are communicating in a high level format
> (XML), yet all your code seems to concern very low level network
> behaviors (opening sockets, reading bytes, et cetera).  I wonder whether
> you are over-engineering all this.  What is your goal?
>
> - --
> Conrad Shultz
>
> Synthetiq Solutions
> www.synthetiqsolutions.com
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iD8DBQFN+RG8aOlrz5+0JdURAjRNAJ9YCKwfHbB6iICdmKARupttOoJkMQCdG5TT
> ZAaJuogqgVGHjKxS4sqA8pw=
> =RkC+
> -END PGP SIGNATURE-
>
___

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

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

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

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


FSEvents - handling kFSEventStreamEventFlagRootChanged flag

2011-06-16 Thread Ajay Sabhaney
Hello,

I have setup an FSEventStream so that I can monitor a directory for file 
changes. If the root directory that is being watched is moved/renamed, I want 
to be able to keep monitoring the directory.  I am able to get the new path of 
the root directory, however I am unsure of how to monitor the new path. If I 
try to stop monitoring the watched directory (so I can subsequently monitor the 
new root directory path), the following error message is logged to my console:

(CarbonCore.framework) process_dir_events: watch_path: error trying to add 
kqueue for fd 5 (/Users/path/to/orig/dir; Bad file descriptor)
(CarbonCore.framework) process_dir_events: watch_path: error removing fd 6 from 
kqueue (Bad file descriptor)
(CarbonCore.framework) process_dir_events: watch_all_parents: error trying to 
add kqueue for fd 6 (/Users/path/to/orig; Bad file descriptor)
(CarbonCore.framework) process_dir_events: watch_all_parents: error trying to 
add kqueue for fd 7 (/Users/path/to; Bad file descriptor)
(CarbonCore.framework) process_dir_events: watch_all_parents: error trying to 
add kqueue for fd 8 (/Users/path; Bad file descriptor)
(CarbonCore.framework) process_dir_events: watch_all_parents: error trying to 
add kqueue for fd 9 (/Users; Bad file descriptor)

I'd appreciate if someone can suggest a way to monitor the new directory path 
(and stop monitoring the original location) when receiving a 
kFSEventStreamEventFlagRootChanged flag.  If invalidating and stopping the 
stream (then restarting it) is the way to go, perhaps someone could shed some 
light as to why I'm receiving the error mentioned above.

A similar question has been asked (but not yet solved) in the following thread:
http://lists.apple.com/archives/filesystem-dev/2010/May/msg7.html

Ajay
___

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

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

2011-06-16 Thread Ken Thomases
On Jun 16, 2011, at 3:40 AM, Nava Carmon wrote:

> I'd like to establish connection between two processes. I'm using 
> NSConnection from the server side:

> And it works ok. My question is how do I establish the connection to both 
> ways, so I can get the distributed object of the client in server, like both 
> processes will serve as server and client for each other?

You don't need to do that.  One connection is enough.  Once the client has the 
proxy for the server's root object, it can invoke a method on that object to 
give the server a proxy to an object of its own.  Then, the server can invoke 
methods on that proxy of the client's object to message the client.

Cheers,
Ken

___

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

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

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

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


Re: NSConnection - both ways

2011-06-16 Thread Nava Carmon
I tried to pass my client object as is but it didn't work for some reason.
Should I wrap it somehow?

Thanks

On Jun 16, 2011, at 3:20 PM, Ken Thomases wrote:

> On Jun 16, 2011, at 3:40 AM, Nava Carmon wrote:
> 
>> I'd like to establish connection between two processes. I'm using 
>> NSConnection from the server side:
> 
>> And it works ok. My question is how do I establish the connection to both 
>> ways, so I can get the distributed object of the client in server, like both 
>> processes will serve as server and client for each other?
> 
> You don't need to do that.  One connection is enough.  Once the client has 
> the proxy for the server's root object, it can invoke a method on that object 
> to give the server a proxy to an object of its own.  Then, the server can 
> invoke methods on that proxy of the client's object to message the client.
> 
> Cheers,
> Ken
> 


Nava Carmon
ncar...@mac.com

"Think good and it will be good!"

___

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

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

2011-06-16 Thread Bing Li
Dear Marcus,

Thanks so much for your reply!

Your experiences on encoding on network helps me a lot!

NSOperationQueue is not a technique particularly for networking. It is an
asynchronous programming solution. Using it, developers are not required to
take care of a lot of details of threading.

Best regards,
Bing

On Thu, Jun 16, 2011 at 7:49 PM, Marcus Karlsson  wrote:

>
> On Jun 16, 2011, at 12:33 PM, Bing Li wrote:
>
> > Dear Conrad, Jens, Tony, Scott, Wade and all,
> >
> > I appreciate so much for your replies. I learn a lot from the
> interactions
> > with you. Since I am new, your patience is so valuable to me!
> >
> > I just got the problem. At least, right now, there is no the leak. When
> > receiving messages, I put them into a queue. However, I forgot
> implementing
> > a dealloc for it and I also did not release it when the connection was
> > disconnected. After the bug was fixed, the leaking issue was solved.
>
> Well done.
>
> > But I still have a question. The queue is actually derived from NSArray.
> It
> > should be empty after when the connection was disconnected. Why was there
> > such a huge leak?
>
> In your snippet that you sent earlier you allocated memory in an infinite
> loop. It's not uncommon that such loops keeps going for a large number of
> iterations when things goes wrong. Even if you leak just a little bit of
> data for each iteration, the sum of leaked memory can become very big.
>
> > For the TCP issues, I planned to change my current solution. I will send
> the
> > length of the buffer first and then send the real data. I have ever done
> > that on .NET. The difference is that this time I need to exchange
> messages
> > among different OSs (Java/Linux and iOS). So XML is used. On .NET, I just
> > use its serialization technique. I am not sure if I need to consider
> little
> > endian/big endian issues? My iMac is an Intel CPU. I don't need to do
> that,
> > right? What about iPad/iPhone?
>
> It's not uncommon that network protocols have the length included somewhere
> in the beginning. But it's not a bullet-proof solution and you still have to
> handle the possibility of getting fragmented data. If you're not dealing
> with persistent connections then maybe an even simpler approach could be to
> just keep reading until he remote socket is closed.
>
> XML is already encoded so you don't need to convert it according to
> endianness. It's only when you're transmitting raw bytes directly over the
> network when you need to do that. As long as you have defined your protocol
> and how you encode and decode the transmitted data it doesn't matter which
> operating system or CPU architecture is on each end. The serialization
> you've used earlier is just one way of doing that. In the end it's just bits
> that goes over the wire, whether it's XML or your own binary format doesn't
> matter.
>
> > When implementing multi-threading, NSOperationQueue is used in my system.
> I
> > don't create threads explicitly unless in some specific cases, for
> example,
> > a streaming control thread pool.
> >
> > The major reason I intend to use sockets is that I attempt to design a
> P2P
> > communication protocol when transmitting data over the Internet. I also
> did
> > that successfully on .NET. I think a controllable socket is more flexible
> > although its programming is difficult a little bit.
>
> I'm not particularly familiar with NSOperationQueue and don't know how well
> it works for network operations. I often use the CFNetwork API:s which I
> recommend that you take a look at.
>
> > I will learn Cocoa programming continually and carefully. Thanks so much
> for
> > your help again!
> >
> > Best regards,
> > Bing
> >
> >
> >
> > On Thu, Jun 16, 2011 at 4:10 AM, Conrad Shultz <
> > con...@synthetiqsolutions.com> wrote:
> >
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA1
> >>
> >> On 6/15/11 12:50 PM, Bing Li wrote:
> >>> Jens,
> >>>
> >>> Thanks so much for your suggestions!
> >>>
> >>> I wonder why it works fine according to Activity Monitor if such a huge
> >> leak
> >>> exists. The consumed memory in the Activity Monitor is stable and much
> >>> smaller unless some threads are created at a high concurrent moment.
> >> After
> >>> the threads are dead, the consumed memory becomes stable and small. I
> >> feel
> >>> weird for this.
> >>
> >> Honestly, I feel like you are not listening to the excellent responses
> >> people are giving you.
> >>
> >> 1) Activity Monitor is not a profiling tool.  Don't use it as such.  Use
> >> Leaks/Allocations, maybe with some heapshot analysis thrown in as I
> >> believe I mentioned a while back.
> >>
> >> 2) Analyze your code with the Clang static analyzer ("Build & Analyze").
> >> This will shake out many common memory issues (and more).
> >>
> >> 3) Recognize that posting snippets of the code that you THINK might be
> >> responsible for a leak does not mean that people on the list can
> >> actually help you find it.  For example, even if you

Re: NSConnection - both ways

2011-06-16 Thread Ken Thomases
On Jun 16, 2011, at 7:26 AM, Nava Carmon wrote:

> I tried to pass my client object as is but it didn't work for some reason.

Didn't work in what way?  What exactly did you try?  What results did you 
expect, what results did you actually get, and how did they differ?

> Should I wrap it somehow?

Shouldn't be necessary.

Regards,
Ken

___

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

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

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

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


How to remove the NSCell border in an NSTableView that hasFocus

2011-06-16 Thread Alexander Reichstadt
Hi,

i have an NSCell subclass in an NSTableView. It's highlight color should be 
consistent regardless of the table view's focus state. It works, but I have one 
thing remaining I can't figure Out. While the table view has no focus the cells 
look fine. But when it has focus the cell gets a border of about one pixel. I 
can't find how to alter this border in color or size or make it disappear.

Docs on either NSTableColumn, NSTableView nor NSCell gave any hint on that. 
Please, can someone help?

Thanks
Alex


___

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

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

2011-06-16 Thread Nava Carmon
I call from client [self.remoteObject registerClient:self];

Then in the server in function

- (void) registerClient:(id)objectProxy
{
self.remoteClient = objectProxy; // remoteClient is defined as retained 
property
}

// somewhere in the code after registration

...
[self.remoteClient foo];
...


// In the client

- (void) foo
{
NSLog(@"%@", @"foo was called");
}

foo wasn't called. 

On Jun 16, 2011, at 4:20 PM, Ken Thomases wrote:

> On Jun 16, 2011, at 7:26 AM, Nava Carmon wrote:
> 
>> I tried to pass my client object as is but it didn't work for some reason.
> 
> Didn't work in what way?  What exactly did you try?  What results did you 
> expect, what results did you actually get, and how did they differ?
> 
>> Should I wrap it somehow?
> 
> Shouldn't be necessary.
> 
> Regards,
> Ken
> 


Nava Carmon
ncar...@mac.com

"Think good and it will be good!"

___

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

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


How to set special keys for menuitems.

2011-06-16 Thread Kartik Reddyreddy
Hi,

I want to set the menuitem's shortcut to pageup and pagedown keys. How do i
do it in Objective-C ?? I am setting the keyequivalent in code, cannot use
Interface Builder.

Do i have to use the Unicode values to create a NSString and pass it to
NSMenuItem's setKeyEquivalent ?? If so could anyone point me to the document
with Unicode values for keys.

Thanks,
Abhinay.
___

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

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

2011-06-16 Thread Ken Thomases
On Jun 16, 2011, at 9:29 AM, Nava Carmon wrote:

> I call from client [self.remoteObject registerClient:self];
> 
> Then in the server in function
> 
> - (void) registerClient:(id)objectProxy
> {
>   self.remoteClient = objectProxy; // remoteClient is defined as retained 
> property

Have you logged this, both the pointer value (%p) and description (%@) of the 
client proxy?  While you're at it, log self.

> }
> 
> // somewhere in the code after registration
> 
> ...
> [self.remoteClient foo];

Is this actual code or just example code?  Is the method really -foo?

Are you sure this is after the registration?  Are you sure it's the same self 
as above?  Have you logged self and self.remoteClient?

Were any errors written to the console?  If the receiver (self.remoteClient) is 
not nil, then _something_ is done when you send that message.

Regards,
Ken

___

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

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

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

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


Re: FSEvents - handling kFSEventStreamEventFlagRootChanged flag

2011-06-16 Thread Tony Romano
The way to handle adding a new directory is to basically tear down the
stream and recreate it adding the new directory.  You won't lose any
events while your recreating the stream due to the caching done behind the
scenes.

When I stop a stream, I do the following:

-(void) streamDestroy
{

FSEventStreamStop(eventStream);  // This will prevent your event handler
from being called

Snip... // do anything else you need to do.

NSRunLoop * mainLoop = [NSRunLoop mainRunLoop]; // remove it from the run
loop and 
FSEventStreamUnscheduleFromRunLoop(eventStream, [mainLoop getCFRunLoop],
kCFRunLoopDefaultMode);
FSEventStreamInvalidate(eventStream); // Tear down the stream.
FSEventStreamRelease(eventStream);
eventStream = NULL;

}

Once the stream is destroyed, just recreate the stream with the new
directories you are interested in listening to.  I am able to add and
remove directories at will.




HTH,
Tony Romano

On 6/16/11 3:33 AM, "Ajay Sabhaney"  wrote:


>Hello,
>
>I have setup an FSEventStream so that I can monitor a directory for file
>changes. If the root directory that is being watched is moved/renamed, I
>want to be able to keep monitoring the directory.  I am able to get the
>new path of the root directory, however I am unsure of how to monitor the
>new path. If I try to stop monitoring the watched directory (so I can
>subsequently monitor the new root directory path), the following error
>message is logged to my console:
>
>(CarbonCore.framework) process_dir_events: watch_path: error trying to
>add kqueue for fd 5 (/Users/path/to/orig/dir; Bad file descriptor)
>(CarbonCore.framework) process_dir_events: watch_path: error removing fd
>6 from kqueue (Bad file descriptor)
>(CarbonCore.framework) process_dir_events: watch_all_parents: error
>trying to add kqueue for fd 6 (/Users/path/to/orig; Bad file descriptor)
>(CarbonCore.framework) process_dir_events: watch_all_parents: error
>trying to add kqueue for fd 7 (/Users/path/to; Bad file descriptor)
>(CarbonCore.framework) process_dir_events: watch_all_parents: error
>trying to add kqueue for fd 8 (/Users/path; Bad file descriptor)
>(CarbonCore.framework) process_dir_events: watch_all_parents: error
>trying to add kqueue for fd 9 (/Users; Bad file descriptor)
>
>I'd appreciate if someone can suggest a way to monitor the new directory
>path (and stop monitoring the original location) when receiving a
>kFSEventStreamEventFlagRootChanged flag.  If invalidating and stopping
>the stream (then restarting it) is the way to go, perhaps someone could
>shed some light as to why I'm receiving the error mentioned above.
>
>A similar question has been asked (but not yet solved) in the following
>thread:
>http://lists.apple.com/archives/filesystem-dev/2010/May/msg7.html
>
>Ajay
>___
>
>Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
>Please do not post admin requests or moderator comments to the list.
>Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
>Help/Unsubscribe/Update your Subscription:
>http://lists.apple.com/mailman/options/cocoa-dev/tonyrom%40hotmail.com
>
>This email sent to tony...@hotmail.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: NSDragOperation for operationNotAllowedCursor !!

2011-06-16 Thread Raleigh Ledet
File a radar asking for a new NSDragOperation, NSDragOperationNotAllowed.

In the meantime, you can create your own cursor with your own cursor image and 
set it manually. You'll be fighting the system a bit, but if you time it right, 
you should be ok.

-raleigh

On Jun 15, 2011, at 7:47 AM, Naresh Kongara wrote:

> Hi,
> 
> I'm working on a cocoa application, which is like a file browser similar to 
> finder.  In this application we implemented drag and drop of files/folder. we 
> succeeded in displaying copy and link cursors for respective drag operations. 
> As in finder how can we display a OperationNotAllwedCursor when user tries to 
> drag a folder onto itself.  I mean which drag operation displays such kind of 
> cursor.  I tried returning all NSDragOperations from validateDrop: methods, 
> but none of the operation displays such kind of cursor.  Do we need to 
> implement any thing special for this . Pls do let me know if you have any 
> idea.
> 
> 
> Thanks,
> nkongara___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/ledet%40apple.com
> 
> This email sent to le...@apple.com

___

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

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

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

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


Re: Drawing noise in Cocoa (preferably fast)

2011-06-16 Thread Stephen Blinkhorn

Hi Ken,

On 15 Jun 2011, at 19:24, Ken Tozier wrote:

Just curious, what kind of speed are you getting with the CIImage  
methods? I saw the usefulness of generating random images for my own  
purposes and polished the posted code a bit today. It was generating  
100 million pixel images (10,000 x 10,000) with per-pixel  
randomization in about 2.2 seconds. What kinds of times are you  
getting for comparable images using the CIImage methods?


A quick test on a 2GHz iMac takes at least twice as long 4.5 seconds  
to generate a 10,000 X 10,000 CGLayer of noise.


Stephen



-Ken


On Jun 15, 2011, at 2:30 PM, Stephen Blinkhorn wrote:

I've got the random noise part working and it easily fast enough.  
Its a shame there isn't a way to specify the opacity when drawing  
CGLayers. I'd find that useful but I imagine there is a  reason for  
it.


Stephen

___

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

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

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

This email sent to step...@audiospillage.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


EDMessage, Symlinks & zip files

2011-06-16 Thread Kevin Muldoon

Hello all,

After importing the EDMessage Framework and adding a build phase to  
copy the framework, I found it worked very well. However, when I  
attempted to .zip the compiled app to send via email, my Finder  
hiccuped ( All Finder windows closed at once and no zip file to be  
seen).


I decided I'd make a Package in PackageMaker and it too hiccuped but  
it did manage to display a dialog saying something about Symlinks. For  
the record, StuffIt handled the file without complaint.


Anyway, what's with this behavior? Is this unique to EDMessage or do  
all imported frameworks have this non-zipping, symlinking behavior?


Kevin Muldoon
e: caoimgh...@gmail.com

___

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

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

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

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


Re: Custom NSSlider

2011-06-16 Thread Stephen Blinkhorn

On 15 Jun 2011, at 19:18, Nick wrote:


Hello
I am wondering if there are any free custom NSSlider controles  
available

with changed knob and trackbar images?
The ones similar to QuickTime Player and iTunes (for a player  
application).
Does everyone implement them from scratch by subclassing the cell  
class?


I make fancy slider controls using a custom 'cell-less' NSControl.  
Using this approach you can do all your drawing in drawRect and  
override mouseDown: mouseUp: mouseDragged: etc to behave how you want.  
To get actions working you'll need to add this method:


+(Class)cellClass {
return [NSActionCell class];
}

Stephen



Thank you
___

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

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

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

This email sent to step...@audiospillage.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: NSDragOperation for operationNotAllowedCursor !!

2011-06-16 Thread Kyle Sluder
On Thu, Jun 16, 2011 at 9:29 AM, Raleigh Ledet  wrote:
> In the meantime, you can create your own cursor with your own cursor image 
> and set it manually. You'll be fighting the system a bit, but if you time it 
> right, you should be ok.

Yea, this is what you're gonna have to do. NSDragOperationNone results
in an unbadged cursor.

I've been wishing for a while for a simple NSDraggingInfo method
called -setCursor: that would make it possible for custom cursors to
work for both in-app and cross-app drags. You can fake it yourself
using -pushCursor, but the logic is kind of subtle, and I'm iffy on
whether it breaks when the user drags out of your view and into
another app.

--Kyle Sluder
___

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

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

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

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


Re: Interface item validation through first responder

2011-06-16 Thread Luc Van Bogaert
On 15 Jun 2011, at 23:12, Quincey Morris wrote:

> On Jun 15, 2011, at 13:12, Luc Van Bogaert wrote:
> 

> As I said above, you aren't logging the responder chain, you're logging the 
> nextResponder tree, and not even all of that. Plus, all three tree structures 
> change over time as the UI is presented in different ways, so the snapshot 
> you see at 'applicationDidFinishLaunching:' may never even be seen by the 
> user. By the time the window is displayed, things may have changed 
> significantly.
> 
> 

Thanks for your explanations. This has really been very helpful. As a result of 
what I have learned so far, I decided to change my design again by 
instantiating the view controllers in IB and targeting the action messages here 
as well; while loading the actual view objects in code. I realize this is just 
one of a few possible approaches, but for now this seems to suit my needs the 
best.

Thanks again,

___

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

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

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

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


Re: After Autoreleasing Still Getting Leaked

2011-06-16 Thread Jens Alfke

On Jun 15, 2011, at 7:01 PM, Tony Romano wrote:

> TCP does NOT guarantee you will get the WHOLE PACKET on one receive call.
> BEFORE you PROCESS any data, you need to know that you have ALL the data.
> It may work MOST of the TIME, but there are times when it won't and your
> code WILL FAIL.

You’re correct, but your point is a little confusing because you’re using the 
word “packet” to mean an application-level message. Since ‘packet’ already has 
a very specific meaning in IP networking, it’s best to use a different word 
like “message” or “chunk” or “blob” or something.

So to rephrase: Just because you sent a chunk of bytes together in one TCP 
write, the recipient is not guaranteed to receive the same chunk of bytes in a 
single read. It’s quite likely that this chunk will be combined with bytes 
written in other write calls, or split in half across two reads. TCP is taking 
the data you give it and shoving it into buffers in the kernel, and those 
buffers get split up and sent out as IP packets according to the kernel’s whim 
and some complicated windowing algorithms. There’s absolutely no relation 
between the groups of bytes you write, the IP packets that get sent, and the 
groups of bytes the client reads.

If I can once again plug my MYNetwork framework 
, it includes a protocol called BLIP that 
supports sending application-level messages, which can also include metadata 
(key/value pairs like HTTP headers). It even supports multiplexing multiple 
messages at the same time, so one huge message won’t clog up the socket and 
block others till it finishes. This stuff is a pain in the ass to get right and 
I recommend using someone’s already-tested implementation over writing your 
own. (Or in other words, “I suffered for my art so you wouldn’t have to” :)

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


Re: How to set special keys for menuitems.

2011-06-16 Thread Jens Alfke

On Jun 16, 2011, at 7:34 AM, Kartik Reddyreddy wrote:

> Do i have to use the Unicode values to create a NSString and pass it to
> NSMenuItem's setKeyEquivalent ??

I think so.

> If so could anyone point me to the document with Unicode values for keys.

NSEvent.h — for example, you want NSPageUpFunctionKey.

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


Re: After Autoreleasing Still Getting Leaked

2011-06-16 Thread Tony Romano
No,  I meant to use packet since I was speaking in terms at the protocol
level.  In either case, your explanation is helpful to Bing but I fear he
is new to socket level programming and will stumble with other issues as
well.  Your advice to use some framework is what he should follow.

Tony Romano


On 6/16/11 12:29 PM, "Jens Alfke"  wrote:

>
>On Jun 15, 2011, at 7:01 PM, Tony Romano wrote:
>
>> TCP does NOT guarantee you will get the WHOLE PACKET on one receive
>>call.
>> BEFORE you PROCESS any data, you need to know that you have ALL the
>>data.
>> It may work MOST of the TIME, but there are times when it won't and your
>> code WILL FAIL.
>
>You¹re correct, but your point is a little confusing because you¹re using
>the word ³packet² to mean an application-level message. Since Œpacket¹
>already has a very specific meaning in IP networking, it¹s best to use a
>different word like ³message² or ³chunk² or ³blob² or something.
>
>So to rephrase: Just because you sent a chunk of bytes together in one
>TCP write, the recipient is not guaranteed to receive the same chunk of
>bytes in a single read. It¹s quite likely that this chunk will be
>combined with bytes written in other write calls, or split in half across
>two reads. TCP is taking the data you give it and shoving it into buffers
>in the kernel, and those buffers get split up and sent out as IP packets
>according to the kernel¹s whim and some complicated windowing algorithms.
>There¹s absolutely no relation between the groups of bytes you write, the
>IP packets that get sent, and the groups of bytes the client reads.
>
>If I can once again plug my MYNetwork framework
>, it includes a protocol called BLIP
>that supports sending application-level messages, which can also include
>metadata (key/value pairs like HTTP headers). It even supports
>multiplexing multiple messages at the same time, so one huge message
>won¹t clog up the socket and block others till it finishes. This stuff is
>a pain in the ass to get right and I recommend using someone¹s
>already-tested implementation over writing your own. (Or in other words,
>³I suffered for my art so you wouldn¹t have to² :)
>
>‹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


pagingEnabled on NSScrollView?

2011-06-16 Thread Leonardo
Hi,
I would like to reach the same effect as UIScrollView.pagingEnabled, but on
an NSScrollView. Can that be done?

If not, which technique should I use?
I thought to deal with NSAnimationContext to move the scrollView's document
with scrollPoint: when a scrolling ends (the finger stops dragging on the
track-pad). Am I on the right way?


Regards
-- Leonardo


___

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

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


How to get the code responsible for high CPU utilization

2011-06-16 Thread Sandeep
Hi All,

This might be a weird query. but is it possible some how to get the exact line 
of code causing high cpu utilization. Like in case of the Instrument Leaks we 
are able to make out the lines of code in our application that is causing the 
memory leaks. In similar way is there any instrument using which we are able to 
get the exact method or lines of code where the CPU utilization goes high.

Regards,
Sandeep.





___

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

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

2011-06-16 Thread Raleigh Ledet
Hi Leonardo,

I'm not familiar with UIScrollView.pagingEnabled, so you'd have to tell me what 
it does.

Also, how are you determining when the finger stops dragging on the trackpad?

-raleigh

On Jun 16, 2011, at 2:57 PM, Leonardo wrote:

> Hi,
> I would like to reach the same effect as UIScrollView.pagingEnabled, but on
> an NSScrollView. Can that be done?
> 
> If not, which technique should I use?
> I thought to deal with NSAnimationContext to move the scrollView's document
> with scrollPoint: when a scrolling ends (the finger stops dragging on the
> track-pad). Am I on the right way?
> 
> 
> Regards
> -- Leonardo
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/ledet%40apple.com
> 
> This email sent to le...@apple.com

___

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

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

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

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


Re: How to get the code responsible for high CPU utilization

2011-06-16 Thread Sean McBride
On Thu, 16 Jun 2011 15:18:06 -0700, Sandeep said:

>This might be a weird query. but is it possible some how to get the
>exact line of code causing high cpu utilization. Like in case of the
>Instrument Leaks we are able to make out the lines of code in our
>application that is causing the memory leaks. In similar way is there
>any instrument using which we are able to get the exact method or lines
>of code where the CPU utilization goes high.

Of course there is. :)  I suggest reading "Introduction to Instruments User 
Guide".



Cheers,

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

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

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

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


Re: How to get the code responsible for high CPU utilization

2011-06-16 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 6/16/11 3:18 PM, Sandeep wrote:
> Hi All,
> 
> This might be a weird query. but is it possible some how to get the
> exact line of code causing high cpu utilization. Like in case of the
> Instrument Leaks we are able to make out the lines of code in our
> application that is causing the memory leaks. In similar way is there
> any instrument using which we are able to get the exact method or
> lines of code where the CPU utilization goes high.

This is probably more of a dev tools question, but the first thing that
comes to my head is to use the Time Profiler instrument... it will
sample your application periodically and basically build a histogram of
CPU usage by method, letting you see which method(s) are consuming the
most CPU time.

There is also a CPU Sampler instrument, but I am less familiar with it.

Finally, I think you can do this with DTrace, but for most purposes
using the higher level Instruments will give satisfactory results with
less of a learning curve.

- -- 
Conrad Shultz

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

iD8DBQFN+oOaaOlrz5+0JdURAgNLAJ96hOczYR0/66nIhlgeZWuNMr7AkwCfTsfL
9kNEct4hygQHM9vmUVHCFx4=
=9gBf
-END PGP SIGNATURE-
___

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

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

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

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


Re: pagingEnabled on NSScrollView?

2011-06-16 Thread Quincey Morris
On Jun 16, 2011, at 14:57, Leonardo wrote:

> I would like to reach the same effect as UIScrollView.pagingEnabled, but on
> an NSScrollView. Can that be done?
> 
> If not, which technique should I use?
> I thought to deal with NSAnimationContext to move the scrollView's document
> with scrollPoint: when a scrolling ends (the finger stops dragging on the
> track-pad). Am I on the right way?

NSScrollView is not designed to have this behavior, so you'll have to do the 
work.

The basic approach is to have (say) your window controller monitor the scroll 
view's clip view's frame- and bounds-changed notifications. When you receive 
these notifications, you examine the relationship between the "clip" view 
bounds and the "document" (i.e. enclosed) view frame, and adjust the 
relationship to align the two views however you want.

To detect when scrolling "ends", you can use a well-known trick. When you see a 
notification, don't perform the scrolling adjustment immediately, but schedule 
it for "later" using 'performSelector: ... afterDelay: 0'. Since you don't want 
multiple deferred adjustments to get queued, you first cancel any pending ones 
with one of the 'cancelPrevious...' or 'cancelPerform...' methods, just before 
invoking 'performSelector:...'. That way, the last one "wins".

If you want to have this adjustment animate, you should be able to use the 
appropriate view's animator or NSViewAnimation to move the document view frame.

The only difficulty I can think of is if Lion's trackpad gesture-based 
scrolling itself has some animation built into it (e.g. an iOS-like "bounce"). 
In that case you might have some trouble trying to integrate your animation 
with the built-in one.

However, given that all of this is not expected Mac scroll view behavior, 
unless you have a *very* compelling need for it, I'd recommend you don't do it. 
NSScrollView responds to the Page Up and Page Down keys for paging. Why limit 
the user to where you think the page boundaries are?


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Drawing noise in Cocoa (preferably fast)

2011-06-16 Thread Ken Tozier

On Jun 16, 2011, at 12:34 PM, Stephen Blinkhorn wrote:

> A quick test on a 2GHz iMac takes at least twice as long 4.5 seconds to 
> generate a 10,000 X 10,000 CGLayer of noise.
> 
> Stephen

Thanks. Difference could just be the processor. My laptop has a 2.4 GHz core 
i5___

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

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


So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?

2011-06-16 Thread G S
My app is crashing after the user presses the Back button in the
navbar to dismiss a page that has a UIWebView on it, before the Web
view has finished loading.  The Web view subsequently tries call its
delegate to say that the content has finished loading.  In the Apple
docs I see this:

"Important: Before releasing an instance of UIWebView for which you
have set a delegate, you must first set the UIWebView delegate
property to nil before disposing of the UIWebView instance. This can
be done, for example, in the dealloc method where you dispose of the
UIWebView."

The delegate for the UIWebView is set up in the XIB file; it's pretty
hokey to have to intervene in code to then disassociate the view from
its delegate.  Also, there is no "dealloc method where you dispose of
the UIWebView", because that's done automatically when the view is
popped off the navigation stack.

Does anyone know if I'm interpreting this situation correctly?  I
guess the workaround is to set the UIWebView's delegate property to
nil in the UIWebView owner's "viewWillDisappear" method or something.

Thanks for any insight.

Gavin
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: So... we can't use UIWebView (with a delegate) on a page that's pushed onto a UINavigationController stack?

2011-06-16 Thread Jens Alfke

On Jun 16, 2011, at 7:15 PM, G S wrote:

> The delegate for the UIWebView is set up in the XIB file; it's pretty
> hokey to have to intervene in code to then disassociate the view from
> its delegate. 

If the delegate object is being dealloced, it needs to clear the delegate 
reference to it. I don’t see this as hokey (well, any more hokey than 
ref-counting in general.)

> Does anyone know if I'm interpreting this situation correctly?  I
> guess the workaround is to set the UIWebView's delegate property to
> nil in the UIWebView owner's "viewWillDisappear" method or something.

I’m not sure exactly what you mean, but I think you’re on the right track. If 
some other object knows that the delegate is going to be dealloced, it can 
clear the delegate property on the webview for it.

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


Runloop doesnt get fired when scheduled with the stream

2011-06-16 Thread Sivakumar Kandappan
Hello All

I`m currently doing a FTP client for my project. I`ve scheduled the
readstream/writeStream with the runloop to read the file from the
harddisk/write the file to the harddisk and send it to the server. After
uploading and downloading the file I unschedule the stream from the runloop.
This works fine for the first time I send the file. The second time when i
try to send the file. Streams are getting created and scheduled with the run
loop. But run loop doesnt fire. I don know. Can anyone please help me out

Below are the codes that I used to schedule and unschedule
For uploading
readStream=CFReadStreamCreateWithFile(kCFAllocatorDefault, fileURL);
writeStream=CFWriteStreamCreateWithFTPURL(kCFAllocatorDefault,(CFURLRef )
ftpURL);
BOOL readStreamOpened=CFReadStreamOpen(readStream);
BOOL clientCallBackSet=CFWriteStreamSetClient(writeStream, kNetworkEvents,
MyUploadCallBack, &callBackContext);

CFWriteStreamScheduleWithRunLoop(writeStream, CFRunLoopGetCurrent(),
kCFRunLoopCommonModes);
 CFReadStreamUnscheduleFromRunLoop(syncStructure->readStream,
CFRunLoopGetCurrent(), kCFRunLoopCommonModes);

Downloading:-
readStream=CFReadStreamCreateWithFTPURL(kCFAllocatorDefault,(CFURLRef)ftpURL
);
writeStream=CFWriteStreamCreateWithFile(kCFAllocatorDefault,fileURL);
Boolean writeStreamOpened=CFWriteStreamOpen(writeStream);
BOOL status= CFReadStreamSetClient(readStream,
kNetworkEvents,MyDownloadCallBack,& callBackContext);
CFReadStreamScheduleWithRunLoop(readStream, CFRunLoopGetCurrent(),
kCFRunLoopCommonModes);
 CFWriteStreamUnscheduleFromRunLoop(syncStructure->writeStream,
CFRunLoopGetCurrent(), kCFRunLoopCommonModes);


Can anyone please help me. I`m cracking my head for 2 days.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Drawing noise in Cocoa (preferably fast)

2011-06-16 Thread Uli Kusterer
On 17.06.2011, at 03:08, Ken Tozier wrote:
> On Jun 16, 2011, at 12:34 PM, Stephen Blinkhorn wrote:
>> A quick test on a 2GHz iMac takes at least twice as long 4.5 seconds to 
>> generate a 10,000 X 10,000 CGLayer of noise.
>> 
>> Stephen
> 
> Thanks. Difference could just be the processor. My laptop has a 2.4 GHz core 
> i5

Might also be the GPU. After all, CoreImage's whole point is that it runs on 
the GPU preferably, and frees the CPU up for other uses.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://groups.yahoo.com/group/mac-gui-dev/



___

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

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

2011-06-16 Thread Uli Kusterer
On 16.06.2011, at 03:18, Nick wrote:
> I am wondering if there are any free custom NSSlider controles available
> with changed knob and trackbar images?
> The ones similar to QuickTime Player and iTunes (for a player application).
> Does everyone implement them from scratch by subclassing the cell class?

 Depends on what you mean by "everyone" ... ?

 QTMovieView and NSMovieView and the likes have built-in controllers that you 
can just use out of the box. Many places use that, however they look kinda 
10.4-ish. If you want some of the more modern looks (either like Spotlight has 
it, or QuickTime Player X), you'll likely have to roll your own.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.lookandfeelcast.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