Communicating with a child process in app sandbox

2015-06-28 Thread SevenBits
For my latest app (sandboxed, and in development for the App Store), I am 
spawning a child process so that I can delete some files without involving the 
main application. I want to be able to send this child process the files to 
delete using IPC.

I don’t want to use an XPC service, because from what I understand, you are 
only allowed to have one instance of the service running per application, which 
doesn’t work for me (I need to be able to spawn multiple instances). I’ve set 
up the application to use Distributed Objects, but it doesn’t appear that DO 
are allowed under the app sandbox.

Can anyone think of a way to do what I require?


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

Re: Communicating with a child process in app sandbox

2015-06-28 Thread Maxthon Chan
You can make your XPC service multithreaded - spawn one thread for each request.

> On Jun 29, 2015, at 01:05, SevenBits  wrote:
> 
> For my latest app (sandboxed, and in development for the App Store), I am 
> spawning a child process so that I can delete some files without involving 
> the main application. I want to be able to send this child process the files 
> to delete using IPC.
> 
> I don’t want to use an XPC service, because from what I understand, you are 
> only allowed to have one instance of the service running per application, 
> which doesn’t work for me (I need to be able to spawn multiple instances). 
> I’ve set up the application to use Distributed Objects, but it doesn’t appear 
> that DO are allowed under the app sandbox.
> 
> Can anyone think of a way to do what I require?
> ___
> 
> 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/max%40maxchan.info
> 
> This email sent to m...@maxchan.info



smime.p7s
Description: S/MIME cryptographic signature
___

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: Communicating with a child process in app sandbox

2015-06-28 Thread Jens Alfke

> On Jun 28, 2015, at 10:05 AM, SevenBits  wrote:
> 
> For my latest app (sandboxed, and in development for the App Store), I am 
> spawning a child process so that I can delete some files without involving 
> the main application.

Do you need a helper process for this? If you just want to keep the UI 
responsive, you can run the deletions on a background thread.

—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: C Assert in BSD Static Library

2015-06-28 Thread Clark S. Cox III

> On Jun 23, 2015, at 17:24, Raglan T. Tiger  wrote:
> 
>> On Jun 23, 2015, at 5:48 PM, Scott Ribe  wrote:
>> 
>> Just to be clear, =1 is actually not necessary.
> 
> 
> Yes.  But of course Xcode puts DEBUG=1 in the debug configuration.
> 
> Just doing belt and suspenders.
> 
> What if the compiler did 
> 
> #ifdef NDEBUG
> 
> if ( NDEBUG == 1 ) 
> 
> #endif

If the compiler is doing that, then it is simply wrong. If NDEBUG is defined at 
all, then assert is disabled. This is guaranteed by the C standard.

-- 
Clark S. Cox III
clarkc...@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

Open program from custom schema link

2015-06-28 Thread Juanjo Conti
I have 2 questions.

1) If in XCode I set an URL type for my App: my-appx, once it's open for
first time, it register to all browsers that it will handle links of the
type myappx://something.

Is it is suppose to call MyApp with "something" as argument? How do I read
"something" from the run app?
2) How can I know (from a web page) if there is any app registered with the
browser to handle X schema? (Mac OS X)

For example, I have an App that then runs, it register that it can handle
the schema my-app://. How can I write a web page (probably with js) to
determine if I show the text "Download MyApp" or I just put the link to
my-app://something been sure that it will be correctly open by my app?
-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

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

NSUserDefaults allocation size and CALayer memory usage

2015-06-28 Thread Henrik Granaas-Helmers
Hi there,

I am new to Apple development, and new to this list. I have two questions about 
memory on OS X.

1. NSUserDefaults seems to allocate 16 MB memory at load. I can't see myself 
using a megabyte—let alone 16 of those. It would be very interesting to know 
why it allocates so much, and if there is a way to encourage NSUserDefaults to 
grab less.

2. I create a couple of CoreAnimation layers that I think are large (5120x2880 
px). I would expect that to occupy 450 MB (5120*2880*32/1024/1024) of memory. 
But instead it only takes up one fourth of that. What is this sorcery?


--
Henrik Granaas-Helmers
___

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

Swift 2.0 difficulty

2015-06-28 Thread Michael de Haan 

Hi All
I am looking at Swift 2.0. The compiler has converted the code below to the 
“latest” Swift syntax. This causes the error shown. I have spent a few days 
trying to get this to compile. What is confusing to me, is that the code, 
listed last (func removeAnElemen…..)  does compile ( all in Playground) and 
there 'anyGenerator' seems to tolerate some logic in the body of 
“anyGenerator”. 
Any insight will be much appreciated.



// This is OLD Swift
// Generators and sequences
var currentValue = 1
let newGenerator = GeneratorOf {
let previousValue = currentValue
currentValue = currentValue * 2
if (previousValue > 20) { return nil }
return previousValue
}
let generatedArray = Array(newGenerator)




// This is Swift 2.0
// Generators and sequences
var currentValue = 1
let newGenerator = anyGenerator {  // Error: Cannot find an overload for 
‘anyGenerator’ that accepts an argument list of type ‘(()-> _)
let previousValue = currentValue
currentValue = currentValue * 2
if (previousValue > 20) { return nil }
return previousValue
}
let generatedArray = Array(newGenerator)


This does compile:

func removeAnElement(array: [T]) -> AnyGenerator<[T]> {
var i = 0
return anyGenerator {
if i < array.count {
var result = array.self
result.removeAtIndex(i)
i++
return result
}
return nil
}
}
Array(removeAnElement([1,2,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