-[UITextField selectAll:] causes cut/copy/paste controls to appear

2013-11-12 Thread Rick Mann
In my table view, when the user taps “+”, we create a new entry, then 
automatically push that one.

Then I try to select the contents of a UITextField so the user can quickly edit 
it.

In so doing, the field also pops up the cut/copy/paste control.

There are some Stack Overflow answers to this, but none worked for me.

I haven’t tried subclassing UITextField.

This behavior seems asinine. Any way around it?

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

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

Problems with reachability observer in Mavericks / Xcode 5

2013-11-12 Thread Pax
Here's an odd one.  It works before Mavericks (Xcode 5) - and doesn't work now. 

I've been playing with Reachability 
(https://developer.apple.com/Library/ios/samplecode/Reachability/Introduction/Intro.html).
  Apple's example is for iOS, but with a few small mods it worked fine on Mac 
OS X.  I want to detect when the network connection changes, and I've set it up 
like so:

- (void) reachabilityChanged: (NSNotification* )note
{
NSLog (@ Reachability changed);

Reachability* curReach = [note object];
NSParameterAssert([curReach isKindOfClass: [Reachability class]]);
[self updateInterfaceWithReachability: curReach];
}

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

[[NSNotificationCenter defaultCenter] addObserver: self selector: 
@selector(reachabilityChanged:) name: kReachabilityChangedNotification object: 
nil];

hostReach = [Reachability reachabilityWithHostName: @www.apple.com];
[hostReach startNotifier];
[self updateInterfaceWithReachability: hostReach];

internetReach = [Reachability reachabilityForInternetConnection];
[internetReach startNotifier];
[self updateInterfaceWithReachability: internetReach];

wifiReach = [Reachability reachabilityForLocalWiFi];
[wifiReach startNotifier];
[self updateInterfaceWithReachability: wifiReach];

}

Where kReachabilityChangedNotification is defined as #define 
kReachabilityChangedNotification @kNetworkReachabilityChangedNotification

The reachability code is as per Apple's example.  Previously, the code would 
execute on start (' Reachability changed' output to the log), and 
subsequently every time the WiFi or cabled connection changed.  Now, on 
Mavericks / Xcode 5, it executes once on start (so it knows that the current 
state is) and never changes again - no matter how long I wait.

Since it's not getting to reachabilityChanged, I'm guessing that the name 
(kReachabilityChangedNotification) has changed in Mavericks.  Is anyone aware 
of any changes that have been made in this area?  Google has rather turned up a 
blank in my investigations.

Thanks in advance for any help that you can offer with this problem.
___

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

waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Graham Cox
I’m just thinking about the use of 
-performSelectorOnMainThread:withObject:waitUntilDone:, and what is the best 
way to think about the waitUntilDone parameter. The situation is updating a UI 
from another thread, using this to punt the update to the main thread (in fact 
the progress bar situation discussed earlier this week).

I assume if I pass NO, the request is queued and processed once per event loop. 
If I pass YES, there is some sort of lock which sleeps my thread until the main 
thread completes the task.

So passing NO, my worker thread can proceed as fast as it can, but the main 
thread could back up and end up lagging (and also queuing a lot of redundant 
updates, like a progress value where really only the latest matters). If I pass 
YES, my worker thread is going to get throttled by the main thread.

Is this just one of those cases where you have to judge the best approach, or 
is there a better way to determine when to pass YES or NO?

Currently, I generally pass NO, and my worker threads are not updating the 
progress too often anyway - I mod the count so that it only updates every 50 or 
100 iterations. The UI seems to keep up fine. What do others do?

—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: Problems with reachability observer in Mavericks / Xcode 5

2013-11-12 Thread Jens Alfke

On Nov 12, 2013, at 5:50 AM, Pax 45rpmli...@googlemail.com wrote:

 Since it's not getting to reachabilityChanged, I'm guessing that the name 
 (kReachabilityChangedNotification) has changed in Mavericks.  Is anyone aware 
 of any changes that have been made in this area?  Google has rather turned up 
 a blank in my investigations.

No, that notification name is part of the sample code, not any system 
framework; it’s defined in Reachability.m and posted by the 
ReachabilityCallback function.

Have you set a breakpoint in ReachabilityCallback to see if it’s getting called?

—Jens

PS: Also, are you sure you turned off all your network interfaces? Reachability 
of a server won’t change as long as there’s one network interface up; you have 
to disable all of them.
___

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: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Jean-Daniel Dupas

Le 12 nov. 2013 à 15:26, Graham Cox graham@bigpond.com a écrit :

 I’m just thinking about the use of 
 -performSelectorOnMainThread:withObject:waitUntilDone:, and what is the best 
 way to think about the waitUntilDone parameter. The situation is updating a 
 UI from another thread, using this to punt the update to the main thread (in 
 fact the progress bar situation discussed earlier this week).
 
 I assume if I pass NO, the request is queued and processed once per event 
 loop. If I pass YES, there is some sort of lock which sleeps my thread until 
 the main thread completes the task.
 
 So passing NO, my worker thread can proceed as fast as it can, but the main 
 thread could back up and end up lagging (and also queuing a lot of redundant 
 updates, like a progress value where really only the latest matters). If I 
 pass YES, my worker thread is going to get throttled by the main thread.
 
 Is this just one of those cases where you have to judge the best approach, or 
 is there a better way to determine when to pass YES or NO?
 
 Currently, I generally pass NO, and my worker threads are not updating the 
 progress too often anyway - I mod the count so that it only updates every 50 
 or 100 iterations. The UI seems to keep up fine. What do others do?
 

My rule is simply to never pass NO. In a world where async is the new standard, 
waiting for a thread to complete should really never be used. 

Updating your UI more than 60 times per seconds is useless as the update will 
never be pushed to the screen, and the UI thread should be able to deal with 60 
messages per seconds smoothly, so don't bother with premature optimisation, and 
keep it simple.
And even 60 times per seconds is probably too much anyway. Just make sure your 
worker thread does not push too much updates.

-- Jean-Daniel





___

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

NSTextView - stopping conversion of quotation marks

2013-11-12 Thread 2551
I’m confused. If you select a NSTextView item in IB, then examine the 
Attributes Inspector, you’re presented with various options for setting text 
attributes, such as the font, size and color. In my clumsy hands, none of these 
work. The text entry always defaults to Helvetica 12.0 in standard black. 
Specifically for what I’m trying to accomplish, the text view always convert 
the quotation charactersto “ ” when the user types in the text view, 
which totally messes up the functionality of my app. Turning on the Field 
Editor does stop the conversion, but then restricts me to a single cell/line. 
How do I stop this automatic re-formatting but retain the ability to enter line 
breaks? 

I’d have thought that setting the default options for a text view was a fairly 
common need, yet searches have only pointed me to one or two posts that discuss 
this problem, the most useful (but still not detailed enough for my current 
understanding) goes back to 2006 here:

http://www.cocoabuilder.com/archive/cocoa/160492-setting-the-default-font-of-an-nstextview.html

So I’m now deep (have been for most of the day) into numerous Apple 
documentation items (always a frustrating experience, since they are inevitably 
heavy on describing the wonderous possibilities of Cocoa and referencing a 
thousand other “Don’t miss...” documents while depressingly light on 
demonstrative details. Still, I digress…). Undoubtedly both a rite of passage 
and a useful extension to my learning, but it seems bizarre to me that 
something as basic as setting the default font attributes in a text view and 
avoiding automatic conversions should require heavy coding. I could do this in 
C with a blindfold on, but in Cocoa, I feel like I’m in a galaxy-wide void with 
only half a candle to light my way. 

Any enlightenment hugely appreciated.


Best

Phil


___

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: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Roland King

On 12 Nov, 2013, at 10:26 pm, Graham Cox graham@bigpond.com wrote:

 Is this just one of those cases where you have to judge the best approach, or 
 is there a better way to determine when to pass YES or NO?
 
 Currently, I generally pass NO, and my worker threads are not updating the 
 progress too often anyway - I mod the count so that it only updates every 50 
 or 100 iterations. The UI seems to keep up fine. What do others do?

The only case I regularly block and wait for a thread is with CoreData where I 
very often use performBlockAndWait: because I've had some issues threading 
CoreData and this does give a bit more defined operation. I don't do it from 
the main thread. Core data I find particularly tricky especially when I have 
notifications of saves getting tossed around to other queues, so I try to 
synchronize it more than other subsystems. 

For everything else I pass no or use dispatch_async() and attempt to code one 
subsystem per thread/dispatch_queue/operation queue. If you separate them like 
that, they tend not to fall over each other and just process as fast as they 
feel like going. If they do fall over each other, your subsystem was often not 
as sub- as you thought it was. 
___

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: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Jens Alfke

On Nov 12, 2013, at 6:26 AM, Graham Cox graham@bigpond.com wrote:

 I assume if I pass NO, the request is queued and processed once per event 
 loop. If I pass YES, there is some sort of lock which sleeps my thread until 
 the main thread completes the task.

Right.

 So passing NO, my worker thread can proceed as fast as it can, but the main 
 thread could back up and end up lagging (and also queuing a lot of redundant 
 updates, like a progress value where really only the latest matters). If I 
 pass YES, my worker thread is going to get throttled by the main thread.

In my experience you almost never want to use YES. The only reason would be if 
your background thread needs to get some kind of response from the main thread 
(like it’s asking it for a data value and can’t proceed until it gets it.) 
Otherwise you’re just needlessly slowing down the background thread, and in the 
worst case inviting deadlocks.

If you just perform a really lightweight update from the background thread 
(e.g. just calling -setNeedsDisplay on some progress-indicator view) you 
shouldn’t have trouble with the main thread falling behind.

Another option is to have the main thread poll the progress of the operation 
instead of being notified. That way you can decide explicitly how often you 
want to update the progress indicator.

—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

MP4 video playback on Mavericks - Where's a good place to start?

2013-11-12 Thread Bryan Vines
Good morning all,

I'm toying with a project to play short video, stored in my app's bundle. I had 
thought to use QTKit and a QTMovieView, but I can't locate the QTMovieView in 
Interface Builder.

Apple has a QTKit tutorial, Creating a Simple QTKit Media Player Application, 
but this is built around Xcode 3.2 and makes use of QTMovieView, which again 
I'm not seeing. Is AVKit and the AVPlayerView the way to do this in Mavericks?

Unfortunately I've only had one cup of coffee today and as a result my 
Google-fu is weak. I appreciate any guidance as to which way I should go, and 
where to start looking.

Thanks!
--
Bryan Vines
___

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: NSTextView - stopping conversion of quotation marks

2013-11-12 Thread Mark Munz
Use [myTextView setAutomaticQuoteSubstitutionEnabled:NO]; to disable to
automatic conversion of plain quotes to smart quotes.



On Tue, Nov 12, 2013 at 7:19 AM, 2551 2551p...@gmail.com wrote:

 I’m confused. If you select a NSTextView item in IB, then examine the
 Attributes Inspector, you’re presented with various options for setting
 text attributes, such as the font, size and color. In my clumsy hands, none
 of these work. The text entry always defaults to Helvetica 12.0 in standard
 black.
 Specifically for what I’m trying to accomplish, the text view always
 convert the quotation charactersto “ ” when the user types in the
 text view, which totally messes up the functionality of my app. Turning on
 the Field Editor does stop the conversion, but then restricts me to a
 single cell/line. How do I stop this automatic re-formatting but retain the
 ability to enter line breaks?

 I’d have thought that setting the default options for a text view was a
 fairly common need, yet searches have only pointed me to one or two posts
 that discuss this problem, the most useful (but still not detailed enough
 for my current understanding) goes back to 2006 here:


 http://www.cocoabuilder.com/archive/cocoa/160492-setting-the-default-font-of-an-nstextview.html

 So I’m now deep (have been for most of the day) into numerous Apple
 documentation items (always a frustrating experience, since they are
 inevitably heavy on describing the wonderous possibilities of Cocoa and
 referencing a thousand other “Don’t miss...” documents while depressingly
 light on demonstrative details. Still, I digress…). Undoubtedly both a rite
 of passage and a useful extension to my learning, but it seems bizarre to
 me that something as basic as setting the default font attributes in a text
 view and avoiding automatic conversions should require heavy coding. I
 could do this in C with a blindfold on, but in Cocoa, I feel like I’m in a
 galaxy-wide void with only half a candle to light my way.

 Any enlightenment hugely appreciated.


 Best

 Phil


 ___

 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/unmarked%40gmail.com

 This email sent to unmar...@gmail.com




-- 
Mark Munz
unmarked software
http://www.unmarked.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: Cocoa-dev Digest, Vol 10, Issue 735

2013-11-12 Thread Karl Moskowski

On Nov 12, 2013, at 11:01 AM, Bryan Vines bkvi...@me.com wrote:

 I'm toying with a project to play short video, stored in my app's bundle. I 
 had thought to use QTKit and a QTMovieView, but I can't locate the 
 QTMovieView in Interface Builder.
 
 Apple has a QTKit tutorial, Creating a Simple QTKit Media Player 
 Application, but this is built around Xcode 3.2 and makes use of 
 QTMovieView, which again I'm not seeing. Is AVKit and the AVPlayerView the 
 way to do this in Mavericks?

AVFoundation  AVKit are the modern approach (IIRC, QTKit and older QT APIs are 
deprecated). Here’s Apple’s sample player project:
https://developer.apple.com/library/mac/samplecode/AVKitPlayerOSX/Introduction/Intro.html


Karl Moskowski kmoskow...@me.com
http://about.me/kolpanic


___

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: MP4 video playback on Mavericks - Where's a good place to start?

2013-11-12 Thread Jean-Daniel Dupas

Le 12 nov. 2013 à 17:01, Bryan Vines bkvi...@me.com a écrit :

 Good morning all,
 
 I'm toying with a project to play short video, stored in my app's bundle. I 
 had thought to use QTKit and a QTMovieView, but I can't locate the 
 QTMovieView in Interface Builder.
 
 Apple has a QTKit tutorial, Creating a Simple QTKit Media Player 
 Application, but this is built around Xcode 3.2 and makes use of 
 QTMovieView, which again I'm not seeing. Is AVKit and the AVPlayerView the 
 way to do this in Mavericks?
 

Yes, AVKit is a new framework introduced in Maverick for movie playback.

 Unfortunately I've only had one cup of coffee today and as a result my 
 Google-fu is weak. I appreciate any guidance as to which way I should go, and 
 where to start looking.
 
 Thanks!
 --
 Bryan Vines

-- Jean-Daniel





___

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: Cocoa-dev Digest, Vol 10, Issue 735

2013-11-12 Thread Karl Moskowski

On Nov 12, 2013, at 11:01 AM, cocoa-dev-requ...@lists.apple.com wrote:

 Message: 11
 Date: Tue, 12 Nov 2013 10:01:16 -0600
 From: Bryan Vines bkvi...@me.com
 To: cocoa-dev@lists.apple.com Developers cocoa-dev@lists.apple.com
 Subject: MP4 video playback on Mavericks - Where's a good place to
   start?
 Message-ID: bd18a721-c62f-4211-bc98-2749fd1f8...@me.com
 Content-Type: text/plain; charset=us-ascii
 
 Good morning all,
 
 I'm toying with a project to play short video, stored in my app's bundle. I 
 had thought to use QTKit and a QTMovieView, but I can't locate the 
 QTMovieView in Interface Builder.
 
 Apple has a QTKit tutorial, Creating a Simple QTKit Media Player 
 Application, but this is built around Xcode 3.2 and makes use of 
 QTMovieView, which again I'm not seeing. Is AVKit and the AVPlayerView the 
 way to do this in Mavericks?
 
 Unfortunately I've only had one cup of coffee today and as a result my 
 Google-fu is weak. I appreciate any guidance as to which way I should go, and 
 where to start looking.
 
 Thanks!
 --
 Bryan Vines

AVFoundation  AVKit is the modern way to do this. Here’s Apple’s sample player 
project:
https://developer.apple.com/library/mac/samplecode/AVKitPlayerOSX/Introduction/Intro.html


Karl Moskowski kmoskow...@me.com
http://about.me/kolpanic


___

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: NSTextView - stopping conversion of quotation marks

2013-11-12 Thread Graham Cox

On 12 Nov 2013, at 4:19 pm, 2551 2551p...@gmail.com wrote:

 I’m confused. If you select a NSTextView item in IB, then examine the 
 Attributes Inspector, you’re presented with various options for setting text 
 attributes, such as the font, size and color. In my clumsy hands, none of 
 these work. The text entry always defaults to Helvetica 12.0 in standard 
 black. 

 Specifically for what I’m trying to accomplish, the text view always convert 
 the quotation charactersto “ ” when the user types in the text view, 
 which totally messes up the functionality of my app.

This sounds like the smart quote substitution feature, which has nothing to do 
with the font or other text attributes. Have a look at [NSTextView 
setAutomaticQuoteSubstitutionEnabled:].

Depending on how you are loading text into the text view, text attributes set 
in IB might be overridden. If you are starting with an empty text view that you 
type into, you will probably want to use -setTypingAttributes: to set the 
initial font, etc used when typing. However, that setting is pretty fragile, 
and will need to be performed when the selection changes. I think the 
cocoabuilder reference you linked discusses this.

 Turning on the Field Editor does stop the conversion, but then restricts me 
 to a single cell/line. How do I stop this automatic re-formatting but retain 
 the ability to enter line breaks? 

I really don’t think the Field Editor should come into this - that’s used for 
entering text into small fields, not when using a complete NSTextView. Forget 
about that.

—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: NSTextView - stopping conversion of quotation marks

2013-11-12 Thread 2551
Thanks Graham and Mark.


Candle out, torch on (with fresh batteries).  :)


P



On 12 Nov 2013, at 23:25, Graham Cox graham@bigpond.com wrote:

 
 On 12 Nov 2013, at 4:19 pm, 2551 2551p...@gmail.com wrote:
 
 I’m confused. If you select a NSTextView item in IB, then examine the 
 Attributes Inspector, you’re presented with various options for setting text 
 attributes, such as the font, size and color. In my clumsy hands, none of 
 these work. The text entry always defaults to Helvetica 12.0 in standard 
 black. 
 
 Specifically for what I’m trying to accomplish, the text view always convert 
 the quotation charactersto “ ” when the user types in the text view, 
 which totally messes up the functionality of my app.
 
 This sounds like the smart quote substitution feature, which has nothing to 
 do with the font or other text attributes. Have a look at [NSTextView 
 setAutomaticQuoteSubstitutionEnabled:].
 
 Depending on how you are loading text into the text view, text attributes set 
 in IB might be overridden. If you are starting with an empty text view that 
 you type into, you will probably want to use -setTypingAttributes: to set the 
 initial font, etc used when typing. However, that setting is pretty fragile, 
 and will need to be performed when the selection changes. I think the 
 cocoabuilder reference you linked discusses this.
 
 Turning on the Field Editor does stop the conversion, but then restricts me 
 to a single cell/line. How do I stop this automatic re-formatting but retain 
 the ability to enter line breaks? 
 
 I really don’t think the Field Editor should come into this - that’s used for 
 entering text into small fields, not when using a complete NSTextView. Forget 
 about that.
 
 —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/sqwarqdev%40icloud.com
 
 This email sent to sqwarq...@icloud.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: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Graham Cox

On 12 Nov 2013, at 4:12 pm, Jean-Daniel Dupas devli...@shadowlab.org wrote:

 My rule is simply to never pass NO


Did you mean YES? (i.e. always pass NO). Others seem to be saying the opposite.

—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: NSTextView - stopping conversion of quotation marks

2013-11-12 Thread 2551

On 12 Nov 2013, at 23:25, Graham Cox graham@bigpond.com wrote:

 
 This sounds like the smart quote substitution feature, which has nothing to 
 do with the font or other text attributes. 


Thanks, understood. However, I probably didn’t make it clear that I actually 
need to do both. i.e., remove the quote formatting AND set a particular default 
font and color. Still not sure how to go about doing the latter or why the 
Attributes panel settings are apparently a waste of space. 

Anyway, many thanks for the tips so far! 


Best

P
___

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

Mea culpa

2013-11-12 Thread Karl Moskowski
Sorry for the repeated replies, all. Mail.app and/or iCloud was misbehaving.


Karl Moskowski kmoskow...@me.com
http://about.me/kolpanic

___

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: NSTextView - stopping conversion of quotation marks

2013-11-12 Thread 2551
On 12 Nov 2013, at 23:51, 2551 2551p...@gmail.com wrote:
 Still not sure how to go about doing the latter 
 

Scratch that. Light bulb went on. Got it! 

Thanks muchly. I’ve put this one to bed and can now move on to the next 
probl…ahem…*stage* of development. :p





___

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: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Jean-Daniel Dupas

Le 12 nov. 2013 à 17:45, Graham Cox graham@bigpond.com a écrit :

 
 On 12 Nov 2013, at 4:12 pm, Jean-Daniel Dupas devli...@shadowlab.org wrote:
 
 My rule is simply to never pass NO
 
 
 Did you mean YES? (i.e. always pass NO). Others seem to be saying the 
 opposite.
 

My bad, Of course, always pass NO and never wait.

 —Graham

-- Jean-Daniel




___

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: NSTextView - stopping conversion of quotation marks

2013-11-12 Thread Graham Cox

On 12 Nov 2013, at 5:51 pm, 2551 2551p...@gmail.com wrote:

 Thanks, understood. However, I probably didn’t make it clear that I actually 
 need to do both. i.e., remove the quote formatting AND set a particular 
 default font and color.

Yep, I got that.


 Still not sure how to go about doing the latter or why the Attributes panel 
 settings are apparently a waste of space. 


They’re not a waste of space, but it depends what you’re trying to do. If you 
have some text already set in the view (in IB), you can style it using the 
attributes settings. But if the view is initially
empty, you have to set the typing attributes and bear in mind that this setting 
is fragile. The cocoabuilder article appears to cover it pretty well.

—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: NSStackView basics

2013-11-12 Thread Tom Harrington
Thanks Ken. I suspected it was something like that but didn't know what to
do about it. It also hadn't occurred to me that making the text field
centered didn't necessarily imply anything about the size of the containing
view. With no constraints on the sizes of contained view, it seems that
NSStackView scaled one view down to zero size while scaling the other one
up to fill the itself. Neither choice violates any constraints, though it
wasn't what I expected.

Adding a fixed height constraint to the subviews makes both visible.
Likewise, adding other height constraints like setting the equivalent of
@V:|-[subview2]- makes both visible (with different sizes). Looking at
the demo project, I see now that there are constraints with similar effect,
which is why it works.



On Mon, Nov 11, 2013 at 6:29 PM, Ken Ferry kenfe...@gmail.com wrote:


 Hi Tom,

 I think the problem here is that if you have view A containing textField,
 and textField is centered in A, there's no constraint expressing anything
 about A's height. A can go to zero height and still have the textField
 centered within it.

 If you added something giving a height (or fastened the edges of A to the
 textField), that'd probably do it.

 -ken

 On Fri, Nov 8, 2013 at 5:02 PM, Tom Harrington atomicb...@gmail.comwrote:

 I'm trying to use NSStackView in what should be the most basic way
 possible. I create the stack view and add two subviews. But only one of
 them is ever visible.

 I'm creating the stack view in code (in my app delegate, for purposes of a
 test project):

 NSStackView *stackView = [NSStackView stackViewWithViews:@
 [self.subview1,
 self.subview2]];

 stackView.orientation = NSUserInterfaceLayoutOrientationVertical;

 stackView.alignment = NSLayoutAttributeCenterX;

 stackView.spacing = 0;

 [self.window.contentView addSubview:stackView];

 [self.window.contentView addConstraints:[NSLayoutConstraint
 constraintsWithVisualFormat:@H:|-(50)-[stackView]-(50)-|


 options:0


 metrics:nil


   views:NSDictionaryOfVariableBindings(stackView)]];

 [self.window.contentView addConstraints:[NSLayoutConstraint
 constraintsWithVisualFormat:@V:|-(50)-[stackView]-(50)-|


 options:0


 metrics:nil


   views:NSDictionaryOfVariableBindings(stackView)]];

 The two subviews subview1 and subview2 are just plain NSViews, each with
 an
 NSTextField label subview constrained to be in the center.

 At run time, only one subview is visible-- the last one in the array. It's
 resized to fill the entire stack view. If I resize the window, the stack
 view and the one visible subview also resize, but no window size ever gets
 both subviews showing.

 Obviously I'm missing something basic about stack views, but I don't know
 what. I've been looking at Apple's InfoBarStackView demo app but haven't
 worked out which detail it has that I don't (Apple's demo:

 https://developer.apple.com/library/mac/samplecode/InfoBarStackView/Introduction/Intro.html
 )

 --
 Tom Harrington
 atomicb...@gmail.com
 AIM: atomicbird1
 ___

 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/kenferry%40gmail.com

 This email sent to kenfe...@gmail.com





-- 
Tom Harrington
atomicb...@gmail.com
AIM: atomicbird1
___

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

NSUserNotification + Custom Icon?

2013-11-12 Thread Jeremy Matthews
In 10.9, NSUserNotification supports a new property contentImage, which 
allows the use of a graphic within the notification itself. It's nice, but not 
exactly what I was wishing for (puts it on the right side of the notification 
window).  I was hoping that there might be a way to usurp the notification 
screen ala iTunes' notifications, so it would appear as if the sender/bundle 
app icon is customized, without the need to change the icon of the app 
programmatically, and restart NotificationCenter itself (which seems to only 
work half the time in my tests).

An example from iTunes:

http://s21.postimg.org/5u7qluglj/Screen_Shot_2013_11_05_at_1_54_16_PM.png

But it appears that the property only allows for a subset of what I'm looking 
for, and the contentImage property only hanldes images thusly (using the 
contentImage property):

http://s21.postimg.org/voqq33vd3/Screen_Shot_2013_10_30_at_2_09_03_PM.png

Any ideas on a workaround?



Thanks,

jeremy
___

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

Cocoaheads 92630 tomorrow, Wed. Nov 12 at 7pm

2013-11-12 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday of the
month.  We will be meeting at the Orange County Public Library (El Toro)
community room, 24672 Raymond Way, Lake Forest, CA 92630.

Stuart Cracraft will be discussing Amazon Web Services!

We will have an easy-going discussion on advantages, disadvantages, and the
ongoing futureof datacenter in a box as clouds evolve both for the
private and the public sector.

He suggests viewing http://www.youtube.com/watch?v=-xVyuLJZFYc to prepare.

We are broadening our discussions somewhat beyond Cocoa/AppKit, so please
bring topic suggestions for the next year.

Please join us from 7pm to 9pm on Wednesday Bring laptops, code, discussion
topics, etc. As always, details can be found on the cocoaheads web site at
www.cocoaheads.org

(note: cross-post cleared with moderators previously.)
___

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: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Quincey Morris
On Nov 12, 2013, at 06:26 , Graham Cox graham@bigpond.com wrote:

 I’m just thinking about the use of 
 -performSelectorOnMainThread:withObject:waitUntilDone:, and what is the best 
 way to think about the waitUntilDone parameter.

Perhaps the question is why you’re using ‘performSelector’ for this at all, 
other than historical inertia. In the past, the best solution would probably 
have been to specify NO for ‘waitUntilDone’, but also to immediately precede 
this with an invocation of ‘cancelPreviousPerform…’ to stop multiple performs 
from getting queued up. (That still works, of course.)

Now, it would be more natural to use GCD for this — dispatch a block onto the 
main queue, with a suitable [thread-safe] test to skip queuing anything when 
there’s still a block queued from the last time.

When you use a block for this, you don’t have to worry about passing any 
parameters from the background thread to the main thread (if there are any), 
because they can be captured in the block instead. So, all you really need is a 
shared BOOL variable to control the queuing behavior. In the background thread, 
if the variable is NO, set it to YES and queue a block. In the queued block 
(running on the main thread), simply set the variable to NO and start a UI 
update.

Of course, both those actions involving the variable (test/set in the 
background thread, clear in the main thread) need to be done atomically, and 
for that you can use a GCD semaphore — bracket the sensitive code with a 
semaphore wait/release pair.

This is one of those things that’s almost harder to describe in words than it 
is to do in code.

___

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: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Graham Cox

On 12 Nov 2013, at 8:00 pm, Quincey Morris 
quinceymor...@rivergatesoftware.com wrote:

 Perhaps the question is why you’re using ‘performSelector’ for this at all, 
 other than historical inertia.

Hmm, that just about sums it up I suppose.

 Now, it would be more natural to use GCD for this — dispatch a block onto the 
 main queue

While I can see the power and elegance of blocks, there’s something about them 
that means they’re still not my go-to solution as much as they should be. 
Probably the fact that every single time I need to use one I have to go back to 
the fundamental documentation to figure out the syntax; they just don’t come 
naturally.

 This is one of those things that’s almost harder to describe in words than it 
 is to do in code.

Probably true, but something Jens said got me thinking, and in fact I have 
added a solution that’s so easy I dunno why it didn’t occur to me before - 
instead of the worker thread driving progress, get the progress to poll the 
worker thread. Turns out that this is so simple my worker thread is doing far, 
far less than it was to support progress, and the UI cannot go any faster than 
a rate I set, and nothing is queued at all. Simples! (and thanks Jens for the 
inspiration).

—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: MP4 video playback on Mavericks - Where's a good place to start?

2013-11-12 Thread Bryan Vines
Thanks to Karl Moskowski, Jean-Daniel Dupas, and Stuart Rogers for confirming 
AVFoundation and AVKit as the modern way forward. After reviewing Apple's 
sample code, the slides from WWDC 2013 session 606, and a couple more Google 
searches, the task of playing an MP4 video was pretty straightforward.

Thanks again!
--
Bryan Vines


___

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: NSTextView - stopping conversion of quotation marks

2013-11-12 Thread Shane Stanley
On 13 Nov 2013, at 4:08 AM, 2551 2551p...@gmail.com wrote:

 I’ve put this one to bed and can now move on to the next probl

Here's the answer already: setAutomaticDashSubstitutionEnabled:NO.


-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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