[Q] a view is associated with more than one view controller?

2012-10-25 Thread JongAm Park
Hello,

I'm having a problem while rebuilding old project which was made with iOS 3.x 
SDK at first.
Currently I'm building it with iOS 6.0 SDK and can be targeted for 4.3.

There is a central controller, RootViewController.
And when the app is loaded, it creates an instance of UIImagePickerController.
And finally, it tries to assign the view of UIImagePickerController, i.e. 
imagePickerController.view, to the RootViewController's view.

Brief code lines are like this.

if([UIImagePickerController 
isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) 
{
self.camera = [[UIImagePickerController alloc] init];
[self.camera setSourceType:UIImagePickerControllerSourceTypeCamera];
self.camera.allowsEditing = NO;
self.camera.navigationBarHidden = YES;
self.camera.toolbarHidden = YES;
self.camera.wantsFullScreenLayout = YES;

...

self.view == self.camera.view; // This is where it throws the exception.
// self is RootViewController

The error message is this :

A view can only be associated with at most one view controller at a time! View 
UILayoutContainerView: 0x1ddbee60; frame = (0 0; 320 480); autoresize = W+H; 
layer = CALayer: 0x1ddbeed0 is associated with UIImagePickerController: 
0x1dd510b0. Clear this association before associating this view with 
RootViewController: 0x1dd32f20. : A view can only be associated with at most 
one view controller at a time! View UILayoutContainerView: 0x1ddbee60; frame = 
(0 0; 320 480); autoresize = W+H; layer = CALayer: 0x1ddbeed0 is associated 
with UIImagePickerController: 0x1dd510b0. Clear this association before 
associating this view with RootViewController: 0x1dd32f20.

The UILayoutContainerView: 0x1ddbee60 is self.camera.view.

According to this StackOverFlow page, its sounds like that it was possible to 
assign a view controller's view to other controller's view with previous iOS 
SDK, but looks to be changed recently.

Does Apple recommend other approach to achieve the same goal?
If anyone knows how to solve this problem, please show me your guidance.

Thank you.
JongAm Park


___

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: [Q] a view is associated with more than one view controller?

2012-10-25 Thread Baoming Tian
Why not just add the camera view as sub view of the root ? 

from my  iPhone

在 2012-10-25,下午2:59,JongAm Park jongamp...@sbcglobal.net 写道:

 Hello,
 
 I'm having a problem while rebuilding old project which was made with iOS 3.x 
 SDK at first.
 Currently I'm building it with iOS 6.0 SDK and can be targeted for 4.3.
 
 There is a central controller, RootViewController.
 And when the app is loaded, it creates an instance of UIImagePickerController.
 And finally, it tries to assign the view of UIImagePickerController, i.e. 
 imagePickerController.view, to the RootViewController's view.
 
 Brief code lines are like this.
 
 if([UIImagePickerController 
 isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) 
 {
self.camera = [[UIImagePickerController alloc] init];
[self.camera setSourceType:UIImagePickerControllerSourceTypeCamera];
self.camera.allowsEditing = NO;
self.camera.navigationBarHidden = YES;
self.camera.toolbarHidden = YES;
self.camera.wantsFullScreenLayout = YES;
 
...
 
self.view == self.camera.view; // This is where it throws the exception.
// self is RootViewController
 
 The error message is this :
 
 A view can only be associated with at most one view controller at a time! 
 View UILayoutContainerView: 0x1ddbee60; frame = (0 0; 320 480); autoresize = 
 W+H; layer = CALayer: 0x1ddbeed0 is associated with 
 UIImagePickerController: 0x1dd510b0. Clear this association before 
 associating this view with RootViewController: 0x1dd32f20. : A view can 
 only be associated with at most one view controller at a time! View 
 UILayoutContainerView: 0x1ddbee60; frame = (0 0; 320 480); autoresize = W+H; 
 layer = CALayer: 0x1ddbeed0 is associated with UIImagePickerController: 
 0x1dd510b0. Clear this association before associating this view with 
 RootViewController: 0x1dd32f20.
 
 The UILayoutContainerView: 0x1ddbee60 is self.camera.view.
 
 According to this StackOverFlow page, its sounds like that it was possible to 
 assign a view controller's view to other controller's view with previous iOS 
 SDK, but looks to be changed recently.
 
 Does Apple recommend other approach to achieve the same goal?
 If anyone knows how to solve this problem, please show me your guidance.
 
 Thank you.
 JongAm Park
 
 
 ___
 
 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/tianbaom%40gmail.com
 
 This email sent to tianb...@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: Security-scoped bookmarks linked to code signing?

2012-10-25 Thread Mike Abdullah

On 25 Oct 2012, at 00:27, Graham Cox wrote:

 
 On 25/10/2012, at 10:05 AM, Mike Abdullah cocoa...@mikeabdullah.net wrote:
 
 
 On 24 Oct 2012, at 23:31, Graham Cox wrote:
 
 
 On 24/10/2012, at 8:47 PM, Mike Abdullah cocoa...@mikeabdullah.net wrote:
 
 Handling security-scoped bookmarks most certainly relies upon 
 code-signing, as without you can’t create or resolve them. Are you dealing 
 with app or document scoped bookmarks here?
 
 
 
 App-scoped.
 
 In dev and testing no problem was encountered but in the wild we have 
 this crash deep within -[NSURL URLByResolvingBookmarkData:options:.]. 
 The app was incorrectly signed due to a stuff-up with the developer ID 
 certs which was resolved, but that won't help until we get an update 
 published. What's annoying is that the bookmark resolving just crashes 
 rather than handle the problem gracefully, and we're still not certain 
 whether the incorrect signing is the real cause or not (the apps were 
 signed, just not using the correct cert). This deep connection between 
 parts of the OS that behave very differently according to the situation 
 they find themselves in is a recipe for very hard-to-find bugs that easily 
 escape QA.
 
 Is it possible 
 http://www.mikeabdullah.net/nsurl-bookmark-error-handling.html is biting you?
 
 
 
 Hmm, interesting...
 
 I wasn't setting error to nil, I am now.
 
 However, all I do with the value of error is log it if the URL returns nil. 
 While that could crash in the circumstances your post describes, that isn't 
 where it appears to actually be crashing. (Unfortunately I don't have a stack 
 trace handy).
 
 Do you know of a way to force this resolution to fail so I can test it?

Oops, I forgot to mention in the post that I’d seen it crash internally too, 
from trying to do something with the junk pointer being fed in. Sadly I don’t 
have a stack trace or repro steps handy :(


___

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

Binding InfoPanel to currentDocument

2012-10-25 Thread Gerriet M. Denkmann
I have a Panel which has a PopUpButton which has it's Content Values bound to 
an ArrayController.
The ArrayController has it's Content Array bound to File's Owner: 
currentDocument.listOfThings.

The File's Owner (aka) Application Delegate:
@property (readonly) DocumentSubclass *currentDocument;

- (DocumentSubclass *)currentDocument
{
return [  [ NSDocumentController sharedDocumentController ] 
currentDocument ];
}

and the DocumentSubclass has of course:
@property (readonly) NSArray *listOfThings;

The problem: how does the ArrayController know that the currentDocument has 
changed?

Currently I am using a rather silly hack:
My DocumentSubclass calls in init and windowWillClose:
AppDelegate *a = [ [ NSApplication sharedApplication ] delegate ];
[ a somethingIsChanging ];

and the Application Delegate has: 

- (void) somethingIsChanging
{
[ self willChangeValueForKey: @currentDocument ];
[ self performSelector: @selector(didChangeValueForKey:) withObject: 
@currentDocument afterDelay: 0 ];
}

This works, but I have a strong feeling that there is a very obvious better 
solution which I somehow cannot see.

Gerriet.

___

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


Why does a custom CALayer property work differently from a standard one?

2012-10-25 Thread Roland King
Ive been struggling with this for a couple of days now. 

I have a custom CALayer with a custom property, percentage. It's @dynamic and 
set up to cause a redraw. 

+(BOOL)needsDisplayForKey:(NSString *)key
{
return [ @percentage isEqualToString:key ];
}

I return CABasicAnimations for percentage and for position with the code at the 
bottom in actionForKey:. The position one just makes the position change really 
slowly. 

For position all I have to do is make a CABasicAnimation, set the duration and 
nothing else and return it, the position animates smoothly from where it was to 
where it's going. 

If I do the same for 'percentage', just return a CABasicAnimation with the 
duration set, it doesn't animate, it just goes instantly to the final value. 
For this one I have to explicitly set the 'fromValue' to the current value in 
the presentation layer, leaving it nil just doesn't do the job. It finds the 
'toValue' itself, but I have to tell it where it's coming from. 

Why do they work differently? This prevents me from using addAnimation:forKey: 
for 'percentage' because each one is different, depending what the current 
value of percentage is. 


-(idCAAction)actionForKey:(NSString *)event
{

if( [ event isEqualToString:@position ] )
{
CABasicAnimation *animation = [ CABasicAnimation 
animationWithKeyPath:@position ];
animation.duration = 7.f;
return animation;
}

if( [ event isEqualToString:@percentage ] )
{
CABasicAnimation *animation = [ CABasicAnimation 
animationWithKeyPath:@percentage ];
animation.duration = 2.f;
animation.fromValue = [ self.presentationLayer 
valueForKey:event ];
return animation;
}

return [ super actionForKey:event ];;
}
___

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: [Q] a view is associated with more than one view controller?

2012-10-25 Thread Julius Oklamcak
 If anyone knows how to solve this problem, please show me your guidance.

From some work I did earlier this year for a client, UIImagePickerController
needs to be presented modally or in a UIPopoverController. It also doesn't
handle being a root view controller very well (window.rootViewController =
imagePickerController).

Without going the route of using the various AV Foundation APIs to implement
your own camera controller class, the solution I used was to present the
UIImagePickerController modally in the root view controller's
-viewDidAppear: method (you could try in -viewWillAppear:).

___

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: [Q] a view is associated with more than one view controller?

2012-10-25 Thread Roland King

On 25 Oct, 2012, at 10:05 PM, Julius Oklamcak juli...@icodemonks.com wrote:

 If anyone knows how to solve this problem, please show me your guidance.
 
 From some work I did earlier this year for a client, UIImagePickerController
 needs to be presented modally or in a UIPopoverController. It also doesn't
 handle being a root view controller very well (window.rootViewController =
 imagePickerController).
 
 Without going the route of using the various AV Foundation APIs to implement
 your own camera controller class, the solution I used was to present the
 UIImagePickerController modally in the root view controller's
 -viewDidAppear: method (you could try in -viewWillAppear:).
 
 

That is all true - on top of that, after introducing view controller 
containment in iOS5 to give people a proper way of doing what was always not 
recommended, taking a view from ViewController B and slapping it into 
ViewController A, iOS 6 is finally strict about it. You just can't do this any 
more. 

If you want to mix views from different VCs on the screen, you now *must* use 
View Controller Containment (and that's the right thing to look for in the 
documentation). 

The advice above about UIImagePickerController is I believe also true, that 
thing really wants to be modal (I hope they change that one day). 
___

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: Security-scoped bookmarks linked to code signing?

2012-10-25 Thread Sean McBride
On Thu, 25 Oct 2012 00:05:44 +0100, Mike Abdullah said:

Is it possible http://www.mikeabdullah.net/nsurl-bookmark-error-
handling.html is biting you?

Interesting bug.  I wonder if everyone inside Apple is using ARC these days and 
therefore expecting ptr-to-object variables to be nil-initialised could 
explain how such a bug escaped.

Cheers,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada



___

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: [Q] a view is associated with more than one view controller?

2012-10-25 Thread JongAm Park

On 10/25/2012 7:05 AM, Julius Oklamcak wrote:

If anyone knows how to solve this problem, please show me your guidance.

From some work I did earlier this year for a client, UIImagePickerController
needs to be presented modally or in a UIPopoverController. It also doesn't
handle being a root view controller very well (window.rootViewController =
imagePickerController
Thanks for the information. I was off from iOS dev. for a while to focus 
more on Mac and Windows.

However, I kept monitoring what were being added and changed in iOS SDK.
What is embarrassing is that Apple started to push some guide line ( 
if we think of them positively ) or restriction ( if we think of them 
negatively ) and it broke things. For the specific line of code, I put 
in my original message, I think it was wrong to assign 
UIImagePickerController's view to other (Root) controller view at first. 
I think so, not because it was not possible to do, but because it is 
kind of against of idea that Apple introduced view controllers with and 
the gut feeling how Apple people wanted us to use it.


Anyway, because presentModalViewController:animated is deprecated in iOS 
6, i may need to use presetnViewControlle:animated:completion.
However, I also think the target iOS device can have iOS 4.x still. So, 
I need to decide which one to sacrifice, the use of latest message or 
target audience who doesn't upgrade their iOS to iOS 5.0+ yet. or 
probably I can use some gestalt/introspection method to figure out 
branch into to identical code utilizing different messages.



Without going the route of using the various AV Foundation APIs to implement
your own camera controller class, the solution I used was to present the
UIImagePickerController modally in the root view controller's
-viewDidAppear: method (you could try in -viewWillAppear:).


One thing I'm worry is that they customized the view so much that I have 
to rearchitect overall programming structure.
The current code is in -videDidLoad. But it heavily depends on 
rootController.view = UIImagePickerController.view assignment.
However, people just brought me this outsourced project because the 
company which was contracted for this project was departed from us a 
while ago. And they are saying it's urgent...  I saw lots of s***dity in 
the source code, where they even didn't release object properly; they 
implemented -(id)init messages without calling its init of its super 
class;  I would like to zip my mouth


Probably I need to consider addChildViewController also, because of this 
line of explanation for view property in UIViewController.
Each view controller object is the sole owner of its view. You must not 
associate the same view object with multiple view controller objects. 
The only exception to this rule is that a container view controller 
implementation may add this view as a subview in its own view hierarchy. 
Before adding the subview, the container must first call its 
|addChildViewController: 
http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/addChildViewController:| 
method to create a parent-child relationship between the two view 
controller objects.


Actually I tried it yesterday night, but it complaint that the view ( 
probably mean the view of UIImagePickerController ) doesn't support the 
orientation the app is running.  I would like to read View controller 
guide line more calmly tonight...


Thank you.


Thank you for your help.
JongAm Park
___

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: [Q] a view is associated with more than one view controller?

2012-10-25 Thread JongAm Park

Thank you, Baoming. I tried but it didn't work.

Probably I need to chores around it more. I have a few things to do in 
mind. So, I will retry that.

However, UIImagePickerController's view looks to be special as others said.

Best,

On 10/25/2012 12:53 AM, Baoming Tian wrote:

Why not just add the camera view as sub view of the root ?

from my  iPhone




___

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: [Q] a view is associated with more than one view controller?

2012-10-25 Thread JongAm Park

On 10/25/2012 7:18 AM, Roland King wrote:


On 25 Oct, 2012, at 10:05 PM, Julius Oklamcak juli...@icodemonks.com 
mailto:juli...@icodemonks.com wrote:



If anyone knows how to solve this problem, please show me your guidance.


From some work I did earlier this year for a client, 
UIImagePickerController
needs to be presented modally or in a UIPopoverController. It also 
doesn't
handle being a root view controller very well 
(window.rootViewController =

imagePickerController).

Without going the route of using the various AV Foundation APIs to 
implement

your own camera controller class, the solution I used was to present the
UIImagePickerController modally in the root view controller's
-viewDidAppear: method (you could try in -viewWillAppear:).




That is all true - on top of that, after introducing view controller 
containment in iOS5 to give people a proper way of doing what was 
always not recommended, taking a view from ViewController B and 
slapping it into ViewController A, iOS 6 is finally strict about it. 
You just can't do this any more.




That's good. :)
I don't like people who just write code which just looks to work because 
their managers or people at asked-company-if-contracted don't know about 
programming.
I have seen so many people in Windows and Mac, and now even in iPhone 
world who didn't understand paradigm of a framework and just write code 
without knowing that it violated the paradigm. When something doesn't 
abide by the paradigm, it may work now, but can break seriously soon.

Also, it's highly possible that it is not even properly implemented.
What I'm saying is just like this : a guy just implemnted 1+1 = 2 like : 
1 + (uh... i don't know what to do ) + 2 + 3 - 3 - 1 (hmm.. it looks 
working.. ) = 1

However, welll... cruel world. I got such source code on my hand.

If you want to mix views from different VCs on the screen, you now 
*must* use View Controller Containment (and that's the right thing to 
look for in the documentation).


The advice above about UIImagePickerController is I believe also true, 
that thing really wants to be modal (I hope they change that one day).

by using.. like.. addChildViewController: right?

I found this explanation in Apple's document. ( view property in 
UIViewController class reference. )


Each view controller object is the sole owner of its view. You must not 
associate the same view object with multiple view controller objects. 
The only exception to this rule is that a container view controller 
implementation may add this view as a subview in its own view hierarchy. 
Before adding the subview, the container must first call its 
|addChildViewController: 
http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/addChildViewController:| 
method to create a parent-child relationship between the two view 
controller objects.


It sounds like that if I add UIImagePicker controller using 
addChildViewController:, it's possible to set the view of a root view 
controller to the view of UIImagePicker. but it didn't work last night. 
Probably I missed something. I would like to read their document more.


There are a few things I would like to try (again) :

1. |presentViewController:animated:completion: 
http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/presentViewController:animated:completion:

2. addChildViewController:

What do you think about it?

I'm switching to Windows mode by launching Visual Studio... :(

Thank you.
JongAm Park
|
___

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: Binding InfoPanel to currentDocument

2012-10-25 Thread Seth Willits
On Oct 25, 2012, at 4:36 AM, Gerriet M. Denkmann wrote:

 This works, but I have a strong feeling that there is a very obvious better 
 solution which I somehow cannot see.


There actually isn't an obvious solution.


-[NSDocumentController currentDocument] isn't KVOable (which is a bummer), but 
in theory you can register for notifications whenever the main window changes 
and you can look at currentDocument to see if it changed.

However, in practice (I was just testing this to be sure my advice was going to 
be good) and it seems that even though a document window is main and the 
application is active, -currentDocument can return nil in some cases. For 
example, activate another app and then click back onto a document window and 
applicationDidBecomeActive fires but currentDocument is nil, then 
windowDidBecomeMain fires but currentDocument is still nil. If you click on the 
app icon in the Dock the notifications are reversed and currentDocument isn't 
nil. 

So, you can't really use -currentDocument because it seems it's not always 
first to get the notification that the main window (and thus currentDocument) 
has changed.

But, if you just use the -object in the notification to windowDidBecomeMain: 
you're fine. So if you keep a reference to that window/document yourself and 
return it from your own currentDocument that'd work. You also need to watch 
windowWillResignMain: windowWillClose: and optionally(?) 
applicationDidBecomeActive:  (And actually, this is how Omni has been doing it 
for yars.)


--
Seth Willits

___

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


App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Martin Hewitson
Dear list,

I've just had an app update rejected due to an invalid app-sandbox entitlement.

In particular, the resolution center says:

This app incorrectly implements sandboxing, or it contains one or more 
entitlements with invalid values. Please review the included entitlements and 
sandboxing documentation and resolve this issues before resubmitting a new 
binary.

com.apple.security.scripting-targets: {u'com.apple.Mail': 
[u'com.apple.Mail.compose']}


And then lists possible errors. My entitlements file is below.

Has anyone else had this? Am I using this entitlement wrongly?

Many thanks,

Martin


?xml version=1.0 encoding=UTF-8?
!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN 
http://www.apple.com/DTDs/PropertyList-1.0.dtd;
plist version=1.0
dict
keycom.apple.security.app-sandbox/key
true/
keycom.apple.security.files.user-selected.read-write/key
true/
keycom.apple.security.print/key
true/
  keycom.apple.security.temporary-exception.apple-events/key
  array
stringcom.apple.mail/string
  /array
keycom.apple.security.scripting-targets/key
dict
keycom.apple.Mail/key
array
stringcom.apple.Mail.compose/string
/array
/dict
/dict
/plist





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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Sean McBride
On Thu, 25 Oct 2012 20:11:39 +0200, Martin Hewitson said:

  keycom.apple.security.temporary-exception.apple-events/key
  array
stringcom.apple.mail/string
  /array
   keycom.apple.security.scripting-targets/key
   dict
   keycom.apple.Mail/key

I think those are case-sensitive... com.apple.mail vs com.apple.Mail

Cheers,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada



___

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

XPC Service Lifecycle

2012-10-25 Thread douglas welton
Hi All,

Is there some way to configure my XPC Service helper to continue running  even 
after my main application has exited?  I've read thru the Creating XPC 
Services documentation several times, but the only statement I can find 
regrading XPC Service lifecycle says that the process is handled entirely by 
the system.  

Thanks,

douglas
___

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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Martin Hewitson
I forgot to mention: the entitlement is working as it is. Without it, I can't 
send mails from within the app. With the entitlement as written, I can send 
mails.

Wouldn't the mail sending fail (be blocked by app sandbox) if the entitlement 
was wrong? 

Thanks,

Martin

On Oct 25, 2012, at 08:27 PM, Sean McBride s...@rogue-research.com wrote:

 On Thu, 25 Oct 2012 20:11:39 +0200, Martin Hewitson said:
 
 keycom.apple.security.temporary-exception.apple-events/key
 array
   stringcom.apple.mail/string
 /array
  keycom.apple.security.scripting-targets/key
  dict
  keycom.apple.Mail/key
 
 I think those are case-sensitive... com.apple.mail vs com.apple.Mail
 
 Cheers,
 
 --
 
 Sean McBride, B. Eng s...@rogue-research.com
 Rogue Researchwww.rogue-research.com
 Mac Software Developer  Montréal, Québec, Canada
 
 



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


Determining which control has focus

2012-10-25 Thread Erik Stainsby
Hi list,

It seems to me this ought to be a trivial function of the OS, but I can't find 
anything that tells me how to go about this. 

I have a window which contains half a dozen text fields and three table views. 
I'd like to be able to use a single key-combo to trigger an insert into the 
current table. To make this work I need to be able to recognize each tableView 
distinctly, obviously. I also need to recognize if the current focus is not 
within one of the tables, which case I will handle differently.

I have thought of overriding - keyDown: but reading though the docs it looks 
like I would have to create a tag and reference a hand-built index associating 
the tags with the input controls, which seems insanely error prone and tedious. 
  

Is there something in the docs which I've missed? Any pointers please?

TIA,
Erik



___

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: Determining which control has focus

2012-10-25 Thread Lee Ann Rucker

On Oct 25, 2012, at 11:59 AM, Erik Stainsby wrote:

 Hi list,
 
 It seems to me this ought to be a trivial function of the OS, but I can't 
 find anything that tells me how to go about this. 
 
 I have a window which contains half a dozen text fields and three table 
 views. I'd like to be able to use a single key-combo to trigger an insert 
 into the current table. To make this work I need to be able to recognize each 
 tableView distinctly, obviously. I also need to recognize if the current 
 focus is not within one of the tables, which case I will handle differently.
 
 I have thought of overriding - keyDown: but reading though the docs it looks 
 like I would have to create a tag and reference a hand-built index 
 associating the tags with the input controls, which seems insanely error 
 prone and tedious.   
 
 Is there something in the docs which I've missed? Any pointers please?

Subclass NSTableView and implement keyDown: there. What I tend to do is add my 
own delegate method, something like

if (... check for keys the table view should handle, like delete...)
   [self interpretKeyEvents:...]
else if ([[self delegate] respondsToSelector:@selector(tableView:keyDown:)])
  [[self delegate] tableView:self keyDown:theEvent];
___

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: Determining which control has focus

2012-10-25 Thread Jens Alfke

On Oct 25, 2012, at 11:59 AM, Erik Stainsby erik.stain...@roaringsky.ca wrote:

 I have a window which contains half a dozen text fields and three table 
 views. I'd like to be able to use a single key-combo to trigger an insert 
 into the current table. To make this work I need to be able to recognize each 
 tableView distinctly, obviously. I also need to recognize if the current 
 focus is not within one of the tables, which case I will handle differently.

Call NSWindow.firstResponder to find which view has focus. (Although be 
careful, as the first responder may not be an NSView; for instance, it could be 
the NSWindow itself if no view has focus.) Then walk up the view hierarchy 
until you find a view you’re interested in.

If a text field has focus, though, you’ll find the firstResponder is actually 
an NSTextView which is the window’s shared fieldEditor. In that case, the 
delegate of that view will be the actual NSTextField that is considered to have 
focus.

—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: Determining which control has focus

2012-10-25 Thread Markus Spoettl

On 10/25/12 8:59 PM, Erik Stainsby wrote:

It seems to me this ought to be a trivial function of the OS, but I can't
find anything that tells me how to go about this.

I have a window which contains half a dozen text fields and three table
views. I'd like to be able to use a single key-combo to trigger an insert
into the current table. To make this work I need to be able to recognize each
tableView distinctly, obviously. I also need to recognize if the current
focus is not within one of the tables, which case I will handle differently.

I have thought of overriding - keyDown: but reading though the docs it looks
like I would have to create a tag and reference a hand-built index
associating the tags with the input controls, which seems insanely error
prone and tedious.

Is there something in the docs which I've missed? Any pointers please?


You want NSWindow's -firstResponder

Regards
Markus
--
__
Markus Spoettl
___

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: Determining which control has focus

2012-10-25 Thread Ken Thomases
On Oct 25, 2012, at 2:43 PM, Jens Alfke wrote:

 On Oct 25, 2012, at 11:59 AM, Erik Stainsby erik.stain...@roaringsky.ca 
 wrote:
 
 I have a window which contains half a dozen text fields and three table 
 views. I'd like to be able to use a single key-combo to trigger an insert 
 into the current table. To make this work I need to be able to recognize 
 each tableView distinctly, obviously. I also need to recognize if the 
 current focus is not within one of the tables, which case I will handle 
 differently.
 
 Call NSWindow.firstResponder to find which view has focus. (Although be 
 careful, as the first responder may not be an NSView; for instance, it could 
 be the NSWindow itself if no view has focus.) Then walk up the view hierarchy 
 until you find a view you’re interested in.
 
 If a text field has focus, though, you’ll find the firstResponder is actually 
 an NSTextView which is the window’s shared fieldEditor. In that case, the 
 delegate of that view will be the actual NSTextField that is considered to 
 have focus.

Another approach is to make the key-combo the key equivalent for an item in 
your app's menus.  Set the action method of that menu item to be something 
which is implemented by the table views which are supposed to support this 
feature.  Then, the action will be directed to the table view that's in the 
responder chain, if there is one; if there isn't, then the menu item will be 
automatically disabled.  Alternatively, if you want to do something else when 
no table view is focused, then make the window controller or your app delegate 
implement the action method to do that other thing.

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

Object not being drawn in Cmd + N window. Why?

2012-10-25 Thread Peter Teeson
Xcode 4.5.1 Lion 10.7.4
I have desktop Document project with a sub-class of NSView. Debug only version 
as of now.
The Window has 2 instances of this sub-class (basically squares that have 
gradients);
The only difference between the two instances are the start and stop mid points 
for the gradients.

When I Run it to debug, a Document window opens and behaves as I expect.
In particular both instances of the sub-class are drawn in the window.

The Problem:
But when I Cmd + N to get a new document then only one of the sub-class objects 
is drawn.
The one that is not drawn is the second instance I added yesterday.
As I said the only difference between the two instances is the value of an ivar 
(which I set 
appropriately in Document.m awakeFromNib.)

My efforts to track this down have failed and I lack understanding how this 
could happen.
After all they are using the same nib (xib). And indeed the value of each 
pointer to the instances
are not zero. And the various ivars are correctly initialized.

The Questions:
How could this happen? How can I try to track it down?

TIA  respect…
Peter

P.S. I first posted this to the Xcode list but was advised to post here instead.
___

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: Security-scoped bookmarks linked to code signing?

2012-10-25 Thread Alex Zavatone

On Oct 25, 2012, at 11:35 AM, Sean McBride wrote:

 On Thu, 25 Oct 2012 00:05:44 +0100, Mike Abdullah said:
 
 Is it possible http://www.mikeabdullah.net/nsurl-bookmark-error-
 handling.html is biting you?
 
 Interesting bug.  I wonder if everyone inside Apple is using ARC these days 
 and therefore expecting ptr-to-object variables to be nil-initialised 
 could explain how such a bug escaped.
 
 Cheers,

I think another person on has run across a case as well.

http://www.reddit.com/r/iOSProgramming/comments/120e2m/breaking_arc_retain_cycle_in_objectivec_blocks/
http://teohm.github.com/blog/2012/09/03/breaking-arc-retain-cycle-in-objective-c-blocks/

In any case, considering the huge benefit that ARC offers, for what I've done, 
it's been a pleasantly painless experience.

___

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: Security-scoped bookmarks linked to code signing?

2012-10-25 Thread Alex Zavatone

On Oct 25, 2012, at 11:35 AM, Sean McBride wrote:

 On Thu, 25 Oct 2012 00:05:44 +0100, Mike Abdullah said:
 
 Is it possible http://www.mikeabdullah.net/nsurl-bookmark-error-
 handling.html is biting you?
 
 Interesting bug.  I wonder if everyone inside Apple is using ARC these days 
 and therefore expecting ptr-to-object variables to be nil-initialised 
 could explain how such a bug escaped.
 
 Cheers,

I think another person on has run across a case as well.

http://www.reddit.com/r/iOSProgramming/comments/120e2m/breaking_arc_retain_cycle_in_objectivec_blocks/
http://teohm.github.com/blog/2012/09/03/breaking-arc-retain-cycle-in-objective-c-blocks/

In any case, considering the huge benefit that ARC offers, for what I've done, 
it's been a pleasantly painless experience.

___

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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Alex Zavatone
Does it still work if you correct the case of the M in com.apple.Mail?

On Oct 25, 2012, at 2:46 PM, Martin Hewitson wrote:

 I forgot to mention: the entitlement is working as it is. Without it, I can't 
 send mails from within the app. With the entitlement as written, I can send 
 mails.
 
 Wouldn't the mail sending fail (be blocked by app sandbox) if the entitlement 
 was wrong? 
 
 Thanks,
 
 Martin
 
 On Oct 25, 2012, at 08:27 PM, Sean McBride s...@rogue-research.com wrote:
 
 On Thu, 25 Oct 2012 20:11:39 +0200, Martin Hewitson said:
 
 keycom.apple.security.temporary-exception.apple-events/key
 array
  stringcom.apple.mail/string
 /array
 keycom.apple.security.scripting-targets/key
 dict
 keycom.apple.Mail/key
 
 I think those are case-sensitive... com.apple.mail vs com.apple.Mail
 
 Cheers,
 
 --
 
 Sean McBride, B. Eng s...@rogue-research.com
 Rogue Researchwww.rogue-research.com
 Mac Software Developer  Montréal, Québec, Canada
 
 
 
 ___
 
 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: Security-scoped bookmarks linked to code signing?

2012-10-25 Thread Mike Abdullah

On 25 Oct 2012, at 22:05, Alex Zavatone z...@mac.com wrote:

 
 On Oct 25, 2012, at 11:35 AM, Sean McBride wrote:
 
 On Thu, 25 Oct 2012 00:05:44 +0100, Mike Abdullah said:
 
 Is it possible http://www.mikeabdullah.net/nsurl-bookmark-error-
 handling.html is biting you?
 
 Interesting bug.  I wonder if everyone inside Apple is using ARC these days 
 and therefore expecting ptr-to-object variables to be nil-initialised 
 could explain how such a bug escaped.
 
 Cheers,
 
 I think another person on has run across a case as well.
 
 http://www.reddit.com/r/iOSProgramming/comments/120e2m/breaking_arc_retain_cycle_in_objectivec_blocks/
 http://teohm.github.com/blog/2012/09/03/breaking-arc-retain-cycle-in-objective-c-blocks/
 
 In any case, considering the huge benefit that ARC offers, for what I've 
 done, it's been a pleasantly painless experience.

I'm confused. Neither of your links seem to have anything to do with pointers 
and error handling.


___

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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Jayson Adams

On Oct 25, 2012, at 11:46 AM, Martin Hewitson wrote:

 I forgot to mention: the entitlement is working as it is. Without it, I can't 
 send mails from within the app. With the entitlement as written, I can send 
 mails.
 
 Wouldn't the mail sending fail (be blocked by app sandbox) if the entitlement 
 was wrong? 

The developer documentation says your app has to be sandboxed and there are 
such and so entitlements that will allow it to do certain things. But if those 
entitlements don't meet your needs, there are these special entitlements you 
can use (like com.apple.security.temporary-exception.apple-events, to send an 
Applescript to another application). Just add them to your app, and be sure to 
provide a detailed explanation of why you need to use them in your iTunes app 
submission.

The catch is that the lovely folks at the MAS will not actually approve any app 
that uses these special entitlements. And helpfully, as part of their 
condescending lecture to you, they will refer you to documentation that makes 
it sound like you can use special entitlements if you have a good reason.


Best,


__jayson

Circus Ponies NoteBook - Introducing An App That Boosts Your Productivity
at Work or School, So You Get The Grades, Raises and Promotions You Want.

www.circusponies.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: Object not being drawn in Cmd + N window. Why?

2012-10-25 Thread Mike Abdullah
Presumably your NSView subclass implements -drawRect:
Is this being called at all for you non-drawing view?
If it is being called, is there anything weird about the view or environment at 
the time?
What triggers do you have to cause the view to be redrawn?

On 25 Oct 2012, at 21:16, Peter Teeson ptee...@me.com wrote:

 Xcode 4.5.1 Lion 10.7.4
 I have desktop Document project with a sub-class of NSView. Debug only 
 version as of now.
 The Window has 2 instances of this sub-class (basically squares that have 
 gradients);
 The only difference between the two instances are the start and stop mid 
 points for the gradients.
 
 When I Run it to debug, a Document window opens and behaves as I expect.
 In particular both instances of the sub-class are drawn in the window.
 
 The Problem:
 But when I Cmd + N to get a new document then only one of the sub-class 
 objects is drawn.
 The one that is not drawn is the second instance I added yesterday.
 As I said the only difference between the two instances is the value of an 
 ivar (which I set 
 appropriately in Document.m awakeFromNib.)
 
 My efforts to track this down have failed and I lack understanding how this 
 could happen.
 After all they are using the same nib (xib). And indeed the value of each 
 pointer to the instances
 are not zero. And the various ivars are correctly initialized.
 
 The Questions:
 How could this happen? How can I try to track it down?
 
 TIA  respect…
 Peter
 
 P.S. I first posted this to the Xcode list but was advised to post here 
 instead.
 ___
 
 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/cocoadev%40mikeabdullah.net
 
 This email sent to cocoa...@mikeabdullah.net


___

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: Why does a custom CALayer property work differently from a standard one?

2012-10-25 Thread Corbin Dunn

On Oct 25, 2012, at 4:38 AM, Roland King r...@rols.org wrote:

 Ive been struggling with this for a couple of days now. 
 
 I have a custom CALayer with a custom property, percentage. It's @dynamic and 
 set up to cause a redraw. 
 
 +(BOOL)needsDisplayForKey:(NSString *)key
 {
   return [ @percentage isEqualToString:key ];
 }
 
 I return CABasicAnimations for percentage and for position with the code at 
 the bottom in actionForKey:. The position one just makes the position change 
 really slowly. 
 
 For position all I have to do is make a CABasicAnimation, set the duration 
 and nothing else and return it, the position animates smoothly from where it 
 was to where it's going. 
 
 If I do the same for 'percentage', just return a CABasicAnimation with the 
 duration set, it doesn't animate, it just goes instantly to the final value. 
 For this one I have to explicitly set the 'fromValue' to the current value in 
 the presentation layer, leaving it nil just doesn't do the job. It finds the 
 'toValue' itself, but I have to tell it where it's coming from. 
 
 Why do they work differently? This prevents me from using 
 addAnimation:forKey: for 'percentage' because each one is different, 
 depending what the current value of percentage is. 
 
 
 -(idCAAction)actionForKey:(NSString *)event
 {
   
   if( [ event isEqualToString:@position ] )
   {
   CABasicAnimation *animation = [ CABasicAnimation 
 animationWithKeyPath:@position ];
   animation.duration = 7.f;
   return animation;

Technically, the above code is incorrect. You have to set one of the values, 
per the header comment.


/* The objects defining the property values being interpolated between.
 * All are optional, and no more than two should be non-nil. The object
 * type should match the type of the property being animated (using the
 * standard rules described in CALayer.h). The supported modes of
 * animation are:
 *
 * - both `fromValue' and `toValue' non-nil. Interpolates between
 * `fromValue' and `toValue'.
 *
 * - `fromValue' and `byValue' non-nil. Interpolates between
 * `fromValue' and `fromValue' plus `byValue'.
 *
 * - `byValue' and `toValue' non-nil. Interpolates between `toValue'
 * minus `byValue' and `toValue'.
 *
 * - `fromValue' non-nil. Interpolates between `fromValue' and the
 * current presentation value of the property.
 *
 * - `toValue' non-nil. Interpolates between the layer's current value
 * of the property in the render tree and `toValue'.
 *
 * - `byValue' non-nil. Interpolates between the layer's current value
 * of the property in the render tree and that plus `byValue'. */


corbin


   }

   
   if( [ event isEqualToString:@percentage ] )
   {
   CABasicAnimation *animation = [ CABasicAnimation 
 animationWithKeyPath:@percentage ];
   animation.duration = 2.f;
   animation.fromValue = [ self.presentationLayer 
 valueForKey:event ];
   return animation;
   }
   
   return [ super actionForKey:event ];;
 }
 ___
 
 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/corbind%40apple.com
 
 This email sent to corb...@apple.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: Binding InfoPanel to currentDocument

2012-10-25 Thread Kyle Sluder
On Thu, Oct 25, 2012, at 09:42 AM, Seth Willits wrote:
 
 But, if you just use the -object in the notification to
 windowDidBecomeMain: you're fine. So if you keep a reference to that
 window/document yourself and return it from your own currentDocument
 that'd work. You also need to watch windowWillResignMain:
 windowWillClose: and optionally(?) applicationDidBecomeActive:  (And
 actually, this is how Omni has been doing it for yars.)

NSWindow has a -document accessor, so you don't need to override
-currentDocument.

But yes, the gist of how OmniInspector works is that we listen for
window did become/resign main notifications and prompt our inspectors to
update themselves by traversing the responder chain of the main window.

--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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Kyle Sluder
On Thu, Oct 25, 2012, at 02:06 PM, Alex Zavatone wrote:
 Does it still work if you correct the case of the M in com.apple.Mail?

Yes, do check this. IIRC we got bitten recently by a case-sensitivity
issue with special entitlements.

This problem extends beyond MAS submission; there are places in the
system frameworks that squish bundle identifiers down to all-lowercase
and then do case-sensitive comparisons.

--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


Scalability of CALayers

2012-10-25 Thread Graham Cox

I'm wondering how scalable the Core Animation layer model is.

When a region of a layer-backed view is updated, does the CA system have a way 
to quickly identify layers for update, e.g. some sort of spatial hash, or does 
it simply traverse the whole tree looking for intersections? If the latter I 
would expect that not to scale so well to thousands of layers.

Some sort of indication about this would be a key decision point about whether 
to base a substantial update of DrawKit on CALayer or whether to stick to 
rolling my own. There are lots of compelling advantages to CALayer, but 
scalability is vital.

--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: Why does a custom CALayer property work differently from a standard one?

2012-10-25 Thread Roland King

On 26 Oct, 2012, at 5:56 AM, Corbin Dunn corb...@apple.com wrote:

 
 Technically, the above code is incorrect. You have to set one of the values, 
 per the header comment.
 
 
 /* The objects defining the property values being interpolated between.
 * All are optional, and no more than two should be non-nil. The object
 * type should match the type of the property being animated (using the
 * standard rules described in CALayer.h). The supported modes of
 * animation are:
 *
 * - both `fromValue' and `toValue' non-nil. Interpolates between
 * `fromValue' and `toValue'.
 *
 * - `fromValue' and `byValue' non-nil. Interpolates between
 * `fromValue' and `fromValue' plus `byValue'.
 *
 * - `byValue' and `toValue' non-nil. Interpolates between `toValue'
 * minus `byValue' and `toValue'.
 *
 * - `fromValue' non-nil. Interpolates between `fromValue' and the
 * current presentation value of the property.
 *
 * - `toValue' non-nil. Interpolates between the layer's current value
 * of the property in the render tree and `toValue'.
 *
 * - `byValue' non-nil. Interpolates between the layer's current value
 * of the property in the render tree and that plus `byValue'. */
 

That's interesting for a couple of reasons. The first line says that all 
properties are optional. Also, I didn't use the header, I used the 
documentation which has this extra line in it over and above the ones above

All properties are nil. Interpolates between the previous value of keyPath in 
the target layer’s presentation layer and the current value of keyPath in the 
target layer’s presentation layer.

and was very careful to make sure I used the latest iOS docs not the OSX ones, 
I've made that mistake before. This is what it actually does for the position 
property

Finally, were it true, it would make the class of restricted use, you couldn't 
use setAnimation:forKey with it if you wanted to animate between the previous 
and current value of a property, which is probably the most usual use case. 

OK nobody knows, my OCD has kicked in on this one so I'll burn a DTS incident 
on it, I might learn something. 


___

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: Binding InfoPanel to currentDocument

2012-10-25 Thread Seth Willits
On Oct 25, 2012, at 3:24 PM, Kyle Sluder wrote:

 On Thu, Oct 25, 2012, at 09:42 AM, Seth Willits wrote:
 
 But, if you just use the -object in the notification to
 windowDidBecomeMain: you're fine. So if you keep a reference to that
 window/document yourself and return it from your own currentDocument
 that'd work. You also need to watch windowWillResignMain:
 windowWillClose: and optionally(?) applicationDidBecomeActive:  (And
 actually, this is how Omni has been doing it for yars.)
 
 NSWindow has a -document accessor, so you don't need to override
 -currentDocument.
 
 But yes, the gist of how OmniInspector works is that we listen for
 window did become/resign main notifications and prompt our inspectors to
 update themselves by traversing the responder chain of the main window.


I was not suggesting to override -[NSDocumentController currentDocument].  He 
has -[AppDelegate currentDocument].


--
Seth Willits




___

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: Object not being drawn in Cmd + N window. Why?

2012-10-25 Thread Peter Teeson
On 2012-10-25, at 5:40 PM, Mike Abdullah wrote:
 Presumably your NSView subclass implements -drawRect:
Yes my sub-class does implement -drawRect

 Is this being called at all for you non-drawing view?
Yes. Let's refer to the sub-class instances as 1st and 2nd
1st is the one I created first using IB (dragging Object and making the class 
my sub-class view)
2nd is the one I created yesterday the same way.

When the app is first launched a window is created and drawn correctly. The 
sequence is as follows:
In my sub-class these methods are called in this order 
2nd -initWithFrame  (which has [self setNeedsDisplay:YES]; as the last 
statement.
1st -initWithFrame
1st -drawRect
2nd -drawRect

Now if I Cmd+N or use the File New menu item a second window is created and the 
sequence is the same.
Except that the 2nd instance is not drawn in the window (content area).
This is true thereafter for every New invocation.

 If it is being called, is there anything weird about the view or environment 
 at the time?
Well there must be but this is pretty vanilla stuff. 
The MainMenu.nib is exactly as is from the template.
The Document.nib has these two sub-class instances plus 3 colorWells with 
labels.
These are hooked up to set the Start  Stop gradient colours and the interior 
face colour of each instance.
This all works for the initial window.

 What triggers do you have to cause the view to be redrawn?
Other than the above initializations only clicking on the colorWells.

BUT I just found something bizarre thanks to your stimulation.
Consider the following:
Launch the app - first window appears.
Click on colorWell and choose a colour and click.
The colour is effected on both instances (1st and 2nd)

Next do a File/New and a second window appears but without 2nd instance drawn.
In second window click on colorWell and choose a colour and click.
THIS is effected on the 1st instance in the second window BUT the 2nd instance 
in FIRST window.

How can this be? All I did was use IB to make a 2nd instance of my sub-class 
and positioned it.
Where do I go from here?

My code in Document.h/.m 
@property (weak) IBOutlet MakeIcon *normalView;
@property (weak) IBOutlet MakeIcon *pushedView; 
- (IBAction)startColor:(NSColorWell *)sender;

-(void) startColor:(NSColorWell *)sender{
[normalView changeStartColor:startColorWell];
[pushedView changeStartColor:startColorWell];
}

My code in the sub-class .m
- (void)setStartColor:color{
startColor = color;
[self setNeedsDisplay:YES];
}
-(void)changeStartColor:(NSColorWell *)sender{
[self setStartColor:[sender color]];
}


 On 25 Oct 2012, at 21:16, Peter Teeson ptee...@me.com wrote:
 Xcode 4.5.1 Lion 10.7.4
 I have desktop Document project with a sub-class of NSView. Debug only 
 version as of now.
 The Window has 2 instances of this sub-class (basically squares that have 
 gradients);
 The only difference between the two instances are the start and stop mid 
 points for the gradients.
 
 When I Run it to debug, a Document window opens and behaves as I expect.
 In particular both instances of the sub-class are drawn in the window.
 
 The Problem:
 But when I Cmd + N to get a new document then only one of the sub-class 
 objects is drawn.
 The one that is not drawn is the second instance I added yesterday.
 As I said the only difference between the two instances is the value of an 
 ivar (which I set 
 appropriately in Document.m awakeFromNib.)
 
 My efforts to track this down have failed and I lack understanding how this 
 could happen.
 After all they are using the same nib (xib). And indeed the value of each 
 pointer to the instances
 are not zero. And the various ivars are correctly initialized.
 
 The Questions:
 How could this happen? How can I try to track it down?
 
 TIA  respect…
 Peter
 
 P.S. I first posted this to the Xcode list but was advised to post here 
 instead.
___

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: Object not being drawn in Cmd + N window. Why?

2012-10-25 Thread Quincey Morris
On Oct 25, 2012, at 18:09 , Peter Teeson ptee...@me.com wrote:

 Where do I go from here?

You're trying to solve too much at one time. The issue is the apparent 
non-appearance of one of the views, so the issue of where the setMyColor action 
goes is merely a distraction. 'initWithFrame', 'awakeFromNib' and 'drawRect:' 
are also distractions, though they may become relevant once you learn where the 
2nd view went.

In the ordinary course of events, there are three straightforward reasons why a 
view might not appear:

1. It's hidden. (Likely not a factor in your case, but you shouldn't make 
assumptions.)

2. It's got the wrong frame, so it's outside the visible rect of the window or 
an enclosing view.

3. It's underneath something opaque, such as the other custom view.

It's absolutely useless *reasoning* about these matters (reasoning has already 
told you both views *should* be visible). You need to *examine* their state, 
preferably in the debugger. To do this, you have to make sure you don't waste 
your time watching what happens at initialization or awakeFromNib time, because 
the window and view state can change later. You need to examine the state at 
the time you see the window's faulty appearance.

One way to do this is to set a breakpoint on one of your menu item action 
methods, and when your window is finished appearing on screen, initiate the 
menu action and trigger the breakpoint. (If this is an action method in your 
document subclass, so much the better, because you'll have the 2 ivars easily 
available to you.) Then check:

-- the ivar values, to make sure both views still exist

-- the isHidden property of both views

-- the frame of both views, making sure you don't mistake the coordinate 
systems you're dealing with

-- the view hierarchy (superviews), to check that both views actually have a 
common ancestor, and that there's no other view in the way

My guess is that the problem is something like an inadvertent use of 
auto-layout, so that although you may have placed the views in IB they actually 
are configured to center themselves in their superview, meaning one gets moved 
on top of the other. (This could explain the bizarre color behavior you noted 
in your most recent post. It could also perhaps explain why the results were 
different in your old state-restored window vs. a window created with 
Command-N.)

___

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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Martin Hewitson
It does still work with lower-case 'mail'. So, I will just resubmit with a new 
entitlements file and see what happens. When I asked the MAS for clarification 
regarding what was actually wrong with my entitlements file, I was told to 
contact DTS :/

Thanks all!

Martin

On Oct 26, 2012, at 12:27 AM, Kyle Sluder k...@ksluder.com wrote:

 On Thu, Oct 25, 2012, at 02:06 PM, Alex Zavatone wrote:
 Does it still work if you correct the case of the M in com.apple.Mail?
 
 Yes, do check this. IIRC we got bitten recently by a case-sensitivity
 issue with special entitlements.
 
 This problem extends beyond MAS submission; there are places in the
 system frameworks that squish bundle identifiers down to all-lowercase
 and then do case-sensitive comparisons.
 
 --Kyle Sluder







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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Kyle Sluder
This left hand/right hand bullshit needs to be fixed yesterday. If MAS gives 
you a rejection, they need to provide the technical staff who can answer 
questions about that rejection. In my experience, DTS is unprepared to address 
MAS policy issues. MAS support doesn't have to write your code for you, but 
they need to provide answers about the material you provided them that they 
deemed spun satisfactory.

I suggest sending feedback to Dev Programs.

--Kyle Sluder

On Oct 25, 2012, at 8:53 PM, Martin Hewitson martin.hewit...@aei.mpg.de wrote:

 It does still work with lower-case 'mail'. So, I will just resubmit with a 
 new entitlements file and see what happens. When I asked the MAS for 
 clarification regarding what was actually wrong with my entitlements file, I 
 was told to contact DTS :/
 
 Thanks all!
 
 Martin
 
 On Oct 26, 2012, at 12:27 AM, Kyle Sluder k...@ksluder.com wrote:
 
 On Thu, Oct 25, 2012, at 02:06 PM, Alex Zavatone wrote:
 Does it still work if you correct the case of the M in com.apple.Mail?
 
 Yes, do check this. IIRC we got bitten recently by a case-sensitivity
 issue with special entitlements.
 
 This problem extends beyond MAS submission; there are places in the
 system frameworks that squish bundle identifiers down to all-lowercase
 and then do case-sensitive comparisons.
 
 --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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Graham Cox

On 26/10/2012, at 8:24 AM, Jayson Adams jay...@circusponies.com wrote:

 The catch is that the lovely folks at the MAS will not actually approve any 
 app that uses these special entitlements. And helpfully, as part of their 
 condescending lecture to you, they will refer you to documentation that makes 
 it sound like you can use special entitlements if you have a good reason.


The communication between the MAS staff and developers is absolutely shocking. 
I would go as far as to say it's the worst I've experienced from Apple since I 
first had dealings with them in the mid 80s. They come across as arrogant, 
jobsworths, pedantic and robotic, with no interest in helping developers 
solve problems.

This may not be the place to make this point, but there are no proper channels 
available to complain; that is part of the problem. Something needs to be done 
as it seems to be seriously souring developer relations. I'm certain my own 
experiences are not an isolated case, but unless we share our experiences about 
this, the scale of the problem can't be known.

--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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Seth Willits
On Oct 25, 2012, at 9:04 PM, Graham Cox wrote:

 The communication between the MAS staff and developers is absolutely 
 shocking. I would go as far as to say it's the worst I've experienced from 
 Apple since I first had dealings with them in the mid 80s. They come across 
 as arrogant, jobsworths, pedantic and robotic, with no interest in helping 
 developers solve problems.

A-freaking-men.


I'm not still bitter at all about them rejecting my app (after it had been 
shipping for more than a month). When I finally got a human on the phone (I 
am not convinced he actually had a soul), he pretty much accused me of copying 
Apple (nevermind the facts), and hung up on me when I asked to speak to a 
manager. Unbelievable.

Sorry. I'm not one to complain in public, but good grief… There's got to be a 
way to fix this system.


--
Seth Willits

___

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

Keyboard shortcut for menu item with submenu?

2012-10-25 Thread Jerry Krinock
Something that has irked me about Cocoa for years…

Is there any way to assign a keyboard shortcut to a menu item that has a 
submenu?  The idea is that you hit the keyboard shortcut to select the submenu, 
then use the arrow keys to navigate through the submenu.  The submenu may be 
populated dynamically.

Thanks,

Jerry Krinock
___

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: App rejection due to app-sandboxing invalid entitlement

2012-10-25 Thread Martin Hewitson

On Oct 26, 2012, at 6:04 AM, Graham Cox graham@bigpond.com wrote:

 
 On 26/10/2012, at 8:24 AM, Jayson Adams jay...@circusponies.com wrote:
 
 The catch is that the lovely folks at the MAS will not actually approve any 
 app that uses these special entitlements. And helpfully, as part of their 
 condescending lecture to you, they will refer you to documentation that 
 makes it sound like you can use special entitlements if you have a good 
 reason.
 
 
 The communication between the MAS staff and developers is absolutely 
 shocking. I would go as far as to say it's the worst I've experienced from 
 Apple since I first had dealings with them in the mid 80s. They come across 
 as arrogant, jobsworths, pedantic and robotic, with no interest in helping 
 developers solve problems.

Can't agree more. Though it also seems to be somewhat inconsistent. I had 
another app rejected a couple of months ago for different sandbox issues, so I 
asked questions via the resolution center and received useful answers. In fact, 
the conversation went on for a few posts back and forth. But in general, the 
feedback almost feels entirely automated and close to useless.

Martin


 
 This may not be the place to make this point, but there are no proper 
 channels available to complain; that is part of the problem. Something needs 
 to be done as it seems to be seriously souring developer relations. I'm 
 certain my own experiences are not an isolated case, but unless we share our 
 experiences about this, the scale of the problem can't be known.
 
 --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/martin.hewitson%40aei.mpg.de
 
 This email sent to martin.hewit...@aei.mpg.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