Fwd: How to make an app launch on login?

2016-04-20 Thread Jeff Szuhay


As Jens suggested in another thread, launchd is likely too low-level.

Finally, there is Tim Schroeder’s “Launch At Login Project” which enables
a sandboxed app to launch itself. 
/>

This uses the SMLoginItemSetEnabled call in a separate process.

I wish someone at Apple would step in here and provide a little direction on 
which is the
best way for an app to launch _itself_ at login. 




> On Apr 19, 2016, at 2:43 PM, Jeff Szuhay  > wrote:
> 
> Again, I jumped the gun.
> 
> The preferred way seems to be through the use of launchd
>   
> 
>  
> 
> 
 On Apr 19, 2016, at 2:01 PM, Jens Alfke >>> > wrote:
 
 One of my companies’ apps has a “Launch at login” pref, which no longer 
 works in OS X 10.11. I’m not surprised, since the existing code implements 
 this by writing into loginwindow’s user defaults :-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: No Alert, Discard Change, & Beep

2016-04-20 Thread dangerwillrobinsondanger



> On Apr 20, 2016, at 3:40 PM, Richard Charles  wrote:
> 
> The engineers at Apple that invented and implemented this stuff must have 
> been amazing.

And at NeXT before that. 
The folks who work and have worked on Cocoa have always included people with 
broad minds, deep talent and x-ray vision. 

Bindings works off of a fair bit of meta programming and made a public debut 
with the 10.3 SDK. 
The original choice of Objective-C enabled a lot of the patterns in use much as 
Ruby enabled the things that inspired magic in Rails. 
Freaky parallels. 
___

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: How to make an app launch on login?

2016-04-20 Thread sqwarqDev

If you’re willing (or able: beware sandboxing issues) to call either osascript 
or NSAppleScript, you can do this via a bit of AppleScript magic:


tell application "Finder" to set aPath to POSIX path of (application file id 
”com.yourBundleID.yourApp" as string)

tell application "System Events” 
make new login item at end of login items with properties {path:aPath, hidden:false, 
kind:\"Application\", name:”Your App Name”}
end tell



Best

Phil
@sqwarq
___

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: How to make an app launch on login?

2016-04-20 Thread dangerwillrobinsondanger
I believe the correct answer is LaunchAgent plist, XPC helper LaunchAgent or 
instruct users to manually add it in system preferences or provide a script 
they can manually run once. 


Sent from my iPhone

> On Apr 20, 2016, at 6:01 PM, sqwarqDev  wrote:
> 
> If you’re willing (or able: beware sandboxing issues) to call either 
> osascript or NSAppleScript, you can do this via a bit of AppleScript magic:
> 
> 
> tell application "Finder" to set aPath to POSIX path of (application file id 
> ”com.yourBundleID.yourApp" as string)
> 
> tell application "System Events” 
> make new login item at end of login items with properties {path:aPath, 
> hidden:false, kind:\"Application\", name:”Your App Name”}
> end tell
> 
> 
> 
> Best
> 
> Phil
> @sqwarq
> ___
> 
> 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/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.com

___

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

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

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

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

Re: How to make an app launch on login?

2016-04-20 Thread sqwarqDev

Not quite sure what "correct" means there, but I use the AppleScript approach 
in a couple of my apps and it works without issue. Doesn't require elevated privileges, 
and it's tied to a checkbox user preference which gets saved in StandardUserDefaults.

If your app is sandboxed you'll need to call it via NSUserAppleScriptTask, see:

https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSUserAppleScriptTask_Class/index.html#//apple_ref/doc/uid/TP40012267-CH1-SW2

Best

Phil
@sqwarq
http://sqwarq.com

On Apr 20, 2016, at 04:48 PM, dangerwillrobinsondan...@gmail.com wrote:

I believe the correct answer is LaunchAgent plist, XPC helper LaunchAgent or instruct users to manually add it in system preferences or provide a script they can manually run once. 



Sent from my iPhone

On Apr 20, 2016, at 6:01 PM, sqwarqDev  wrote:

If you’re willing (or able: beware sandboxing issues) to call either osascript 
or NSAppleScript, you can do this via a bit of AppleScript magic:


tell application "Finder" to set aPath to POSIX path of (application file id 
”com.yourBundleID.yourApp" as string)

tell application "System Events”
make new login item at end of login items with properties {path:aPath, hidden:false, 
kind:\"Application\", name:”Your App Name”}
end tell



Best

Phil
@sqwarq
___

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

This email sent to dangerwillrobinsondan...@gmail.com
___

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

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

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

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

Re: How to make an app launch on login?

2016-04-20 Thread sqwarqDev

| On Apr 20, 2016, at 05:00 PM, sqwarqDev  wrote:
| If your app is sandboxed you'll need to call it via NSUserAppleScriptTask

Correction: NSUserScriptTask

https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSUserScriptTask_Class/index.html#//apple_ref/occ/cl/NSUserScriptTask


Best

Phil
@sqwarq
http://sqwarq.com

On Apr 20, 2016, at 04:48 PM, dangerwillrobinsondan...@gmail.com wrote:

I believe the correct answer is LaunchAgent plist, XPC helper LaunchAgent or instruct users to manually add it in system preferences or provide a script they can manually run once. 



Sent from my iPhone

On Apr 20, 2016, at 6:01 PM, sqwarqDev  wrote:

If you’re willing (or able: beware sandboxing issues) to call either osascript 
or NSAppleScript, you can do this via a bit of AppleScript magic:


tell application "Finder" to set aPath to POSIX path of (application file id 
”com.yourBundleID.yourApp" as string)

tell application "System Events”
make new login item at end of login items with properties {path:aPath, hidden:false, 
kind:\"Application\", name:”Your App Name”}
end tell



Best

Phil
@sqwarq
___

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

This email sent to dangerwillrobinsondan...@gmail.com
___

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

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

Help/Unsubscribe/Update your Subscription:
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: Proper way to set up constants when building an iOS framework

2016-04-20 Thread Alex Zavatone
Bingo.  It works.  She builds.  Constants are found.  All is well.  Thanks for 
the collective patience.  

I was initially under the assumption that my constants.h file would somehow 
need to become the pch, since i put my constants in the .h.

I wasn't thinking that I'd make yet another header, (the .pch) to then include 
the constants header and then it would need to be at the same level in the 
framework as the constants file or would need to be able to see the path to it 
in the #import.  

The gap in communication was that I was thinking, "OK, I've got the constants.h 
and constants.m, now what mechanism do I need to use that operates like a .pch 
does in a straight olden iOS app so that all of my framework's classes can use 
those constants."

I was thinking that somehow there is a spot that can import that .h or I would 
have to turn that .h into a pch.  What I was missing was that I'd need to 
create a .pch, that can then see the constants file through a #import.

Thank you all and sorry for the excessive noise.

The framework is now happy with constants and is loading custom subclasses and 
their xibs and assets and code and the world is temporarily a calm and 
wonderful place.

Alex Zavatone


On Apr 19, 2016, at 3:47 PM, Jens Alfke wrote:

> 
>> On Apr 19, 2016, at 11:19 AM, Alex Zavatone  wrote:
>> 
>> How might I create one that the framework knows how to use?  Should I create 
>> some .pch, then include the constants.h in it?  If so, once I create the 
>> .pch, where is the setting to tell my framework that it needs to use it?
> 
> OH. Now I understand what’s going wrong — you’re actually asking how to set 
> up a prefix header for a target.
> 
> Make a .pch file. Enter something like
>   #import 
>   #import "Constants.h"
> Go to the target build settings. 
> Use the filter field to search for “prefix header” (it’s under “Apple LLVM - 
> Language”). *
> Set the value to the path to your .pch file (relative to the project 
> directory).
> You probably want to enable Precompile Prefix Header.
> 
> —Jens
> 
> * The target might already have a prefix header set. In that case you can 
> just edit that one instead. Or delete it and set the path to your own.

___

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: How to make an app launch on login?

2016-04-20 Thread Alex Zavatone
I use a super useful and nice little tool for iOS called SimulatorManager that 
has the option to make it an item that is launched at startup.

It probably contains the code you need.

It is here:

https://github.com/tue-savvy/SimulatorManager

Hope this helps.

Alex Zavatone


On Apr 19, 2016, at 5:01 PM, Jens Alfke wrote:

> One of my companies’ apps has a “Launch at login” pref, which no longer works 
> in OS X 10.11. I’m not surprised, since the existing code implements this by 
> writing into loginwindow’s user defaults :-p
> 
> I’m trying to find the currently supported API for this. The “Adding Login 
> Items” page says:
>> There are two ways to add a login item: using the Service Management 
>> framework, and using a shared file list.
>> Login items installed using the Service Management framework are not visible 
>> in System Preferences and can only be removed by the application that 
>> installed them.
>> Login items installed using a shared file list are visible in System 
>> Preferences; users have direct control over them. 
> 
> I’d definitely prefer the latter, since it seems like a bad idea to have the 
> app not show up in the user’s login-item list in the Accounts system pref.
> 
> I found LSSharedFileList.h, but everything in there is marked deprecated. :(
> 
> What are my options?
> 
> —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/zav%40mac.com
> 
> This email sent to z...@mac.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: Proper way to set up constants when building an iOS framework

2016-04-20 Thread Jens Alfke

> On Apr 20, 2016, at 11:11 AM, Alex Zavatone  wrote:
> 
> I wasn't thinking that I'd make yet another header, (the .pch) to then 
> include the constants header and then it would need to be at the same level 
> in the framework as the constants file or would need to be able to see the 
> path to it in the #import.  

You don’t actually need to make a separate .pch file. You could configure the 
target’s Prefix Header path to point directly at Constants.h. The point is just 
that every type of target can have a prefix header, not just an application.

—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: How to make an app launch on login?

2016-04-20 Thread Jens Alfke
FYI, I just filed a bug report complaining about the lack of a reasonable 
native API for this. rdar://25834170 .

—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: BOOL parameter passed as nil object

2016-04-20 Thread Carl Hoefs

On Apr 19, 2016, at 1:50 PM, John McCall wrote:

> We strongly encourage you not to worry about any of this and just always call 
> methods using the right method signature.

Roger, wilco!  (It had a 'smell' to it, but I wasn't quite certain why. Now I 
know! ;-)
-Carl

___

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

So, you guys have helped me do the impossible.

2016-04-20 Thread Alex Zavatone
Parson the spam, but…

StackOverflow only goes so far.

Having a community of sharing professionals to advise (through my frustration) 
has helped me do what a year ago was not even within our dreams.

Our entire iOS app, rewritten from scratch (OK, MOSTLY rewritten) in 2 months 
by me in a framework that includes links to the source that builds two other 
static libs from this source and the resulting framework can be linked to by 
any Obj-C file in an iOS project and able to be inited, opened and set running 
in one line of code in a project that links to the framework.

(Pardon the horrible run on sentence above.)

All images, XIBs, storyboards, audio sitting inside too and able to be fetched 
as needed through bundle access wrappers just like nature intended.

All able to be instantiated, initialized and set running with one line of code.
 

And no, it's not called myAwesomeFramework, but you get the idea.

#import 

…

[MyAwsomeFrameworkManagerClass sharedInstance] launchMyAwesomeAppContent];



No more classes where tableView:cellForRowAtIndexPath: is 137 lines of code and 
where the data source is if/then/elsed.

No more 4000+ line view controllers which import other view controllers and 
rely on them as NSURLConnection response delegates.  

No more cases where entire view controllers (like those above) are instantiated 
and added as subviews to the currently presented view controller.

I'll stop there - because it gets worse, much worse.  You all get the idea.

Thank you.
Thank you.
Thank you.

Back to work.

Thank you.

Alex Zavatone
___

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

Air Drop-style sharing between instances of my app?

2016-04-20 Thread Rick Mann
Is there a way to do Air Drop-style sharing between two instances of my app 
(running on separate devices near each other)? It seems I can AirDrop to any 
other device, but I want to restrict it to devices that have my app installed.

Our app gathers app-specific data. It can be beneficial to the user to have 
more than one person using a device gathering data, and then have all the 
additional users transfer the data they gathered from their device to one 
"main" device.

Would Peer-to-peer connectivity be a way to accomplish this? The idea would be 
for users to browse for other nearby devices running the app, and then offer 
data, and have the other app pop up UI authorizing the transfer.

Thanks,

-- 
Rick Mann
rm...@latencyzero.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: Air Drop-style sharing between instances of my app?

2016-04-20 Thread Jeff Kelley
That sounds like the perfect use case for using the MultipeerConnectivity 
framework. At a lower level, you could use Bonjour (though that requires the 
devices to be on the same network).

Jeff Kelley

> On Apr 20, 2016, at 9:33 PM, Rick Mann  wrote:
> 
> Is there a way to do Air Drop-style sharing between two instances of my app 
> (running on separate devices near each other)? It seems I can AirDrop to any 
> other device, but I want to restrict it to devices that have my app installed.
> 
> Our app gathers app-specific data. It can be beneficial to the user to have 
> more than one person using a device gathering data, and then have all the 
> additional users transfer the data they gathered from their device to one 
> "main" device.
> 
> Would Peer-to-peer connectivity be a way to accomplish this? The idea would 
> be for users to browse for other nearby devices running the app, and then 
> offer data, and have the other app pop up UI authorizing the transfer.
> 
> Thanks,
> 
> -- 
> Rick Mann
> rm...@latencyzero.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/slaunchaman%40gmail.com
> 
> This email sent to slauncha...@gmail.com

___

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

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

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

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

Correct way to specify anchors with NSURL?

2016-04-20 Thread Graham Cox
Hi all,

I’m building a URL from parts, which may include anchors.

When I do this:

url = [myURL URLByAppendingPathComponent:@“page#anchor”];

I get a URL which has replaced the # with %23. That may be correct as such, but 
when it’s used to load the actual page, it results in a 404. If I type the same 
URL directly in using a typed # character, it resolves correctly.

What’s the correct way to append an anchor to a URL?

—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: Correct way to specify anchors with NSURL?

2016-04-20 Thread Quincey Morris
On Apr 20, 2016, at 19:59 , Graham Cox  wrote:
> 
> What’s the correct way to append an anchor to a URL?

I believe you need to use NSURLComponents, and specify the “fragment” property.

___

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

Text field alignment

2016-04-20 Thread Quincey Morris
I’m laying out some views (using auto-layout, though I don’t think that’s the 
cause of the problem) on OS X 10.11.4 with Xcode 7.3. In many cases, I’m 
baseline-aligning a pair of text fields, one label and one editable. The font 
is the default (System-Regular, i.e. 13 pt) and the text field heights are 
default too.

Unfortunately, the label and the text field are not baseline aligned, but the 
text field contents are one point too low. It looks wrong, too, because it’s 
too close to the bottom of the enclosing box, and when selected there is more 
highlighted empty space above the text than below.

I can sort of fix it by playing around with the text field heights and/or 
offsetting the constraints, but I don’t really want to because it seems like a 
mistake to design for this particular quirk.

Has anyone else run into this, or got any suggestions about what (if anything) 
to do about it?



___

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: Air Drop-style sharing between instances of my app?

2016-04-20 Thread Rick Mann
Well, I want it to use the side-channel WiFi connection, if it can, so I think 
MPC is the way to go. Thanks!

> On Apr 20, 2016, at 19:09 , Jeff Kelley  wrote:
> 
> That sounds like the perfect use case for using the MultipeerConnectivity 
> framework. At a lower level, you could use Bonjour (though that requires the 
> devices to be on the same network).
> 
> Jeff Kelley
> 
>> On Apr 20, 2016, at 9:33 PM, Rick Mann  wrote:
>> 
>> Is there a way to do Air Drop-style sharing between two instances of my app 
>> (running on separate devices near each other)? It seems I can AirDrop to any 
>> other device, but I want to restrict it to devices that have my app 
>> installed.
>> 
>> Our app gathers app-specific data. It can be beneficial to the user to have 
>> more than one person using a device gathering data, and then have all the 
>> additional users transfer the data they gathered from their device to one 
>> "main" device.
>> 
>> Would Peer-to-peer connectivity be a way to accomplish this? The idea would 
>> be for users to browse for other nearby devices running the app, and then 
>> offer data, and have the other app pop up UI authorizing the transfer.
>> 
>> Thanks,
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.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/slaunchaman%40gmail.com
>> 
>> This email sent to slauncha...@gmail.com
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
Rick Mann
rm...@latencyzero.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: Text field alignment

2016-04-20 Thread dangerwillrobinsondanger
Increase the priority on vertical content hugging of both. 


Sent from my iPhone

> On Apr 21, 2016, at 12:13 PM, Quincey Morris 
>  wrote:
> 
> I’m laying out some views (using auto-layout, though I don’t think that’s the 
> cause of the problem) on OS X 10.11.4 with Xcode 7.3. In many cases, I’m 
> baseline-aligning a pair of text fields, one label and one editable. The font 
> is the default (System-Regular, i.e. 13 pt) and the text field heights are 
> default too.
> 
> Unfortunately, the label and the text field are not baseline aligned, but the 
> text field contents are one point too low. It looks wrong, too, because it’s 
> too close to the bottom of the enclosing box, and when selected there is more 
> highlighted empty space above the text than below.
> 
> I can sort of fix it by playing around with the text field heights and/or 
> offsetting the constraints, but I don’t really want to because it seems like 
> a mistake to design for this particular quirk.
> 
> Has anyone else run into this, or got any suggestions about what (if 
> anything) to do about it?
> 
> 
> 
> ___
> 
> 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/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.com

___

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

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

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

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

Re: Correct way to specify anchors with NSURL?

2016-04-20 Thread dangerwillrobinsondanger
There are also URLEncoded... versions of those components that should help to 
URL encode properly per component type. 
I'm not sure which SDK added that. 

Sent from my iPhone

> On Apr 21, 2016, at 12:08 PM, Quincey Morris 
>  wrote:
> 
>> On Apr 20, 2016, at 19:59 , Graham Cox  wrote:
>> 
>> What’s the correct way to append an anchor to a URL?
> 
> I believe you need to use NSURLComponents, and specify the “fragment” 
> property.
> 
> ___
> 
> 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/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.com

___

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

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

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

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

Re: Text field alignment

2016-04-20 Thread Roland King

> On 21 Apr 2016, at 11:13, Quincey Morris 
>  wrote:
> 
> I’m laying out some views (using auto-layout, though I don’t think that’s the 
> cause of the problem) on OS X 10.11.4 with Xcode 7.3. In many cases, I’m 
> baseline-aligning a pair of text fields, one label and one editable. The font 
> is the default (System-Regular, i.e. 13 pt) and the text field heights are 
> default too.
> 
> Unfortunately, the label and the text field are not baseline aligned, but the 
> text field contents are one point too low. It looks wrong, too, because it’s 
> too close to the bottom of the enclosing box, and when selected there is more 
> highlighted empty space above the text than below.
> 
> I can sort of fix it by playing around with the text field heights and/or 
> offsetting the constraints, but I don’t really want to because it seems like 
> a mistake to design for this particular quirk.
> 
> Has anyone else run into this, or got any suggestions about what (if 
> anything) to do about it?
> 

Yes  - I believe your options, as well as filing a bug are

1) turn the border off on the textfield (I can hardly notice the difference 
myself and this also puts the highlight properly inside the space in the box.

or

2) adjust the baseline alignment constraint constant to 1, or -1, depending on 
which field is first in your constraint. 

I’m fairly sure the NSTextField doesn’t properly take account of the border 
when aligning baselines. 
___

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: Correct way to specify anchors with NSURL?

2016-04-20 Thread Graham Cox

> On 21 Apr 2016, at 1:08 PM, Quincey Morris 
>  wrote:
> 
> On Apr 20, 2016, at 19:59 , Graham Cox  wrote:
>> 
>> What’s the correct way to append an anchor to a URL?
> 
> I believe you need to use NSURLComponents, and specify the “fragment” 
> property.
> 


Thanks, that works…

But it’s 10.9+ only. I really need a solution that will work back to 10.7 (or 
10.8 at the latest).

Annoying that the ‘fragment’ property of NSURL is read-only, that looks like an 
obvious way to  do it, if the API was sane.

—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: Correct way to specify anchors with NSURL?

2016-04-20 Thread Quincey Morris
On Apr 20, 2016, at 22:16 , Graham Cox  wrote:
> 
> But it’s 10.9+ only. I really need a solution that will work back to 10.7 (or 
> 10.8 at the latest).

Then I’d guess you’d need to construct the entire URL as a string first, then 
use initWithString. Presumably ‘URLByAppendingPathComponent’ %-encodes a # 
because you’ve told it that your substring is a *path* component. If you give 
it a whole string, I’d assume it figures out that it’s got a “fragment” at the 
end.

But I’m just guessing now.

___

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