Re: Multiple File Open Strategy

2010-12-29 Thread Charles Srstka
On Dec 22, 2010, at 3:25 PM, Jeremy Torres wrote:

> I have a working implementation using Grand Central dispatch queues that open 
> a file and compute an OpenSSL DSA hash, writing out the hash to a new "side 
> car" file for later verification.
> 
> I would like to open multiple files at the same time, but based on some logic 
> that doesn't "choke" the OS by having 100s of files open and exceeding the 
> hard drive's sustainable output.  Photo browsing applications such as iPhoto 
> or Aperture seem to open multiple files and display them, so I'm assuming 
> this can be done.
> 
> Any suggestions?

NSOperationQueue has a -setMaxConcurrentOperationCount: method, so if you use 
it instead of GCD directly (NSOperationQueue still uses GCD under the hood), 
you can easily limit the number of operations that will run at once.

Charles___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Ensuring no selection in a table view

2010-12-29 Thread Erik Buck
Enabling empty selection in IB should do the trick.  You can also control 
selection programmatically with the delegate.
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTableViewDelegate_Protocol/Reference/Reference.html

Out of curiosity: Why not allow selection? Users might want to copy and paste 
information about documents.  Selection doesn't have to mean 
editable.___

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

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


connectionDidFinishLoading is not invoked immediately

2010-12-29 Thread ico
Greeting, everyone

I have a strange problem with my NSURLConnection that I couldn't figure out.
My app will call a webservice to load data. Every time I send the request,
the method connection:didReceiveData: is invoked very quick,
and I put a NSLog statement inside this method, I can see that the data I
receive is just the same as shown in HTTP header field
Content-Length. So there should be no more data need to be received. In
fact, connection:didReceiveData is not invoked any more. if
it does, I would see more output from the NSLog() inside that method, but I
just see it exactly once as I expected. However,
my connectionDidFinishLoading is invoked exactly 1 minute later every time.
Not immediately or very soon after the didReceivedData
method.
Also, if my program don't make the webservice call probably, that is the
server return error message, it is quick. I use my program to
call another webservice which is public and free on the web, I got the
result very quick as well.

Now I wonder how NSURLConnection judge if data is received completed and
then call the connectionDidFinishLoading method.
Something like a '\0' to indicate the data is finish transferring? Or just
compare the content length in the HTTP header and the
bytes are received? If it is judge by '\0', the server side does not send
this byte so my program wait until it is timeout internally
(that's why it delays exactly 1 minute to call connectionDidFinishLoading
every time?) Just guessing.

Any information would be appreciated. Thanks.

-- 
==
Life isn't about finding yourself.
Life is about creating yourself.
___

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

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

2010-12-29 Thread James Bucanek

Answering myself...

James Bucanek  wrote (Tuesday, 
December 28, 2010 8:36 AM -0700):



ico  wrote (Tuesday, December 28, 2010 11:18 PM 
+0800):


My question is, when should I release the myHandler? Should I release it in
the myCallback, but after
myCallback method finishes, it will return point 1 indicated as above, and
that myHandler instance is just
released.


As a general rule, I would avoid releasing |self| since (conceptually) an
object does not own itself.


This is excellent advice. I should have paid attention to it.


The answer to your question is, I think, simple: Follow good memory management
procedures. Retain objects until you no longer need to reference them, and
then release them.


More excellent advice. I'm just a fountain of wisdom.


Having said that, if your connectionDidFinishLoading: does all of the post
processing, and after it returns there are no more references to the
DataHandler object, then it would be appropriate to release/autorelease it in
the callback.


OK, when I actually thought about the problem, I realized that 
my earlier advice is crap.


If your high-level code that sets up your DataHandler object 
starts it, and then forgets about it, then it should release it 
when it's done with it (memory rule #1):


- (void) loadData {
DataHandler *myHandler = [[DataHandler alloc] init];
// set this view controller itself as a delegate, when the 
data loading

finished, myHandler will call its callback method
myHandler.delegate = self;
[myHandler startAsyncLoading];
[myHandler release]; <--- done with myHandler

The memory management rules always apply. The -startAsyncLoading 
message must start some background operation. Since this 
"something" plans to send myHandler a message, then it *must* 
retain myHandler until that message is sent. So, once started, 
myHandler must be retained by whatever agent is performing the 
asynchronous load until that load is done. If it isn't, then 
that's a bug.


--
James Bucanek

___

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

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

2010-12-29 Thread Ken Thomases
On Dec 22, 2010, at 3:25 PM, Jeremy Torres wrote:

> I have a working implementation using Grand Central dispatch queues that open 
> a file and compute an OpenSSL DSA hash, writing out the hash to a new "side 
> car" file for later verification.
> 
> I would like to open multiple files at the same time, but based on some logic 
> that doesn't "choke" the OS by having 100s of files open and exceeding the 
> hard drive's sustainable output.  Photo browsing applications such as iPhoto 
> or Aperture seem to open multiple files and display them, so I'm assuming 
> this can be done.
> 
> Any suggestions?

See this article on Mike Ash's blog:
http://www.mikeash.com/pyblog/friday-qa-2009-09-25-gcd-practicum.html

The discussion in this thread might also be useful to you; although it is about 
NSOperationQueue, some of the same issues are relevant to GCD:
http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg64583.html

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


Binding label value to CoreDara int16

2010-12-29 Thread Siegfried
Hello,

I have an entity which has an integer property that represents a "mode". In 
code, I created an enum with possible values, but now I need to bind a label to 
that property. Obviously, it's not intent to show the number, but a text. 
What's the best way to do this? Create a dictionary, or an array of strings?

Thanks!

Siegfried___

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

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

2010-12-29 Thread Siegfried
On 29/12/2010, at 18:29, John Pannell wrote:

> Hi Siegfried-
> 
> Consider making an NSValueTransformer subclass that converts the stored 
> integer into the text you would like to see.  You can then use the 
> transformer in the binding to see the text you'd like.  I implemented 
> something similar as follows:
> 
> @implementation PKConnectionStateValueTransformer
> …
> @end
> 
> Hope this helps!

Definitely Helps!

Thanks John, and happy 2011

___

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

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

2010-12-29 Thread John Pannell
Hi Siegfried-

Consider making an NSValueTransformer subclass that converts the stored integer 
into the text you would like to see.  You can then use the transformer in the 
binding to see the text you'd like.  I implemented something similar as follows:

@implementation PKConnectionStateValueTransformer

+ (Class)transformedValueClass
{
return [NSString class];
}

+ (BOOL)allowsReverseTransformation
{
return NO;
}

- (id)transformedValue:(id)value
{
if([value respondsToSelector:@selector(integerValue)]){
NSInteger thisValue = [value integerValue];

switch (thisValue) {
case PSMGameNodeStateAvailable:
return @"Available";
break;

case PSMGameNodeStateUnavailable:
return @"Unavavilable";
break;

case PSMGameNodeStateConnected:
return @"Connected";
break;

case PSMGameNodeStateDisconnected:
return @"Disconnected";
break;

case PSMGameNodeStateConnecting:
return @"Connecting";
break;
default:
break;
}
}

return @"";
}

@end

Hope this helps!

John

Positive Spin Media
http://www.positivespinmedia.com

On Dec 29, 2010, at 12:19 PM, Siegfried wrote:

> Hello,
> 
> I have an entity which has an integer property that represents a "mode". In 
> code, I created an enum with possible values, but now I need to bind a label 
> to that property. Obviously, it's not intent to show the number, but a text. 
> What's the best way to do this? Create a dictionary, or an array of strings?
> 
> Thanks!
> 
> Siegfried___
> 

___

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

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


Including Cocoa in a Carbon App

2010-12-29 Thread Jason T. Slack-Moehrle
Hello All,

I have a carbon app that I need to put some cocoa functionality in. I am 
reading some resources on the ADC site.

In my .pch I am adding:

#ifdef __APPLE__ & __MACH__
#import 
#import 
#import 
#endif

I have added the Cocoa and Foundation frameworks to my project, but when I 
compile my .pch I get about 9761 errors right off the bat. 

I am obviously missing something key. What is it? 

My Base SDK is 10.4 building a universal binary, using GCC 4.2.

-Jason


___

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

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

2010-12-29 Thread Nick Zitzmann

On Dec 29, 2010, at 3:24 PM, Jason T. Slack-Moehrle wrote:

> Hello All,
> 
> I have a carbon app that I need to put some cocoa functionality in. I am 
> reading some resources on the ADC site.
> 
> In my .pch I am adding:
> 
> #ifdef __APPLE__ & __MACH__
>   #import 
>   #import 
>   #import 
> #endif
> 
> I have added the Cocoa and Foundation frameworks to my project, but when I 
> compile my .pch I get about 9761 errors right off the bat. 
> 
> I am obviously missing something key. What is it? 

What you're doing will not work when building C and C++ source code in that 
project, because those headers include ObjC definitions. If you do have C or 
C++ source code, then the easiest way to fix this is to use the preprocessor 
definition __OBJC__ rather than the two you are using above.

Also, if you are importing Cocoa, then you do not need to import or link to 
Foundation or AppKit or CoreData separately. All the Cocoa framework does is 
tie those three frameworks together.

Nick Zitzmann


___

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

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

2010-12-29 Thread Jason T. Slack-Moehrle
Hi Nick,

>> In my .pch I am adding:
>> 
>> #ifdef __APPLE__ & __MACH__



> What you're doing will not work when building C and C++ source code in that 
> project, because those headers include ObjC definitions. If you do have C or 
> C++ source code, then the easiest way to fix this is to use the preprocessor 
> definition __OBJC__ rather than the two you are using above.

In my code (which is OS X and Windows) I am currently using #ifdef __APPLE__ 
for Apple specific items, I need to move this to Objective-C and call from CPP 
should I switch to __OBJC__ instead of __APPLE__?  I am presuming from your 
solution that __APPLE__ just means the platform of OS9 or OS X and Objective-C 
is not on OS 9. I thought that __MACH__ ensured OS X? Which I take it also 
could not imply __OBJC__

Preprocessor defines are confusing...

-Jason
___

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

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

2010-12-29 Thread Nick Zitzmann

On Dec 29, 2010, at 3:41 PM, Jason T. Slack-Moehrle wrote:

> In my code (which is OS X and Windows) I am currently using #ifdef __APPLE__ 
> for Apple specific items, I need to move this to Objective-C and call from 
> CPP should I switch to __OBJC__ instead of __APPLE__?  

Yes, if that Mac-specific code is written using ObjC. __OBJC__ will not be 
defined for code residing in C and C++ source files.

> I am presuming from your solution that __APPLE__ just means the platform of 
> OS9 or OS X and Objective-C is not on OS 9.

Correct. You're not still targeting Mac OS 9, are you? Mac OS 9 was deprecated 
almost ten years ago, and I haven't seen anyone use it in a very long time.

> I thought that __MACH__ ensured OS X? Which I take it also could not imply 
> __OBJC__

Correct.

Nick Zitzmann


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Ensuring no selection in a table view

2010-12-29 Thread John Brownie

Erik Buck wrote:

Enabling empty selection in IB should do the trick.  You can also control 
selection programmatically with the delegate.
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTableViewDelegate_Protocol/Reference/Reference.html


That looked promising, but tableView:shouldSelectRow: does not get 
called when the window appears after being created or hidden. Nor does 
it get called if I click the selected row. It does get called if I click 
in an empty row and then back in a row with data.



Out of curiosity: Why not allow selection? Users might want to copy and paste 
information about documents.  Selection doesn't have to mean 
editable.___


Interesting thought - I guess there might actually be some use to 
allowing selection and copy. I am experimenting with replacing a Carbon 
window with a Cocoa one in an otherwise Carbon application, so I'm 
trying to limit the amount of impact on the rest of my code. Enabling 
copy would mean more changes than I'm interested in at this point, but 
I'll put that on my list for further examination.


John
--
John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg
Summer Institute of Linguistics  | Mussau-Emira language, Mussau Is.
Ukarumpa, Eastern Highlands Province | New Ireland Province
Papua New Guinea | Papua New Guinea
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Ensuring no selection in a table view

2010-12-29 Thread Kyle Sluder
On Wed, Dec 29, 2010 at 3:29 PM, John Brownie  wrote:
> Erik Buck wrote:
>>
>> Enabling empty selection in IB should do the trick.  You can also control
>> selection programmatically with the delegate.
>>
>> http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTableViewDelegate_Protocol/Reference/Reference.html
>
> That looked promising, but tableView:shouldSelectRow: does not get called
> when the window appears after being created or hidden. Nor does it get
> called if I click the selected row. It does get called if I click in an
> empty row and then back in a row with data.

Is it propagating the selection from the controller? IOW, just because
you have set avoidsEmptySelection=NO doesn't mean the controller will
*prefer* an empty selection.

--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: Ensuring no selection in a table view

2010-12-29 Thread John Brownie

On Thu Dec 30 2010 09:56:18 GMT+1000 (PGT) Kyle Sluder wrote:


Is it propagating the selection from the controller? IOW, just because
you have set avoidsEmptySelection=NO doesn't mean the controller will
*prefer* an empty selection.


I don't understand this. How does the controller propagate a selection? 
How does it get a selection in the first place? Do I need to use 
something like setSelectedObjects: for the controller with an empty 
array? (Tried that, didn't change anything.)


Just to be clear, whenever the window is shown, I set the contents of 
the array to be correct for the current context. I used deselectAll: in 
the routine that set the array, but it didn't seem to have any effect.


- (void)setStateStack:(NSArray *)newStack
{
[newStack retain];
[stateStack release];
stateStack = newStack;
[stateStackTable deselectAll:self];
NSArray *tempArray = [NSArray array];
[stateStackController setSelectedObjects:tempArray];
[tempArray release];
[stateStackScroll setNeedsDisplay:YES];
}

John
--
John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg
Summer Institute of Linguistics  | Mussau-Emira language, Mussau Is.
Ukarumpa, Eastern Highlands Province | New Ireland Province
Papua New Guinea | Papua New Guinea
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Ensuring no selection in a table view

2010-12-29 Thread Kyle Sluder
On Wed, Dec 29, 2010 at 5:11 PM, John Brownie  wrote:
> On Thu Dec 30 2010 09:56:18 GMT+1000 (PGT) Kyle Sluder wrote:
>
>> Is it propagating the selection from the controller? IOW, just because
>> you have set avoidsEmptySelection=NO doesn't mean the controller will
>> *prefer* an empty selection.
>
> I don't understand this. How does the controller propagate a selection? How
> does it get a selection in the first place? Do I need to use something like
> setSelectedObjects: for the controller with an empty array? (Tried that,
> didn't change anything.)

Instances of NSArrayController expose a selectedObjects property. If
all of its columns are bound to the same NSArrayController,
NSTableView autobinds its selection binding to the controller's
selectedObjects property. This is what makes zero-code binding-based
interfaces possible.

> Just to be clear, whenever the window is shown, I set the contents of the
> array to be correct for the current context. I used deselectAll: in the
> routine that set the array, but it didn't seem to have any effect.

I created a new demo project and wasn't able to reproduce this
behavior. With avoidsEmptySelection=YES, calling -setContent: on the
array controller causes its selection to change as the window is
constructed. If I set avoidsEmptySelection=NO in IB, then this doesn't
happen.

>
> - (void)setStateStack:(NSArray *)newStack
> {
>        [newStack retain];
>        [stateStack release];
>        stateStack = newStack;
>        [stateStackTable deselectAll:self];
>        NSArray *tempArray = [NSArray array];
>        [stateStackController setSelectedObjects:tempArray];
>        [tempArray release];

This is redundant, as I'm sure you're aware. But more importantly, how
are you notifying the controller of its new content? I see no call to
-setContent: here.

>        [stateStackScroll setNeedsDisplay:YES];

This is unnecessary. Once the table view gets wind that its data has
been updated, it will call -setNeedsDisplayInRect: on itself.

--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: Ensuring no selection in a table view

2010-12-29 Thread John Brownie

On Thu Dec 30 2010 12:14:46 GMT+1000 (PGT) Kyle Sluder wrote:


Instances of NSArrayController expose a selectedObjects property. If
all of its columns are bound to the same NSArrayController,
NSTableView autobinds its selection binding to the controller's
selectedObjects property. This is what makes zero-code binding-based
interfaces possible.


I think I understand that.


I created a new demo project and wasn't able to reproduce this
behavior. With avoidsEmptySelection=YES, calling -setContent: on the
array controller causes its selection to change as the window is
constructed. If I set avoidsEmptySelection=NO in IB, then this doesn't
happen.


This may be due to some interaction with the application being Carbon, 
and this window alone being Cocoa.



This is redundant, as I'm sure you're aware. But more importantly, how
are you notifying the controller of its new content? I see no call to
-setContent: here.


Yes, definitely redundant, trying to do the same thing multiple ways. I 
tried subsets of them, but that didn't change the behaviour.


I hadn't picked up on setContent:, thinking that the binding to the data 
source as the instance variable would do it, which brings to mind the 
adage "assumptions are evil", and makes me wonder what other assumptions 
I've made. So I put it in, and still no joy. I was wrong, though, in 
thinking that it's the first item that is selected. Sometimes it's the 
last, sometimes the first.


- (void)setStateStack:(NSArray *)newStack
{
[newStack retain];
[stateStack release];
stateStack = newStack;
[stateStackController setContent:stateStack];
NSArray *tempArray = [NSArray array];
[stateStackController setSelectedObjects:tempArray];
[tempArray release];
}

The same behaviour happens with or without the last three lines. I even 
tried explicitly setting the selection to a particular row in that 
method, but it seems to have no effect on the behaviour. I'm getting to 
the point where I might just give up on solving it and move on to the 
next thing.



[stateStackScroll setNeedsDisplay:YES];


This is unnecessary. Once the table view gets wind that its data has
been updated, it will call -setNeedsDisplayInRect: on itself.


That's nice, I hadn't realised that. Thanks for your input!

John
--
John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg
Summer Institute of Linguistics  | Mussau-Emira language, Mussau Is.
Ukarumpa, Eastern Highlands Province | New Ireland Province
Papua New Guinea | Papua New Guinea
___

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

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


Detecting MouseUp in NSSplitview

2010-12-29 Thread Peter Zegelin
I would like to detect when a user has finished dragging on a splitview divider 
but unfortunately just adding:

- (void)mouseUp:(NSEvent *)theEvent{
[super mouseUp:theEvent];
}

to my NSSplitview subclass doesn't seem to work as it never gets called. I get 
the mouseDown event but not the mouseUp.

Any suggestions as to why my mouseup isn't getting called would be appreciated.

Thanks!

Peter___

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

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

2010-12-29 Thread Kyle Sluder
On Wed, Dec 29, 2010 at 9:30 PM, Peter Zegelin
 wrote:
> I would like to detect when a user has finished dragging on a splitview 
> divider but unfortunately just adding:
>
> - (void)mouseUp:(NSEvent *)theEvent{
>        [super mouseUp:theEvent];
> }
>
> to my NSSplitview subclass doesn't seem to work as it never gets called. I 
> get the mouseDown event but not the mouseUp.
>
> Any suggestions as to why my mouseup isn't getting called would be 
> appreciated.

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/HandlingMouseEvents/HandlingMouseEvents.html%23//apple_ref/doc/uid/1060i-CH6-SW18

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