Re: button cell highlight/state/type

2014-04-10 Thread Graham Cox
Thanks Kyle - looks just the job.

--Graham


On 10 Apr 2014, at 3:57 pm, Kyle Sluder k...@ksluder.com wrote:

 
 (Sent from the road)
 
 On Apr 9, 2014, at 10:17 PM, Graham Cox graham@bigpond.com wrote:
 
 Hi all,
 
 Does anyone have a handy guide or pointer to the relevant docs which show 
 all the various meanings of highlight, state, appearance and button type. 
 There are so many combinations, and the class reference doesn't really 
 explain it very well (or at all). Some buttons appear to care about the 
 highlight state, others about the 'state', depending on type and what 
 appearance is in use. All seems a bit arbitrary.
 
 Try my button tester: https://github.com/kylesluder/ButtonTester
 
 
 I'm creating a custom button cell that has to work in a variety of 
 situations, and so far it's hard to avoid a mix-up between different types 
 due to the conflation of the highlight and the state.
 
 Highlight refers to “mouse is currently depressed.”
 
 --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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Excessive open gui graphics files on Mavericks

2014-04-10 Thread Michael Watson
when all you have is a rocket launcher, every problem looks like rocket bait.


--


On 9 Apr, 2014, at 0:52, Maxthon Chan xcvi...@me.com wrote:

 LOL
 
 I actually used cramfs once in a game carried the rules database. The rules 
 are so complicated so I tried to make it smaller without sacrificing the 
 efficiency of the game code. Ended up using cramfs for that.
 
 On Apr 9, 2014, at 15:49, Charles Srstka cocoa...@charlessoft.com wrote:
 
 On Apr 9, 2014, at 2:20 AM, Maxthon Chan xcvi...@me.com wrote:
 
 I’d recommend cramfs as it is a real filesystem that is optimised to be 
 expanded in-memory.
 
 Not complicated enough. I'd recommend encrypting the whole thing with an 
 AES-256 key which is encrypted using elliptical-curve cryptography, and 
 stuff it into a disk image (NDIF, ADC compression) and compress that using 
 zlib, LZMA, and the old PKZIP Implode algorithm. Then, encode the resulting 
 bytes by finding the first offset at which each digit occurs in the decimal 
 representation of pi, then encode the octal representation of those numbers 
 in EBCDIC format, then compress it again and encode the resulting bytes as 
 offsets into an Ogg Vorbis recording of the soundtrack to Star Trek V: The 
 Final Frontier.
 
 Because why the hell not?
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/mikey-san%40bungie.org
 
 This email sent to mikey-...@bungie.org


___

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

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

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

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

Re: button cell highlight/state/type

2014-04-10 Thread Graham Cox

On 10 Apr 2014, at 3:57 pm, Kyle Sluder k...@ksluder.com wrote:

 Try my button tester: https://github.com/kylesluder/ButtonTester


It's definitely very helpful, but there's something I don't understand. Why 
does the state toggle between on and off on each click, even for basic 
pushbuttons? Is that normal? I've skimmed through the code and I can't see 
anything that's doing that, so it leaves the NSButton code itself. This 
toggling occurs no matter what other settings are used.

--Graham
___

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

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

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

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

Re: button cell highlight/state/type

2014-04-10 Thread Kyle Sluder
On Apr 10, 2014, at 12:19 AM, Graham Cox graham@bigpond.com wrote:
 
 It's definitely very helpful, but there's something I don't understand. Why 
 does the state toggle between on and off on each click, even for basic 
 pushbuttons? Is that normal?

Yup. Push buttons normally don’t show state, so you never notice it.

Gotta love AppKit’s surviving NeXTisms.

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: button cell highlight/state/type

2014-04-10 Thread Graham Cox

On 10 Apr 2014, at 5:22 pm, Kyle Sluder k...@ksluder.com wrote:

 Yup. Push buttons normally don’t show state, so you never notice it.


OK, learned something after all this time. It's also why I was having trouble 
making my custom cell work - it wants to use state but was drawing in the 
'wrong' state half the time - now I know why! ;)

--Graham



___

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

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

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

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

Re: NSDictionary @synchronize to read multiple objects

2014-04-10 Thread Dave
Hi,

I was confused by this:

 It also doesn't make sense to synchronize on the myDict object.  That's what 
 is in flux.  You should synchronize on self, the object which owns and 
 manages myDict. 

Surely as long as every access to the dictionary is @synchronized to the same 
entity it’s fine?

The way I’d atcheive this is to make the NSMutableDictionary a private property:

@property (nonatomic,strong)NSMutableDictionary*  pDictX;

 and define public methods:

-(void) removeObjectFromDictXWithKey:(NSString*) theKey;
-(void) addObject:(id) theObject toDictXWithKey:(NSString*) theKey;
-(id) getObectFromDictXWithKey:(NSString*) theKey;

The body of these methods would encapsulated with @synchronized :

 @synchronized (self. pDictX)
 {

// Code to Access self.pDictX

 }

If you wanted two dictionaries to work in this pay, just define another set for 
pDictY, etc.

Surely if you  do @synchronized(self) then access to pDictX will be blocked 
needlessly by access to pDictY?

Cheers
Dave

On 1 Apr 2014, at 14:45, Trygve Inda cocoa...@xericdesign.com wrote:

 On Apr 1, 2014, at 12:25 AM, Jens Alfke wrote:
 
 On Mar 31, 2014, at 10:16 PM, Trygve Inda cocoa...@xericdesign.com wrote:
 
 I need to be able to set a new myDict and not have it happen between the
 reading of different values from the dictionary by other threads.
 
 Don’t expose the dictionary in mutable form. You can’t make that thread-safe
 unless all the clients voluntarily agree to do something like wrap their
 usage with @synchronized blocks using the dictionary as a parameter.
 
 I didn't see mention of mutating the dictionary.  It sounds like he's just
 using a setter to replace it (which also likely releases it, which makes it
 potentially unsafe).
 
 I agree, though, that properties should almost never be of mutable type.  But
 making them immutable doesn't, by itself, create thread-safety.  If nothing
 else, the owner could still mutate it while other threads are reading it.
 
 Regards,
 Ken
 
 
 Yes, the property is Mutable in the host app, but after being sent to the
 helper app (which has multiple threads), it could just as easily be an
 NSDictioanary (non-mutable).
 
 I just need to be 100% certain that when the helper app threads read two
 values from the dictionary, that the dictionary does not change between (or
 during) these two reads.
 
 T.
 
 
 
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com
 
 This email sent to d...@looktowindward.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Mailing lists

On 9 Apr 2014, at 22:06, Tom Doan t...@estima.com wrote:

 I have a dialog which has an NSBox. Inside the NSBox are two 
 (separate, but conceptually linked) sets of radio buttons. These are 
 just NSButtons with radio style---I haven't (at least intentionally) 
 embedded them into an NSMatrix. However, when I select one of 
 the buttons from one set, it resets all others in both sets to off so 
 somehow it's automatically interpreting all the buttons inside 
 the box as a single collection even though that's not my intention. 
 However, I can't see anything in the description of either NSButton 
 or NSBox that seems to cover this behavior so I can override it. Can 
 someone explain what's happening, please?
 
I did as you implied and placed two separate matrices inside an NSBox and they 
function independently.

Are you sure that you don’t have all the buttons in a single matrix?

You say that the buttons are linked, are you sure that you are not triggering 
the state of one set from the other?

J

 Thanks,
 
 Tom Doan
 Estima
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/lists%40mugginsoft.com
 
 This email sent to li...@mugginsoft.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSDictionary @synchronize to read multiple objects

2014-04-10 Thread Roland King

On 10 Apr, 2014, at 6:20 pm, Dave d...@looktowindward.com wrote:

 Hi,
 
 I was confused by this:
 
 It also doesn't make sense to synchronize on the myDict object.  That's what 
 is in flux.  You should synchronize on self, the object which owns and 
 manages myDict. 
 
 Surely as long as every access to the dictionary is @synchronized to the same 
 entity it’s fine?
 
 The way I’d atcheive this is to make the NSMutableDictionary a private 
 property:
 
 @property (nonatomic,strong)NSMutableDictionary*  pDictX;
 
 and define public methods:
 
 -(void) removeObjectFromDictXWithKey:(NSString*) theKey;
 -(void) addObject:(id) theObject toDictXWithKey:(NSString*) theKey;
 -(id) getObectFromDictXWithKey:(NSString*) theKey;


Yes but that's not what he's doing, he's not mutating the dictionary (even 
though it's mutable), he's replacing one dictionary with another one. So the 
point of synchronizing on self in that case is to prevent the dictionary being 
swapped out between calls. 


 
 
 On Mar 31, 2014, at 10:16 PM, Trygve Inda cocoa...@xericdesign.com wrote:
 
 I need to be able to set a new myDict and not have it happen between the
 reading of different values from the dictionary by other threads.
 

___

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

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

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

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

NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Colas B
Dear cocoa-dev,

I want to do with an `NSTask` what I am able to do in the terminal via

    $ myprogram myfile.ext

I know that `myprogram` (I don't have any control on this program) launches 
another program `myauxprogram`. Furthermore, the path to `myprogram` is `path1` 
and the path to `myprogram` is `path2`.

If I do

     NSTask * myTask = [[NSTask alloc] init];
    
     NSArray * arguments = @[@myfile.ext] ;
    
     [myTask setCurrentDirectoryPath:[URLOfTheFolder path]];
     [myTask setLaunchPath:@/path1/myprogram];
     [myTask setArguments:arguments];
    
     [myTask launch] ;

I get the following error `sh: myauxprogam: command not found`

If I create a symbol link in `path1` to `myauxprogram`, the problem is the same.

How is it that when I execute the program in a terminal, everything goes well 
but via NSTask it fails? How can I solve this problem?

Thanks,
Colas
___

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

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

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

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

Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Keary Suska
On Apr 10, 2014, at 6:57 AM, Colas B wrote:

 Dear cocoa-dev,
 
 I want to do with an `NSTask` what I am able to do in the terminal via
 
 $ myprogram myfile.ext
 
 I know that `myprogram` (I don't have any control on this program) launches 
 another program `myauxprogram`. Furthermore, the path to `myprogram` is 
 `path1` and the path to `myprogram` is `path2`.
 
 If I do
 
  NSTask * myTask = [[NSTask alloc] init];
 
  NSArray * arguments = @[@myfile.ext] ;
 
  [myTask setCurrentDirectoryPath:[URLOfTheFolder path]];
  [myTask setLaunchPath:@/path1/myprogram];
  [myTask setArguments:arguments];
 
  [myTask launch] ;
 
 I get the following error `sh: myauxprogam: command not found`
 
 If I create a symbol link in `path1` to `myauxprogram`, the problem is the 
 same.
 
 How is it that when I execute the program in a terminal, everything goes well 
 but via NSTask it fails? How can I solve this problem?


This is more likely a shell scripting issue, rather than am NSTask issue, 
unless sandboxing is somehow interfering, and you are obscuring the issue by 
not telling us at least how myprogram is locating myauxprogram. The most likely 
culprit is that the invocation of myauxprogram in myprogram is a relative path 
that relies on the PATH environment variable that is properly set by the shell, 
but you don't set in NSTask.

HTH,

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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

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

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

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

Width defining NSLayoutConstraint zero

2014-04-10 Thread Jonathan Mitchell
On some occasions I want my controls to collapse and set a width defining 
constraint constant to zero.

In some cases, say a checkbox, an onscreen artefact remains.
I presume that this is because the constraint is defining the layout rather 
than the frame rectangle.

Is the only workaround to wrap such controls in another view and collapse the 
superview instead?

Jonathan
___

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

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

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

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Keary Suska
On Apr 9, 2014, at 5:30 PM, Graham Cox wrote:

 
 On 10 Apr 2014, at 7:06 am, Tom Doan t...@estima.com wrote:
 
 have a dialog which has an NSBox. Inside the NSBox are two 
 (separate, but conceptually linked) sets of radio buttons. These are 
 just NSButtons with radio style---I haven't (at least intentionally) 
 embedded them into an NSMatrix. However, when I select one of 
 the buttons from one set, it resets all others in both sets to off so 
 somehow it's automatically interpreting all the buttons inside 
 the box as a single collection even though that's not my intention. 
 However, I can't see anything in the description of either NSButton 
 or NSBox that seems to cover this behavior so I can override it. Can 
 someone explain what's happening, please?
 
 
 I'm not exactly certain of the mechanism, but I think radio buttons interact 
 as a set through the agency of their immediate superview, so if several 
 buttons share it, they are assumed to be part of the same set.
 
 So you can embed the separate sets into container views or NSMatrix, and 
 they'll work as you want. You mention NOT putting them into a NSMatrix for 
 some reason - what reason? That's the usual way to set up radios, though it 
 comes with the added restriction that the buttons have to be laid out on a 
 regular grid. But embedding them in a custom view that draws nothing should 
 also work, and that has no such limitation.


That would be great functionality that I have often desired but AFAICT that is 
not the case--at least I am unable to replicate it. Or do you mean multiple 
radio-type NSButtonCells in a single view? That would make sense but only 
NSMatrix has that functionality built-in, AFAIK.

I suspect this is really a code or binding issue.

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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

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

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

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

Re: button cell highlight/state/type

2014-04-10 Thread Uli Kusterer
On 10 Apr 2014, at 07:17, Graham Cox graham@bigpond.com wrote:
 Does anyone have a handy guide or pointer to the relevant docs which show all 
 the various meanings of highlight, state, appearance and button type. There 
 are so many combinations, and the class reference doesn't really explain it 
 very well (or at all). Some buttons appear to care about the highlight state, 
 others about the 'state', depending on type and what appearance is in use. 
 All seems a bit arbitrary.
 
 I'm creating a custom button cell that has to work in a variety of 
 situations, and so far it's hard to avoid a mix-up between different types 
 due to the conflation of the highlight and the state.

This answer I gave on Stack Overflow a while ago might help:

http://stackoverflow.com/questions/6398989/nsbuttoncell-subclass-button-type-not-working/12935830#12935830

Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de


___

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

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

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

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

Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Jens Alfke

On Apr 10, 2014, at 6:23 AM, Keary Suska cocoa-...@esoteritech.com wrote:

 This is more likely a shell scripting issue, rather than am NSTask issue, 
 unless sandboxing is somehow interfering, and you are obscuring the issue by 
 not telling us at least how myprogram is locating myauxprogram. The most 
 likely culprit is that the invocation of myauxprogram in myprogram is a 
 relative path that relies on the PATH environment variable that is properly 
 set by the shell, but you don't set in NSTask.

Agreed. A problem I’ve run into several times is that shells invoked from 
programs are not login shells, so they don’t run the same initialization 
scripts as the shell you use in a terminal. (For instance, a csh login shell 
runs ~/.login on startup as well as ~/.cshrc, but a non-login shell doesn’t. A 
similar thing happens with bash but I can never remember which scripts are 
involved.) If you customize your $PATH in the login-shell startup script, then 
a shellscript run outside a terminal window won’t have the same path.

—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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSDictionary @synchronize to read multiple objects

2014-04-10 Thread Ken Thomases
On Apr 10, 2014, at 5:29 AM, Roland King wrote:

 On 10 Apr, 2014, at 6:20 pm, Dave d...@looktowindward.com wrote:
 
 I was confused by this:
 
 It also doesn't make sense to synchronize on the myDict object.  That's 
 what is in flux.  You should synchronize on self, the object which owns 
 and manages myDict. 
 
 Surely as long as every access to the dictionary is @synchronized to the 
 same entity it’s fine?

 Yes but that's not what he's doing, he's not mutating the dictionary (even 
 though it's mutable), he's replacing one dictionary with another one. So the 
 point of synchronizing on self in that case is to prevent the dictionary 
 being swapped out between calls. 

Between or even during.  Correct.  And furthermore, when the dictionary is 
swapped out, the old one is presumably released.  If that was the last 
reference, then it would be deallocated.  Synchronizing on an object in one 
thread that may be deallocated in another is a very bad idea.

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Kyle Sluder
 On Apr 10, 2014, at 6:57 AM, Keary Suska cocoa-...@esoteritech.com wrote:
 
 On Apr 9, 2014, at 5:30 PM, Graham Cox wrote:
 
 I'm not exactly certain of the mechanism, but I think radio buttons interact 
 as a set through the agency of their immediate superview, so if several 
 buttons share it, they are assumed to be part of the same set.
 
 So you can embed the separate sets into container views or NSMatrix, and 
 they'll work as you want. You mention NOT putting them into a NSMatrix for 
 some reason - what reason? That's the usual way to set up radios, though it 
 comes with the added restriction that the buttons have to be laid out on a 
 regular grid. But embedding them in a custom view that draws nothing should 
 also work, and that has no such limitation.
 
 
 That would be great functionality that I have often desired but AFAICT that 
 is not the case--at least I am unable to replicate it. Or do you mean 
 multiple radio-type NSButtonCells in a single view? That would make sense but 
 only NSMatrix has that functionality built-in, AFAIK.

I think Graham is referring to this feature, added in 10.8:

 An NSButton configured as a radio button (with the -buttonType set to 
 NSRadioButton), will now operate in a radio button group for applications 
 linked on 10.8 and later. To have the button work in a radio group, use the 
 same -action for each NSButton instance, and have the same superview for each 
 button. When these conditions are met, checking one button (by changing the 
 -state to 1), will uncheck all other buttons (by setting their -state to 0).

https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/

Tom, are you sure that your two sets of radio buttons use different actions?

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Width defining NSLayoutConstraint zero

2014-04-10 Thread Kyle Sluder
On Apr 10, 2014, at 6:25 AM, Jonathan Mitchell li...@mugginsoft.com wrote:
 
 On some occasions I want my controls to collapse and set a width defining 
 constraint constant to zero.

In general, views should not be resized to zero width or height. A lot of times 
things will break internally (divide by zero errors or visual artifacts). This 
was even more likely in the days of springs and struts, when shrinking a view 
to zero width/height meant -resizeWithOldSuperviewSize: lost all the 
information necessary to apply springs and struts.

 
 Is the only workaround to wrap such controls in another view and collapse the 
 superview instead?

If you want to remove a view, you should really remove it from its superview. 
You could look into NSStackView, which will do this automatically if 
constraints cannot be satisfied.

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Width defining NSLayoutConstraint zero

2014-04-10 Thread Jonathan Mitchell

On 10 Apr 2014, at 17:09, Kyle Sluder k...@ksluder.com wrote:

 
 Is the only workaround to wrap such controls in another view and collapse 
 the superview instead?
 
 If you want to remove a view, you should really remove it from its superview. 
 You could look into NSStackView, which will do this automatically if 
 constraints cannot be satisfied.
 
The point is that I don’t want to remove the view (as that will remove its 
constraints) I just want to resize it and trigger the superview layout.
I have been using NSStackView extensively but it’s a bit of a heavy duty 
solution in this case as the subviews have to be added programatically at 
present until IB support catches up.

J


___

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

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

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

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

Re: Width defining NSLayoutConstraint zero

2014-04-10 Thread Jonathan Mitchell

On 10 Apr 2014, at 17:09, Kyle Sluder k...@ksluder.com wrote:

 On Apr 10, 2014, at 6:25 AM, Jonathan Mitchell li...@mugginsoft.com wrote:
 
 On some occasions I want my controls to collapse and set a width defining 
 constraint constant to zero.
 
 In general, views should not be resized to zero width or height. A lot of 
 times things will break internally (divide by zero errors or visual 
 artifacts). This was even more likely in the days of springs and struts, when 
 shrinking a view to zero width/height meant -resizeWithOldSuperviewSize: lost 
 all the information necessary to apply springs and struts.
Thinking about this point again and I don’t think it holds up.

Autolayout can easily drive a view to be of zero size.
A view that doesn’t contain sufficient internal constraints (or an intrinsic 
size) to define an unambiguous frame returns 0,0 for its -fittingSize. 
Indeed, when adding views to a NSStackView one of the most common issues is 
that the subview collapses to zero because its -fittingSize is returning 0,0.

J
___

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

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

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

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

Re: Width defining NSLayoutConstraint zero

2014-04-10 Thread Kyle Sluder
On Thu, Apr 10, 2014, at 11:37 AM, Jonathan Mitchell wrote:
 
 On 10 Apr 2014, at 17:09, Kyle Sluder k...@ksluder.com wrote:
 
  On Apr 10, 2014, at 6:25 AM, Jonathan Mitchell li...@mugginsoft.com wrote:
  
  On some occasions I want my controls to collapse and set a width defining 
  constraint constant to zero.
  
  In general, views should not be resized to zero width or height. A lot of 
  times things will break internally (divide by zero errors or visual 
  artifacts). This was even more likely in the days of springs and struts, 
  when shrinking a view to zero width/height meant 
  -resizeWithOldSuperviewSize: lost all the information necessary to apply 
  springs and struts.
 Thinking about this point again and I don’t think it holds up.
 
 Autolayout can easily drive a view to be of zero size.
 A view that doesn’t contain sufficient internal constraints (or an
 intrinsic size) to define an unambiguous frame returns 0,0 for its
 -fittingSize. 
 Indeed, when adding views to a NSStackView one of the most common issues
 is that the subview collapses to zero because its -fittingSize is
 returning 0,0.

It is true that auto layout does not prevent views from going to (0,0).

It is also true that many views—system-provided or otherwise—fail
spectacularly if resized to this size.

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Tom Doan
This is a Cocoa port of a Carbon app (and I also have Windows and 
GTK versions). My code assumes that I'm controlling the radio 
buttons, which has worked fine until now (apparently the 10.8 SDK). 
What I want is a radio style button which turns on when I want it on 
and turns off when I want it off and doesn't go off and manage itself 
along with the other buttons that the OS thinks (incorrectly in this 
case) are logically linked to it.

Tom Doan
Estima

  On Apr 10, 2014, at 6:57 AM, Keary Suska cocoa-...@esoteritech.com
  wrote:
  
  On Apr 9, 2014, at 5:30 PM, Graham Cox wrote:
  
  I'm not exactly certain of the mechanism, but I think radio buttons
  interact as a set through the agency of their immediate superview,
  so if several buttons share it, they are assumed to be part of the
  same set.
  
  So you can embed the separate sets into container views or
  NSMatrix, and they'll work as you want. You mention NOT putting
  them into a NSMatrix for some reason - what reason? That's the
  usual way to set up radios, though it comes with the added
  restriction that the buttons have to be laid out on a regular grid.
  But embedding them in a custom view that draws nothing should also
  work, and that has no such limitation.
  
  
  That would be great functionality that I have often desired but
  AFAICT that is not the case--at least I am unable to replicate it.
  Or do you mean multiple radio-type NSButtonCells in a single view?
  That would make sense but only NSMatrix has that functionality
  built-in, AFAIK.
 
 I think Graham is referring to this feature, added in 10.8:
 
  An NSButton configured as a radio button (with the -buttonType set
  to NSRadioButton), will now operate in a radio button group for
  applications linked on 10.8 and later. To have the button work in a
  radio group, use the same -action for each NSButton instance, and
  have the same superview for each button. When these conditions are
  met, checking one button (by changing the -state to 1), will uncheck
  all other buttons (by setting their -state to 0).
 
 https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit
 OlderNotes/
 
 Tom, are you sure that your two sets of radio buttons use different
 actions?
 
 --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:
 https://lists.apple.com/mailman/options/cocoa-dev/tomd%40estima.com
 
 This email sent to t...@estima.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Tom Doan
Thanks for the help. Embedding each subset inside a custom view 
did fix the problem. It would certainly have been nice to have the 
NSButton class reference say something about the change, since it 
should have been expected to break at least some existing 
software.

 This is a Cocoa port of a Carbon app (and I also have Windows and GTK
 versions). My code assumes that I'm controlling the radio buttons,
 which has worked fine until now (apparently the 10.8 SDK). What I want
 is a radio style button which turns on when I want it on and turns off
 when I want it off and doesn't go off and manage itself along with the
 other buttons that the OS thinks (incorrectly in this case) are
 logically linked to it.
 
 Tom Doan
 Estima
 
   On Apr 10, 2014, at 6:57 AM, Keary Suska
   cocoa-...@esoteritech.com wrote:
   
   On Apr 9, 2014, at 5:30 PM, Graham Cox wrote:
   
   I'm not exactly certain of the mechanism, but I think radio
   buttons interact as a set through the agency of their immediate
   superview, so if several buttons share it, they are assumed to be
   part of the same set.
   
   So you can embed the separate sets into container views or
   NSMatrix, and they'll work as you want. You mention NOT putting
   them into a NSMatrix for some reason - what reason? That's the
   usual way to set up radios, though it comes with the added
   restriction that the buttons have to be laid out on a regular
   grid. But embedding them in a custom view that draws nothing
   should also work, and that has no such limitation.
   
   
   That would be great functionality that I have often desired but
   AFAICT that is not the case--at least I am unable to replicate it.
   Or do you mean multiple radio-type NSButtonCells in a single view?
   That would make sense but only NSMatrix has that functionality
   built-in, AFAIK.
  
  I think Graham is referring to this feature, added in 10.8:
  
   An NSButton configured as a radio button (with the -buttonType set
   to NSRadioButton), will now operate in a radio button group for
   applications linked on 10.8 and later. To have the button work in
   a radio group, use the same -action for each NSButton instance,
   and have the same superview for each button. When these conditions
   are met, checking one button (by changing the -state to 1), will
   uncheck all other buttons (by setting their -state to 0).
  
  https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppK
  it OlderNotes/
  
  Tom, are you sure that your two sets of radio buttons use different
  actions?
  
  --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:
  https://lists.apple.com/mailman/options/cocoa-dev/tomd%40estima.com
  
  This email sent to t...@estima.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:
 https://lists.apple.com/mailman/options/cocoa-dev/tomd%40estima.com
 
 This email sent to t...@estima.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Colas B
Hi, 

thanks for your answers !
Your idea sounds good. What can I do if I want both shells invoked from 
programs and login shells to have the same initialization script? Shall I write 
a new script that runs first ~/.login and then myprogram ? Or is there a 
simplier way?

In my case, myprogram is pdflatex (with the -shell-escape option) and 
myauxprogram is gnuplot.

Colas
Le Jeudi 10 avril 2014 16h32, Jens Alfke j...@mooseyard.com a écrit :
 


On Apr 10, 2014, at 6:23 AM, Keary Suska cocoa-...@esoteritech.com wrote:

This is more likely a shell scripting issue, rather than am NSTask issue, 
unless sandboxing is somehow interfering, and you are obscuring the issue by 
not telling us at least how myprogram is locating myauxprogram. The most likely 
culprit is that the invocation of myauxprogram in myprogram is a relative path 
that relies on the PATH environment variable that is properly set by the shell, 
but you don't set in NSTask.


Agreed. A problem I’ve run into several times is that shells invoked from 
programs are not login shells, so they don’t run the same initialization 
scripts as the shell you use in a terminal. (For instance, a csh login shell 
runs ~/.login on startup as well as ~/.cshrc, but a non-login shell doesn’t. A 
similar thing happens with bash but I can never remember which scripts are 
involved.) If you customize your $PATH in the login-shell startup script, then 
a shellscript run outside a terminal window won’t have the same path.

—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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Bindings for dynamically populated menu

2014-04-10 Thread Jerry Krinock

On 2014 Apr 09, at 10:22, Sean McBride s...@rogue-research.com wrote:

 A menu's selection is always visible, and I've found bindings on popup menus 
 can be useful to deal with the selection.  If the object represented by the 
 popup's selection is deleted (by some other piece of UI) then the popup's 
 selection can be updated automagically with bindings.

You are correct, Sean.  I was just thinking of Main Menu menus, and had 
forgotten about menus under popup buttons.  I’ve used Cocoa Bindings not only 
on the Selected Whatever, but also Content and Content Values.

 But certainly the minute you want separators or other dynamic content, 
 binding become less useful.

Yes, the pain starts to rise.


___

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

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

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

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

Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Jens Alfke

On Apr 10, 2014, at 1:52 PM, Colas B colasj...@yahoo.fr wrote:

 Your idea sounds good. What can I do if I want both shells invoked from 
 programs and login shells to have the same initialization script?

I think it’s better to make sure your login-shell setup script (.bash_profile 
or .login) doesn’t have things in it that are needed for non-interactive 
shells. It should really only do stuff related to using a shell in a terminal, 
i.e. customizing the prompt or setting up ANSI colors or whatever. Stuff like 
setting up your $PATH belongs in the script that’s run by all shells (like 
.bashrc or .cshrc.)

—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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Keary Suska
On Apr 10, 2014, at 2:52 PM, Colas B wrote:

 Hi, 
 
 thanks for your answers !
 Your idea sounds good. What can I do if I want both shells invoked from 
 programs and login shells to have the same initialization script? Shall I 
 write a new script that runs first ~/.login and then myprogram ? Or is there 
 a simplier way?
 
 In my case, myprogram is pdflatex (with the -shell-escape option) and 
 myauxprogram is gnuplot.

The best approach may be a complicated affair. IMHO it is better to explicitly 
inject the environment that you want for the task, possibly with preference 
settings to specify non-standard paths and additional environment variables. 
The problem with setting a login-like environment is that you need to know what 
shell is being used. There may be a way to discover that, and then you could 
invoke myprogram via the shell. E.g.:
/path/to/bash -l -c myprogram arguments

Syntax will likely be similar for all shells, and many IIRC will accept -l or 
--login to designate a login shell.

Note that this approach comes with a number of security implications, and 
unix-ey folks like me would tell you to not do that and instead use the first 
approach I mention.

 Le Jeudi 10 avril 2014 16h32, Jens Alfke j...@mooseyard.com a écrit :
 
 On Apr 10, 2014, at 6:23 AM, Keary Suska cocoa-...@esoteritech.com wrote:
 
 This is more likely a shell scripting issue, rather than am NSTask issue, 
 unless sandboxing is somehow interfering, and you are obscuring the issue by 
 not telling us at least how myprogram is locating myauxprogram. The most 
 likely culprit is that the invocation of myauxprogram in myprogram is a 
 relative path that relies on the PATH environment variable that is properly 
 set by the shell, but you don't set in NSTask.
 
 
 Agreed. A problem I’ve run into several times is that shells invoked from 
 programs are not login shells, so they don’t run the same initialization 
 scripts as the shell you use in a terminal. (For instance, a csh login shell 
 runs ~/.login on startup as well as ~/.cshrc, but a non-login shell doesn’t. 
 A similar thing happens with bash but I can never remember which scripts are 
 involved.) If you customize your $PATH in the login-shell startup script, 
 then a shellscript run outside a terminal window won’t have the same path.

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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

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

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

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

NSBox line with autolayout

2014-04-10 Thread Julian
After converting my NIB to use autolayout, I'm not getting an NSBox to
redraw itself at the correct width.

I have a 'Horizontal Line' (NSBox). In the old model, the autoresizing mask
indicated flexible width. To replace it with constraints, I used: leading
space to superview = 0, top space to superview = 0, width = superview
width.

This unfortunately does not get the line to be redrawn to the appropriate
width. Other views with similar constraints are getting wider. ( I also
tried trailing space to superview = 0.)

Thanks,
Julian
___

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

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

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

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

Re : Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Colas B
I am not an unix-ey guy... br/br/I don't specify explicitly a bash when I 
run my program (with NSTask) : I just give the path to the program. If I 
discover the path to the shell being used, does it mean that what used to be 
the path of my  NSTask will become an argument?br/br/About path and 
environment variable, I don't specify anything special when I run my program 
from the terminal. br/br/Thanks for your help!a 
href=https://overview.mail.yahoo.com?.src=iOS;br/br/Envoyé depuis Yahoo 
Mail pour iPad/a
___

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

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

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

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

Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Jens Alfke

On Apr 10, 2014, at 2:34 PM, Colas B colasj...@yahoo.fr wrote:

 I don't specify explicitly a bash when I run my program (with NSTask) : I 
 just give the path to the program. 

It sounds like the program you’re telling NSTask to run is a shell-script. You 
can easily verify that by using the ‘file’ command (or just by opening the file 
in a text editor to see if it starts with “#!”) — for example,

$  file /usr/bin/imptrace
/usr/bin/imptrace: Bourne-Again shell script text executable

And it sounds like that script is invoking some other program without a 
hardcoded path, and the location of that program isn’t in the current search 
path ($PATH environment variable.)

—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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re : Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Colas B
No, it is Mach-O 64-bit executable
___

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

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

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

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

Suppress log: Cannot perform operation without a managed object context

2014-04-10 Thread Jerry Krinock
In Mac app, a Preferences window nib contains an object controller in Entity 
mode, which is bound to the managed object context of a Core Data document.  I 
realize this is kind of haywired, but please just accept that real life is 
sometimes a little messy.

In normal operation, a document is always open.  But if a document cannot be 
opened, and if user opens Preferences during the dialog warning of this 
failure, of course, that binding fails.  The controls which are bound to the 
unavailable managed object context via the object controller are disabled; 
other controls work OK.  That’s good.  The only problem is that the message and 
stack trace from an exception (see below) are logged.

Can anyone think of a way to prevent the logging of this?  The stack trace 
appears to be all Apple non-public API, and this little issue is not worth a 
hack.  I don’t want to disable opening of the Preferences window until a 
document is available, because that would be illogical and overkill, and the 
user may want to peek at prefs for some reason.

Thanks

Jerry Krinock

2014-04-10 14:44:09.937 Testy[4544:303] Cannot perform operation without a 
managed object context
2014-04-10 14:44:09.945 Testy[4544:303] (
0   CoreFoundation0x7fff91cfa25c __exceptionPreprocess + 172
1   libobjc.A.dylib   0x7fff8b33ae75 objc_exception_throw + 43
2   CoreFoundation0x7fff91cfa10c +[NSException raise:format:] + 204
3   AppKit0x7fff8cabf703 -[_NSManagedProxy 
_managedObjectContext] + 66
4   AppKit0x7fff8cabf67c -[_NSManagedProxy 
_persistentStoreCoordinator] + 22
5   AppKit0x7fff8cabf5f9 -[_NSManagedProxy _entity] + 46
6   AppKit0x7fff8cabf515 -[_NSManagedProxy 
fetchRequestWithSortDescriptors:limit:] + 95
7   AppKit0x7fff8cd0f8fb 
-[NSObjectController(NSManagedController) 
_executeFetch:didCommitSuccessfully:actionSender:] + 73
8   AppKit0x7fff8ceea846 _NSSendCommitEditingSelector + 267
9   AppKit0x7fff8cb93f78 -[NSController 
_controllerEditor:didCommit:contextInfo:] + 182
10  CoreFoundation0x7fff91be5a5c __invoking___ + 140
11  CoreFoundation0x7fff91be58c4 -[NSInvocation invoke] + 308
12  CoreFoundation0x7fff91c88516 -[NSInvocation invokeWithTarget:] + 54
13  Foundation0x7fff8dd6dcb7 __NSFireDelayedPerform + 333
14  CoreFoundation0x7fff91c61494 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
15  CoreFoundation0x7fff91c60fcf __CFRunLoopDoTimer + 1151
16  CoreFoundation0x7fff91cd25aa __CFRunLoopDoTimers + 298
17  CoreFoundation0x7fff91c1c755 __CFRunLoopRun + 1525
18  CoreFoundation0x7fff91c1bf25 CFRunLoopRunSpecific + 309
19  HIToolbox 0x7fff89443a0d RunCurrentEventLoopInMode + 226
20  HIToolbox 0x7fff894437b7 ReceiveNextEventCommon + 479
21  HIToolbox 0x7fff894435bc 
_BlockUntilNextEventMatchingListInModeWithFilter + 65
22  AppKit0x7fff8c75226e _DPSNextEvent + 1434
23  AppKit0x7fff8c7518bb -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
24  AppKit0x7fff8c7459bc -[NSApplication run] + 553
25  AppKit0x7fff8c7307a3 NSApplicationMain + 940
26  Testy 0x000127bf main + 367
27  Testy 0x00011b34 start + 52
28  ???   0x0003 0x0 + 3
)


___

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

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

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

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

Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Scott Ribe
On Apr 10, 2014, at 4:09 PM, Colas B colasj...@yahoo.fr wrote:

 No, it is Mach-O 64-bit executable

Then there is no shell run when you execute it via NSTask.

Really, the correct answer is that pdflatex should not depend on a relative or 
hard-coded path for gnuplot. (It's fine of course to use such as a default, but 
there should be a way to specify it.) Are you sure there is not a command line 
option to pdflatex to tell it where to find gnuplot?


-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





___

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

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

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

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

iOS: Cannot connect to iTunes Store

2014-04-10 Thread Steve Christensen
I’ve been testing IAP in the sandbox store on a development iPod and just 
started getting this error in -paymentQueue:updatedTransactions: with 
(transaction.transactionState == SKPaymentTransactionStateFailed):

Error Domain=SKErrorDomain Code=0 Cannot connect to iTunes Store 
UserInfo=0x1aa5e060 {NSLocalizedDescription=Cannot connect to iTunes Store}

Note that this had been working just fine until a couple of days ago. The only 
change that I can think of is that I did an upgrade from 7.0.6 to 7.1, but I 
don’t remember if it was before or after the last time I tried this and it 
worked.

In doing some reading, one poster pointed out that one of the reasons for this 
could be that I messed up the test user account so I signed out of the old test 
user in the Settings app, created a new test user in iTunes Connect, then went 
through another purchase cycle. It asked me to log in (which I did with the new 
user) and then presented the purchase confirmation alert with the product name 
and price, and [Environment:Sandbox]. I tapped on the Buy button and then got 
the error above.

Does anyone have an idea of what else I should be checking?

Thanks.
___

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

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

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

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

Re: NSTask: program launching another program, potential problem with path: how to do?

2014-04-10 Thread Keary Suska
On Apr 10, 2014, at 3:34 PM, Colas B wrote:

 I am not an unix-ey guy... 
 
 I don't specify explicitly a bash when I run my program (with NSTask) : I 
 just give the path to the program. If I discover the path to the shell being 
 used, does it mean that what used to be the path of my  NSTask will become an 
 argument?

Yes--launchPath is set to the shell, and the rest become arguments.

 About path and environment variable, I don't specify anything special when I 
 run my program from the terminal. 

Well, most shell configurations will come with a reasonably sensible 
environment, but I believe you get next to nothing when running an application. 
At a terminal prompt execute the printenv command to see the current 
environment. You could set the PATH variable on the task (using 
-setEnvironment:) and see if that works. If so, realize that this approach may 
be fragile in environments that you don't control (i.e. end-users). There also 
may be other variables needed...

 Envoyé depuis Yahoo Mail pour iPad
 
 From: Keary Suska cocoa-...@esoteritech.com; 
 To: Colas B colasj...@yahoo.fr; 
 Cc: Cocoa-Dev (Apple) cocoa-dev@lists.apple.com; 
 Subject: Re: NSTask: program launching another program, potential problem 
 with path: how to do? 
 Sent: Thu, Apr 10, 2014 9:21:04 PM 
 
 On Apr 10, 2014, at 2:52 PM, Colas B wrote:
 
  Hi, 
  
  thanks for your answers !
  Your idea sounds good. What can I do if I want both shells invoked from 
  programs and login shells to have the same initialization script? Shall I 
  write a new script that runs first ~/.login and then myprogram ? Or is 
  there a simplier way?
  
  In my case, myprogram is pdflatex (with the -shell-escape option) and 
  myauxprogram is gnuplot.
 
 The best approach may be a complicated affair. IMHO it is better to 
 explicitly inject the environment that you want for the task, possibly with 
 preference settings to specify non-standard paths and additional environment 
 variables. The problem with setting a login-like environment is that you need 
 to know what shell is being used. There may be a way to discover that, and 
 then you could invoke myprogram via the shell. E.g.:
 /path/to/bash -l -c myprogram arguments
 
 Syntax will likely be similar for all shells, and many IIRC will accept -l or 
 --login to designate a login shell.
 
 Note that this approach comes with a number of security implications, and 
 unix-ey folks like me would tell you to not do that and instead use the first 
 approach I mention.
 
  Le Jeudi 10 avril 2014 16h32, Jens Alfke j...@mooseyard.com a écrit :
  
  On Apr 10, 2014, at 6:23 AM, Keary Suska cocoa-...@esoteritech.com wrote:
  
  This is more likely a shell scripting issue, rather than am NSTask issue, 
  unless sandboxing is somehow interfering, and you are obscuring the issue 
  by not telling us at least how myprogram is locating myauxprogram. The 
  most likely culprit is that the invocation of myauxprogram in myprogram is 
  a relative path that relies on the PATH environment variable that is 
  properly set by the shell, but you don't set in NSTask.
  
  
  Agreed. A problem I’ve run into several times is that shells invoked from 
  programs are not login shells, so they don’t run the same initialization 
  scripts as the shell you use in a terminal. (For instance, a csh login 
  shell runs ~/.login on startup as well as ~/.cshrc, but a non-login shell 
  doesn’t. A similar thing happens with bash but I can never remember which 
  scripts are involved.) If you customize your $PATH in the login-shell 
  startup script, then a shellscript run outside a terminal window won’t have 
  the same path.
 
 
 Keary Suska
 
 Esoteritech, Inc.
 Demystifying technology for your home or business
 


Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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

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

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

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