UIGestureRecognizer in superview firing

2011-05-02 Thread Roland King
I have a UIView subclass which has a number of UIButtons and UISliders on it, 
it's a sort of control panel. I added UIPanGestureRecognizer to it with the 
idea that if you stick your finger down outside one of the embedded controls, 
you can move the window around. Wrote the handler for the gesture recognizer, 
that worked. 

However I found that if I press one of the buttons, or try to drag one of the 
sliders which are subviews of my view, the PanGestureRecognizer fires. That 
completely breaks those controls as the sliders stop sliding and you cannot 
drag yourself off the button to cancel the press, you just drag the view 
around. 

I've re-read the UIGestureRecognizer documentation again twice and cannot 
figure out why this is happening. Take the example of a touch going down on the 
knob of one of the sliders, hitTest:withEvent correctly returns the UISlider (I 
tested that) and so the touches should go to the slider directly and not to its 
superview, my UIView subclass or its attached gesture recognizer at all. I 
understand that gesture recognizers get touches before their attached views, 
this from the Event Handling Guide For iOS

" Delivery of events initially follows the usual path: from operating system to 
the application object to the window object representing the window in which 
the touches are occurring. But before sending an event to the hit-tested view, 
the window object sends it to the gesture recognizer attached to that view or 
to any of that view’s subviews."

In this case the hit-tested view was the UISlider so I would expect touches to 
be sent to any gesture recognizers on that UISlider and its subviews and then 
to the UISlider itself  but not to the UIView of which it's a subview nor its 
attached gesture recognizer, the slider would work, the view wouldn't try to 
pan. 

I did wonder if the UISlider didn't (for some strange reason) respond to 
touchesBegan:withEvent: and thus the touch was bubbling back up to the 
superview, my class, and being sent to the gesture recognizer there at the same 
time, but apart from there being no documentation about such a flow, the 
UISlider DOES respond to touchesBegan:withEvent:, so thats not it. 

I can only find documentation which talks about subviews of the hit-tested view 
and their recognizers receiving touches, nothing can I find about superviews, 
so this flow is puzzling. 

I'm going to use the PanGestureRecognizer delegate method 
gestureRecognizer:shouldReceiveTouch: to stop this happening. Can someone 
however explain which piece of documentation I've not read or have 
misunderstood which explains why the PanGR on the superview of the hit-tested 
view is getting touches at all? 

Thanks

Roland


___

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

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


Online NSPrinters

2011-05-02 Thread Thomas Davie
Heya,

The NSPrinter documentation says it will return nil of the specified printer 
passed to +printerWithName: is not available.  Apparently being "available" 
does not correspond to being "online" as listed in System Preferences.  Is 
there a sane way to check if a printer is connected and ready to go?

Thanks

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/archive%40mail-archive.com

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


Re: UIGestureRecognizer in superview firing

2011-05-02 Thread Heath Borders
I've seen this behavior as well, and I solved it the same way you did.
 I hope there is a better way.

-Heath Borders
heath.bord...@gmail.com
Twitter: heathborders
http://heath-tech.blogspot.com



On Mon, May 2, 2011 at 3:15 AM, Roland King  wrote:
> I have a UIView subclass which has a number of UIButtons and UISliders on it, 
> it's a sort of control panel. I added UIPanGestureRecognizer to it with the 
> idea that if you stick your finger down outside one of the embedded controls, 
> you can move the window around. Wrote the handler for the gesture recognizer, 
> that worked.
>
> However I found that if I press one of the buttons, or try to drag one of the 
> sliders which are subviews of my view, the PanGestureRecognizer fires. That 
> completely breaks those controls as the sliders stop sliding and you cannot 
> drag yourself off the button to cancel the press, you just drag the view 
> around.
>
> I've re-read the UIGestureRecognizer documentation again twice and cannot 
> figure out why this is happening. Take the example of a touch going down on 
> the knob of one of the sliders, hitTest:withEvent correctly returns the 
> UISlider (I tested that) and so the touches should go to the slider directly 
> and not to its superview, my UIView subclass or its attached gesture 
> recognizer at all. I understand that gesture recognizers get touches before 
> their attached views, this from the Event Handling Guide For iOS
>
> " Delivery of events initially follows the usual path: from operating system 
> to the application object to the window object representing the window in 
> which the touches are occurring. But before sending an event to the 
> hit-tested view, the window object sends it to the gesture recognizer 
> attached to that view or to any of that view’s subviews."
>
> In this case the hit-tested view was the UISlider so I would expect touches 
> to be sent to any gesture recognizers on that UISlider and its subviews and 
> then to the UISlider itself  but not to the UIView of which it's a subview 
> nor its attached gesture recognizer, the slider would work, the view wouldn't 
> try to pan.
>
> I did wonder if the UISlider didn't (for some strange reason) respond to 
> touchesBegan:withEvent: and thus the touch was bubbling back up to the 
> superview, my class, and being sent to the gesture recognizer there at the 
> same time, but apart from there being no documentation about such a flow, the 
> UISlider DOES respond to touchesBegan:withEvent:, so thats not it.
>
> I can only find documentation which talks about subviews of the hit-tested 
> view and their recognizers receiving touches, nothing can I find about 
> superviews, so this flow is puzzling.
>
> I'm going to use the PanGestureRecognizer delegate method 
> gestureRecognizer:shouldReceiveTouch: to stop this happening. Can someone 
> however explain which piece of documentation I've not read or have 
> misunderstood which explains why the PanGR on the superview of the hit-tested 
> view is getting touches at all?
>
> Thanks
>
> Roland
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/heath.borders%40gmail.com
>
> This email sent to heath.bord...@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


iOS 4.3: AVAsset loadValuesAsynchronouslyForKeys not calling completion handler?

2011-05-02 Thread John Michael Zorko

Hello, all ...

Sometimes loadValuesAsynchronouslyForKeys doesn't call it's completion handler, 
i'm thinking possibly due to some network error. It will just hang there, and 
the completion handler block is never executed. My question is: how can I trap 
this?

Regards,

John

___

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

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

2011-05-02 Thread Lorenzo Thurman
On Fri, Apr 29, 2011 at 3:18 PM, Quincey Morris  wrote:

> Your description of the problem is a bit fuzzy. Let me nitpick at your
> description -- it may be that if you straighten out your terminology you'll
> solve your problem:
>
> On Apr 29, 2011, at 12:56, Lorenzo Thurman wrote:
>
> > I have an NSTableView column bound to an NSArrayController which itself
> > is bound to an NSMutableArray.
>
> No, it's not bound to a NSMutableArray. It's bound to an array *property*
> of some object. If the array controller is in the XIB file, it's typically
> bound to one of File's Owner's properties.
>
> > The mutable array resides in a different XIB.
>
> Almost certainly not. At least, I hope not. Why would you put a mutable
> array in a XIB? A mutable array is likely used as the backing store of an
> array property of an object in your data model (or possibly of a controller
> object).
>
> > The data is displayed as expected, but when I remove an item, although it
> > does disappear from the table, the
> > change is not written to disk when the application quits. I use
> > NSKeyedArchiver to persist the array to disk upon quitting. When the
> > application quits, the original array including the removed items is
> > written to disk.
>
> Which array? We haven't actually located the array yet. You might
> inadvertently have 2 arrays where you only intend there to be one.
>
> > I did some debugging and found that after the items are removed from the
> > array controller, the underlying array does indeed reflect the removal,
> > but something happens between there and quitting the application that
> > brings the removed items back into the array.
>
> Another possibility is that you really did put an array into a XIB, which
> means the *same* array contents will be reloaded from the XIB every time
> that XIB is loaded. Are you sure "the array" isn't being written correctly
> to your persistent store? Perhaps it is, but the written value isn't being
> reloaded next time?
>
> > My application also uses an NSPopupButton to display these same items.
>
> Is this just additional information, or are you saying there's an issue
> with the the popup button too?
>
>
> My apologies for not being clearer. I spent some time over the weekend, but
still couldn't figure it out, so here goes:
I have an NSPopupButton whose content is bound to an NSArrayController's
(controller A) arrangeObjects controller Key. This NSArrayController is
bound to an NSMutableArray which holds the items for display. The contents
of the NSPopuButton display as expected.

In another XIB (NSWindowController subclass), I have an NSTableView whose
only column's value is bound to an NSArrayController's (controller B)
arrangedObjects. This NSArrayController resides in the same XIB as the
NSTableView and is bound via an NSObject proxy in that same XIB to the same
NSMutableArray as controller A. These items display as expected in the
NSTableView. I can remove an item from the NSTableView, and in the debugger,
I can see that the item is indeed removed from the NSMutableArray. But when
I save the array on quitting the application, I see the removed item has
somehow made it back into the array.

I've also noticed that the NSPopupButton continues to display the removed
item. I would expect it would have updated itself, but clearly, I'm missing
something.
Thx

-- 
"My break-dancing days are over, but there's always the funky chicken"
--The Full Monty
___

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

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

2011-05-02 Thread Bing Li
Dear all,

Can anyone answer this question?

Thanks so much!
Bing

On Fri, Apr 29, 2011 at 7:21 PM, Bing Li  wrote:

> Dear Michael,
>
> "Disgracefully" means the client does not close normally. It might be
> crashed or closed by killing the relevant thread or process. I did that by
> clicking the red Tasks button in XCode. In this situation, the connection
> must not be closed properly with the socket methods.
>
> According to my test, [AsyncSocketDelegate onSocket:
> willDisconnectWithError:] is not called either.
>
> I got the sample code from
> http://www.macresearch.org/cocoa-scientists-part-xxix-message. I am still
> a new developer. I am not sure if the code has any problems.
>
> Thanks so much for your help!
>
> Best regards,
> BIng
>
>
> On Fri, Apr 29, 2011 at 6:56 AM, Michael Dautermann wrote:
>
>> >
>> > I started to use CocoaAsyncSocket to establish TCP connections among
>> iPads.
>> >
>> > I got a problem. According to the references (
>> > http://code.google.com/p/cocoaasyncsocket/wiki/Reference_AsyncSocket),
>> > onSocketDidDisconnect would be invoked immediately if the connection is
>> not
>> > already disconnected. I felt confused. What does "not already
>> disconnected"
>> > mean? I think onSocketDidDisconnect should be called when a connection
>> is
>> > disconnected. The description in the reference is wrong?
>> >
>> > I implemented a server and a client using CocoaAsyncSocket. When closing
>> the
>> > client disgracefully, I noticed that onSocketDidDisconnect was NOT
>> called.
>> > Anything wrong with it?
>>
>> Here are some questions that might help get some further context:
>>
>> how are you closing the client "disgracefully"?
>>
>> did the companion [AsyncSocketDelegate onSocket: willDisconnectWithError:]
>> method get called?
>>
>> did you properly set your delegate and define that your object (the one
>> that holds your delegate methods) conforms to the delegate protocol in it's
>> .h file?
>>
>>
>>
>
___

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

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

2011-05-02 Thread Matt Neuburg
On Mon, 02 May 2011 16:15:59 +0800, Roland King  said:
>I have a UIView subclass which has a number of UIButtons and UISliders on it, 
>it's a sort of control panel. I added UIPanGestureRecognizer to it with the 
>idea that if you stick your finger down outside one of the embedded controls, 
>you can move the window around. Wrote the handler for the gesture recognizer, 
>that worked. 
>
>However I found that if I press one of the buttons, or try to drag one of the 
>sliders which are subviews of my view, the PanGestureRecognizer fires. That 
>completely breaks those controls as the sliders stop sliding and you cannot 
>drag yourself off the button to cancel the press, you just drag the view 
>around. 
>
>I've re-read the UIGestureRecognizer documentation again twice and cannot 
>figure out why this is happening.

This is correct behavior and is very thoroughly explained in my book (Chapter 
18, "Touches"). As I say there, you need to think of a view as surrounded by a 
swarm of gesture recognizers - those attached to the view, those attached to 
its superview, and so on up the chain. Every gesture recognizer in the swarm 
gets a crack at recognizing any gesture; if any does, then (by default) all the 
other gesture recognizers in the swarm are made to fail.

The reason for this behavior is obvious if you consider the case of two views 
where you put one finger on each view and rotate around their common center. 
Neither view can detect this gesture, since it is a two-finger gesture and each 
view knows about only one finger, so the only way this can work is to attach 
the rotate gesture recognizer to the superview. This in turn implies that 
touches must be delivered to gesture recognizers up the superview chain.

>I'm going to use the PanGestureRecognizer delegate method 
>gestureRecognizer:shouldReceiveTouch: to stop this happening.

That's correct. It's very easy to implement this, because a touch has a view, 
so you can detect immediately that this touch was not on the superview. m.

--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook___

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

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

2011-05-02 Thread Quincey Morris
On May 2, 2011, at 08:02, Lorenzo Thurman wrote:

> I have an NSPopupButton whose content is bound to an NSArrayController's 
> (controller A) arrangeObjects controller Key. This NSArrayController is bound 
> to an NSMutableArray which holds the items for display. The contents of the 
> NSPopuButton display as expected.
> 
> In another XIB (NSWindowController subclass), I have an NSTableView whose 
> only column's value is bound to an NSArrayController's (controller B) 
> arrangedObjects. This NSArrayController resides in the same XIB as the 
> NSTableView and is bound via an NSObject proxy in that same XIB to the same 
> NSMutableArray as controller A. These items display as expected in the 
> NSTableView. I can remove an item from the NSTableView, and in the debugger, 
> I can see that the item is indeed removed from the NSMutableArray. But when I 
> save the array on quitting the application, I see the removed item has 
> somehow made it back into the array.

This is a little bit clearer, but still to vague to be of much use.

The short answer is that it sounds like you have 2 mutable arrays underlying 
all of this. After you've checked the item removal in the debugger, you should 
check in the debugger again at save time that it's the *same* array you're 
saving, rather than a duplicate that hasn't had the item removed.

I have no idea what "bound via an NSObject proxy in that same XIB to the same 
NSMutableArray as controller A" means. I'm also not sure, when you say "bound", 
you are always referring to an actual binding, or sometimes to an outlet 
connection.

To solve this, we need to to know all of the bindings, including (for each 
one): the object that's bound from; its location (in nib or created 
programmatically); the binding name; the object that it's bound to; *its* 
location; the property key that its bound to.


___

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

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


WunderRadio MMS streaming: Want to hear!

2011-05-02 Thread Emiliano Cenizo
Hi there!

I have managed, finally, to build and import FFMpeg, LibMMS and
WunderRadio's "common".

the thing is... altough an stream is generated and im recibing bytes
(according to the NSLog console), i cant hear a thing!

whats missing?

My code is:

 - (void)viewDidLoad {

MusicViewController *mvc = [[MusicViewController alloc] init];
PlaylistEntry *urlList = [[[PlaylistEntry alloc] init]autorelease];

 urlList.altURL = [NSMutableArray arrayWithObjects:@"mms://", nil];

[mvc setEntry: urlList];

[mvc play];

[mvc release];
[super viewDidLoad];
}

The console result is:

2011-05-02 11:11:34.828 RadioDelPlata[1901:5c03] we should remap the streams: 1
FFmpeg version SVN-r15006, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --disable-mmx --disable-mmx2 --disable-ssse3
  libavutil 49.14. 0 / 49.14. 0
  libavcodec52.11. 0 / 52.11. 0
  libavformat   52.25. 0 / 52.25. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  built on Apr 28 2011 15:06:01, gcc: 4.2.1 (Apple Inc. build 5666) (dot 3)
2011-05-02 11:11:35.043 RadioDelPlata[1901:5c03] code_open - got
pointer: 
chunk seq:18435568
chunk seq:18435570
chunk seq:18435572
chunk seq:18435574
chunk seq:18435576
chunk seq:18435578
chunk seq:18435580
chunk seq:18435583
chunk seq:18435585
Input #0, asf, from 'code:0x858560':
  Duration: N/A, start: 3331418.845000, bitrate: 168 kb/s
Stream #0.0: Audio: wmav2, 48000 Hz, stereo, s16, 128 kb/s
Stream #0.1: Audio: wmav2, 32000 Hz, stereo, s16, 40 kb/s
2011-05-02 11:11:37.609 RadioDelPlata[1901:5c03] code_open - got
pointer: 
Output #0, aiff, to 'code:0x858560':
Stream #0.0: Audio: pcm_s16be, 32000 Hz, stereo, s16, 1024 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
source index: 1
Press [q] to stop encoding
chunk seq:18435587
chunk seq:18435589
chunk seq:18435591
chunk seq:18435593
chunk seq:18435595
chunk seq:18435597
chunk seq:18435600
rebuffering 101 > 100
rebuffering 101 > 100
2011-05-02 11:11:40.262 RadioDelPlata[1901:5c03] found property 'ffmt'
2011-05-02 11:11:40.277 RadioDelPlata[1901:5c03] AudioDataFileFormat 'AIFF'
2011-05-02 11:11:40.296 RadioDelPlata[1901:5c03] found property 'dfmt'
2011-05-02 11:11:40.311 RadioDelPlata[1901:5c03] found property 'bcnt'
2011-05-02 11:11:40.331 RadioDelPlata[1901:5c03] AudioDataByteCount: 4294967288
2011-05-02 11:11:40.347 RadioDelPlata[1901:5c03] found property 'doff'
2011-05-02 11:11:40.364 RadioDelPlata[1901:5c03] found property 'pcnt'
2011-05-02 11:11:40.381 RadioDelPlata[1901:5c03] AudioDataPacketCount 1073741822
2011-05-02 11:11:40.399 RadioDelPlata[1901:5c03] found property 'redy'
2011-05-02 11:11:40.416 RadioDelPlata[1901:5c03] About to play audio
in 'lpcm' format
2011-05-02 11:11:40.442 RadioDelPlata[1901:5c03] called
AudioQueueNewOutput.. audioQueue: 86b3e0
2011-05-02 11:11:40.455 RadioDelPlata[1901:5c03] get info
kAudioFileStreamProperty_MagicCookieData failed
2011-05-02 11:11:40.473 RadioDelPlata[1901:5c03] fillBufferCount
(increasing) 2 fillBufferIndex 1
chunk seq:18435602
chunk seq:18435604
chunk seq:18435606
chunk seq:18435608
chunk seq:18435610
chunk seq:18435612

And keeps giving "chunk seqs"...

I was checking WunderRadio console as well, and there ir very little
difference... although WR streams perfectly the same MMS Url.

Any Idea of how can I hear some radio?

Thanks in advance!
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler

2011-05-02 Thread lorenzo7620

On May 2, 2011 12:03pm, Quincey Morris  wrote:

On May 2, 2011, at 08:02, Lorenzo Thurman wrote:




> I have an NSPopupButton whose content is bound to an  
NSArrayController's (controller A) arrangeObjects controller Key. This  
NSArrayController is bound to an NSMutableArray which holds the items for  
display. The contents of the NSPopuButton display as expected.



>


> In another XIB (NSWindowController subclass), I have an NSTableView  
whose only column's value is bound to an NSArrayController's (controller  
B) arrangedObjects. This NSArrayController resides in the same XIB as the  
NSTableView and is bound via an NSObject proxy in that same XIB to the  
same NSMutableArray as controller A. These items display as expected in  
the NSTableView. I can remove an item from the NSTableView, and in the  
debugger, I can see that the item is indeed removed from the  
NSMutableArray. But when I save the array on quitting the application, I  
see the removed item has somehow made it back into the array.





This is a little bit clearer, but still to vague to be of much use.




The short answer is that it sounds like you have 2 mutable arrays  
underlying all of this. After you've checked the item removal in the  
debugger, you should check in the debugger again at save time that it's  
the *same* array you're saving, rather than a duplicate that hasn't had  
the item removed.




I have no idea what "bound via an NSObject proxy in that same XIB to the  
same NSMutableArray as controller A" means. I'm also not sure, when you  
say "bound", you are always referring to an actual binding, or sometimes  
to an outlet connection.




To solve this, we need to to know all of the bindings, including (for  
each one): the object that's bound from; its location (in nib or created  
programmatically); the binding name; the object that it's bound to; *its*  
location; the property key that its bound to.







There's only one array. If I set a breakpoint after the item has been  
removed and then in gdb: po (NSArray*)[mycontroller arrangedObjects] . The  
removed item is not in the array. If during archiving, I do the same, the  
removed item is back. The same occurs if I inspect the array directly in  
gdb.


All bindings are setup in IB. Here's the rundown:
NSPopupButton
Content
Bind To: itemController
Controller Key: arrangedObjects

itemController
Content Array
Bind To: MyAppsClass
Controller Key: myMutableArray


In a seperate XIB:
NSTableViewColumn
Value
Bind To: anotherItemController
Controller Key: arrangedObjects

anotherItemController
Content Array
Bind to: MyAppsClass (added an NSObject from palette and set its class to  
MyAppsClass)

Controller Key: myMutableArray
___

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

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

2011-05-02 Thread Quincey Morris
On May 2, 2011, at 12:47, lorenzo7...@gmail.com wrote:

> anotherItemController
> Content Array
> Bind to: MyAppsClass (added an NSObject from palette and set its class to 
> MyAppsClass)
> Controller Key: myMutableArray

If this is what you were calling a "proxy" earlier, it isn't. It's a separate 
instance of MyAppsClass that's (re-)created when the nib is loaded.

I'm assuming that MyAppsClass represents an app delegate singleton. The normal 
way to create it is to place an instance in the MainMenu nib, and connect the 
Application proxy's delegate outlet to it.

If the nib file you're referring to above is actually the MainMenu nib, then 
that's fine. If not, then you've created a second instance -- you shouldn't 
have added a NSObject from the palette, but should have bound to the 
Application proxy instead, using the "delegate" key to get to the existing 
singleton object.

> If I set a breakpoint after the item has been removed and then in gdb: po 
> (NSArray*)[mycontroller arrangedObjects] . The removed item is not in the 
> array. If during archiving, I do the same, the removed item is back.

You kind of sidestepped the question here. There are, if I understand 
correctly, 2 different array controllers (one for each NIB), both of which are 
supposed to use the same underlying data model array for their content. You're 
not saving the array controllers (at least I hope not), but you're saving the 
underlying data model. Therefore looking at the array controller (or even their 
arrangedObjects) doesn't tell you anything about what's being saved.

What you should be trying to resolve, using the debugger, is the question of 
whether there are 2 underlying data model arrays when there should be only one. 
To do that, you need to be looking at the object address of the mutable 
array(s).


___

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

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

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

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


Re: Service with optional input

2011-05-02 Thread Jerry Krinock

On 2011 Apr 30, at 19:45, Jim Thomason wrote:

> Can I provide a service with optional input?
> 
> I want the user to be able to call the service with a text string input, but 
> it's also reasonable to call it w/o any input at all.

> Any ideas about how I can implement it?

Since no one else replied, I'm fairly confident in saying "No".  My reading of 
the documentation is that the ill-named "Services" in Mac OS X are designed 
very narrowly, for one purpose only: processing strings.

The only instance in which you can do anything else, without resorting to 
hacks, is if the app you want to "serve" has an extension or plugin API, which 
usually means a huge programming and maintenance effort.

___

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

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

2011-05-02 Thread Jean-Christophe Helary

On 3 mai 11, at 13:27, Jerry Krinock wrote:

> 
> On 2011 Apr 30, at 19:45, Jim Thomason wrote:
> 
>> Can I provide a service with optional input?
>> 
>> I want the user to be able to call the service with a text string input, but 
>> it's also reasonable to call it w/o any input at all.
> 
>> Any ideas about how I can implement it?
> 
> Since no one else replied, I'm fairly confident in saying "No".  My reading 
> of the documentation is that the ill-named "Services" in Mac OS X are 
> designed very narrowly, for one purpose only: processing strings.

Sure, but you can process strings that are input from the selection (which is 
what Jim means if I am correct) or strings that either are created out of the 
blue from within the service or that come from other input devices (files etc).

In the case of Automator generated services, there is no possibility to provide 
the option Jim wants and I would not be surprised if it were the case for all 
the services: either the service is set to work on the selection (which can be 
anything from a text string to a movie file) or not.


Jean-Christophe Helary

fun: http://mac4translators.blogspot.com
work: http://www.doublet.jp (ja/en > fr)
tweets: http://twitter.com/brandelune

___

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

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