Re: How to sandbox an included framework

2012-08-16 Thread Antonio Nunes
On 16 Aug 2012, at 07:34, Mike Abdullah  wrote:

> 
> On 15 Aug 2012, at 18:48, Antonio Nunes  wrote:
> 
>> After a number of successful submissions of my sandboxed app tot he App 
>> Store, today Apple decided to reject my app because one of the 3rd party 
>> frameworks it includes and links against is not sandboxed. I don't recall 
>> hearing about sandboxing frameworks separately. I know they need to be 
>> codesigned, and this one is.
>> 
>> Searching through the docs and online doesn't turn up any info about 
>> framework sandboxing.
>> 
>> Can anyone point me to documentation or a tutorial on how to sandbox my 
>> third party framework. (I do have access to its source code, if necessary, 
>> but I did not see any obvious option to sandbox the framework when I opened 
>> and examined the framework's project in Xcode.
> 
> Are you sure this is really a framework? Frameworks load as part of your 
> process and so live within your app's sandbox. Perhaps you're seeing one of 
> the following:
> 
> - the "framework" is, or includes, another executable which it launches to 
> perform a task
> - the framework is trying to do something blocked by the sandbox.

Turns out the rejection was in error. A shame I was forced to bother DTS to get 
this resolved, and to lose precious time after waiting a full two weeks after 
submission for the app to be taken into review in the first place. I hope 
nothing else comes up, as the update has still not been approved. Thanks for 
trying to help, Mike.

-António

---
And you would accept the seasons of your
heart, even as you have always accepted
the seasons that pass over your field.

--Kahlil Gibran
---

___

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

debugging spinning beachball problem

2012-08-16 Thread Martin Hewitson
Dear list,

I've received a report from a single user saying that my app (TeXnicle) is 
sometimes freezing for a few seconds. So I got the user to take a Process 
Sample from Activity Monitor to try to figure out what's going on. 
Unfortunately it hasn't helped me very much.  So I was wondering if anyone on 
this list can make more sense of the process sample than me, or can offer any 
other advise as to how to debug this problem. An fraction of an example of the 
(very) long process sample is attached. Essentially the only mention of my app 
is in lines like:

453 ???  (in TeXnicle)  load address 0x1 + 0xbe651  [0x1000be651]

What does this mean?

Best wishes,

Martin



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: Sending keyboard events with unicode strings causes Pages/Keynote/Numbers to hang

2012-08-16 Thread Huy Phan

Hi Ken,


Above you mention 2-byte unicode characters and here you mention 1-byte unicode 
characters.  What precisely do you mean?  A "UniChar" is inherently 2-bytes.  
So the first mention (2-byte) seems redundant and the second is just wrong.


Sorry for being unclear in my question, I indeed should not explain it 
that way. When I said "unicodeString contains only 1-byte unicode 
character" it means Unichar from range 0x to 0x00FF.

  Is there any chance you're putting an incomplete Unicode character, an 
unpaired surrogate, in your event?
I can confirm this is not the case as I had tried to hard code some 
valid Unichars (e.g. 0x20AC for €  character) to test. It works fine on 
other applications, but not with iWork.


--
--huy



Ken Thomases 
13 August, 2012 10:38 PM
On Aug 11, 2012, at 3:39 PM, Huy Phan wrote:


Every time I send keyboard events with unicode strings contain 2-byte unicode 
characters, …



CGEventKeyboardSetUnicodeString(keyEventDown, 1, unicodeString);
CGEventKeyboardSetUnicodeString(keyEventUp, 1, unicodeString);



Pages doesn't hang if unicodeString contains only 1-byte unicode character.


Above you mention 2-byte unicode characters and here you mention 1-byte unicode 
characters.  What precisely do you mean?  A "UniChar" is inherently 2-bytes.  
So the first mention (2-byte) seems redundant and the second is just wrong.

Also, note that there are some Unicode characters which can't be represented by a single UniChar.  
Apple's UniChar and unichar types, the basis of CFString and NSString, are actually UTF-16 
"code units", not really Unicode characters or "code points".  These terms have 
precise definitions in the Unicode standard, with which Apple's terminology does not conform.  
Anyway, some Unicode characters will require two UTF-16 code units (a.k.a. UniChar values) to 
represent completely.  These are surrogate pairs.  Is there any chance you're putting an incomplete 
Unicode character, an unpaired surrogate, in your event?

Regards,
Ken

Huy Phan 
12 August, 2012 4:39 AM
Hi all,

I'm having this weird issue after upgrading iWork on Mountain Lion.
I wrote a small app to monitor and modify user's keystrokes, it works 
fine with other applications except latest version of Pages. Every 
time I send keyboard events with unicode strings contain 2-byte 
unicode characters, Pages will hang.


My code to simulate keystrokes is just simple like this:

CGEventRef KeyHandler(CGEventTapProxy proxy, CGEventType type, 
CGEventRef event, void *refcon)

{

..

CGEventRef keyEventDown = CGEventCreateKeyboardEvent( NULL, 1, true);
CGEventRef keyEventUp = CGEventCreateKeyboardEvent(NULL, 1, false);

CGEventKeyboardSetUnicodeString(keyEventDown, 1, unicodeString);
CGEventKeyboardSetUnicodeString(keyEventUp, 1, unicodeString);

CGEventTapPostEvent(proxy, keyEventDown);
CGEventTapPostEvent(proxy, keyEventUp);

CFRelease(keyEventDown);
CFRelease(keyEventUp);

..

}

Pages doesn't hang if unicodeString contains only 1-byte unicode 
character.


I used gdb to debug Pages and noticed 2 infinite loops at that time, 
not sure if it's related to this issue.


0x91f7528c in -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] () which waited for 
event with mask 0x
0x91f7528c in -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] () which waited for 
event with mask 0x0400



Does anybody know why this is happening ? Numbers and Keynote also 
have the same issue.


Thanks,

___

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

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

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

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

Re: Perplexity with X3D and XML

2012-08-16 Thread Christopher Henrich

On Aug 16, 2012, at 12:55 AM, Jens Alfke wrote:

> 
> On Aug 15, 2012, at 7:47 PM, Christopher Henrich  
> wrote:
> 
>> The specification of the XML form for X3D requires that an MFString be 
>> enclosed in single quotes, and the enclosed strings must be enclosed in 
>> double quotes. Example: ' "alpha" "bravo" '.
> 
> Huh? Single vs double quotes for delimiting attributes are a detail of the 
> way the XML is encoded to text; they have nothing to do with the schema of 
> the data in the file. You might as well say that X3D has to be displayed in 
> the Courier font to be valid. :)
> 
> It _is_ reasonable for the spec to say that these attributes' values have to 
> contain double-quoted strings. But how those attributes are encoded into 
> syntactically correct XML markup is irrelevant. The encoder could use 
> single-quotes to delimit the attributes, or it could use double quotes and 
> then %-escape the inner double-quotes. The two are interchangeable from the 
> point of view of any proper XML parser.

Well, I agree. I just hope the X3D community cares about proper XML parsing.

Christopher Henrich
chenr...@monmouth.com
mathinteract.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: help indexer or hiutil help

2012-08-16 Thread Shane
On Fri, Aug 10, 2012 at 4:12 PM, Shane
 wrote:
> I'm trying to use Help Indexer.app after a long while and a few
> upgrades of a working help project. When trying to select the
> MyHelp.help bundle, I can't because its grayed out. Any ideas?
>
> But I can get into the bundle on the command line, so I go into the
> dirs and try to use hiutil as shown in the man page (-Caf), and then
> follow up with hiutil -Af, but it keeps returning null.
>
> $ hiutil -Caf ./MyHelp.index . (tried current dir, top level dir, etc...)
> $ hiutil -Af ./MyHelp.index
> (null)
>
> My structure looks like this.
> MyHelp.help/
>`- Contents/
> |- Info.plist
> `- Resources
> |- English.proj\
> |  |- MyHelp.html
> |  |- MyHelp.helpindex
> |  |- InfoPlist.strings
> |  |- ...
> |
> `- Shared
>
> Any help much appreciated.

Shameless bump. Anyone?
___

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: initial value of an NSPopupButton shows with delay

2012-08-16 Thread Peter Ammon
Hi Koen,

Is your window set to be visible at launch (i.e. in IB)? Try making it not 
visible at launch, and then ordering it onscreen after the nib is loaded. That 
should allow all the awakeFromNib methods to run before the window appears.

Hope that helps,
-Peter

On Aug 16, 2012, at 3:53 PM, Koen van der Drift  
wrote:

> I have an NSPopupButton that is bound to an NSArrayController in IB as 
> follows:
> 
> Content -> ac.arrangedObjects
> ContentValue -> ac.arrangedObjects.name
> SelectedObject -> File's Owner.self.currentObject
> 
> The ac is bound to entities that are in my CD store (which are created when 
> the app starts up for the first time, following the code example for the 
> "Type" entity in the Grokking Recipes app from Zarra's Core Data book). I am 
> using the SelectedObject binding so that when the popup is changed, I 
> immediately get the selectedobject from the ac. This works like a charm.
> 
> Now when the view first appears, I'd like to set the NSPopupButton to a 
> default value, so I added this to awakeFromNib of my NSViewController to get 
> the entity with the name "defaultName":
> 
>NSManagedObjectContext  *moc = [[NSApp delegate] managedObjectContext];
>NSArray *results = [moc fetchObjectsForEntityName: @"MyObject" 
> withPredicateString: @"name == %@", @"defaultName"];
> 
> (that last line is based on this article: 
> http://cocoawithlove.com/2008/03/core-data-one-line-fetch.html)
> 
> then I set the currentObject to that entity:
>self.currentObject = [results lastObject];
> 
> It works, I get the entity with defaultName as the initial value in the 
> popup, but for a split second, I first see something else, as if there is 
> some delay before the popup is set to the correct item.
> 
> Is this delay because I do a fetch in my CD store?   If so is there a faster 
> way to do this, to prevent the delay?
> 
> - Koen.



___

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: launch application de-elevated

2012-08-16 Thread danchik
ahh, bummer...  By chance, do you have a link that we can reference here for 
where Apple sais that?


Thank You

- Original Message - 
From: "Kyle Sluder" 

To: "danchik" ; 
Sent: Thursday, August 16, 2012 3:37 PM
Subject: Re: launch application de-elevated



On Thu, Aug 16, 2012, at 02:42 PM, danchik wrote:

Hello, I have a postinstall script that starts a program to do some final
configurations (the installer was elevated with password during the
install), after all is done, the program starts the installed application
via:

[[NSWorkspace sharedWorkspace] launchApplication:appPath]


There's a reason Apple says "don't launch apps as part of the
Installer."

If the user wants to run your app after installing it, they will run it
themselves.

--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: Displaying a sheet immediately after a window is opened

2012-08-16 Thread Rick Mann
I'm surprised this is so hard to do.

-- 
Rick



On Aug 16, 2012, at 16:10 , Laurent Daudelin  wrote:

> On Aug 16, 2012, at 15:51, Rick Mann  wrote:
> 
>> On Aug 16, 2012, at 7:08 , Dmitriy Balakirev  
>> wrote:
>> 
>>> I use undocumented NSWindowDidOrderOnScreenAndFinishAnimatingNotification.
>>> Be careful when handling it. It seems firing more then one time, and 
>>> sometimes from thread other then main. 
>> 
>> Yeah, that was suggested to me by someone else, and I noticed it comes in 
>> more than once, too. I'll check the thread, though.
>> 
>> I'm a little worried that will affect my ability to go into the App Store.
> 
> Based on my experience, they will certainly reject it if they can find the 
> symbol.
> 
> -Laurent.
> -- 
> Laurent Daudelin
> AIM/iChat/Skype:LaurentDaudelin   
> http://www.nemesys-soft.com/
> Logiciels Nemesys Software
> laur...@nemesys-soft.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: Displaying a sheet immediately after a window is opened

2012-08-16 Thread Laurent Daudelin
On Aug 16, 2012, at 15:51, Rick Mann  wrote:

> On Aug 16, 2012, at 7:08 , Dmitriy Balakirev  
> wrote:
> 
>> I use undocumented NSWindowDidOrderOnScreenAndFinishAnimatingNotification.
>> Be careful when handling it. It seems firing more then one time, and 
>> sometimes from thread other then main. 
> 
> Yeah, that was suggested to me by someone else, and I noticed it comes in 
> more than once, too. I'll check the thread, though.
> 
> I'm a little worried that will affect my ability to go into the App Store.

Based on my experience, they will certainly reject it if they can find the 
symbol.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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


initial value of an NSPopupButton shows with delay

2012-08-16 Thread Koen van der Drift
I have an NSPopupButton that is bound to an NSArrayController in IB as follows:

Content -> ac.arrangedObjects
ContentValue -> ac.arrangedObjects.name
SelectedObject -> File's Owner.self.currentObject

The ac is bound to entities that are in my CD store (which are created when the 
app starts up for the first time, following the code example for the "Type" 
entity in the Grokking Recipes app from Zarra's Core Data book). I am using the 
SelectedObject binding so that when the popup is changed, I immediately get the 
selectedobject from the ac. This works like a charm.

Now when the view first appears, I'd like to set the NSPopupButton to a default 
value, so I added this to awakeFromNib of my NSViewController to get the entity 
with the name "defaultName":

NSManagedObjectContext  *moc = [[NSApp delegate] managedObjectContext];
NSArray *results = [moc fetchObjectsForEntityName: @"MyObject" 
withPredicateString: @"name == %@", @"defaultName"];

(that last line is based on this article: 
http://cocoawithlove.com/2008/03/core-data-one-line-fetch.html)

then I set the currentObject to that entity:
self.currentObject = [results lastObject];

It works, I get the entity with defaultName as the initial value in the popup, 
but for a split second, I first see something else, as if there is some delay 
before the popup is set to the correct item.

Is this delay because I do a fetch in my CD store?   If so is there a faster 
way to do this, to prevent the delay?

- Koen.




___

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: Displaying a sheet immediately after a window is opened

2012-08-16 Thread Rick Mann
On Aug 16, 2012, at 7:08 , Dmitriy Balakirev  
wrote:

> I use undocumented NSWindowDidOrderOnScreenAndFinishAnimatingNotification.
> Be careful when handling it. It seems firing more then one time, and 
> sometimes from thread other then main. 

Yeah, that was suggested to me by someone else, and I noticed it comes in more 
than once, too. I'll check the thread, though.

I'm a little worried that will affect my ability to go into the App Store.

> 
> 16.08.2012, в 7:02, Rick Mann  написал(а):
> 
>> After googling, I found that in -[NSDocument windowControllerDidLoadNib], I 
>> had to begin my sheet by calling performSelector on the main thread 
>> (actually I scheduled a block operation). This is kinda gross, but seems to 
>> work.
>> 
>> Unfortunately, the result is that the main window animates opening 
>> simultaneously with the sheet animating open.
>> 
>> I'd really like the sheet to begin its animation after the main window 
>> finishes its own. Is there a "right" place to do this?
>> 
>> -- 
>> Rick
>> 
>> 
>> 
>> 
>> ___
>> 
>> 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/dmitriy.balakirev%40gmail.com
>> 
>> This email sent to dmitriy.balaki...@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: launch application de-elevated

2012-08-16 Thread Kyle Sluder
On Thu, Aug 16, 2012, at 02:42 PM, danchik wrote:
> Hello, I have a postinstall script that starts a program to do some final 
> configurations (the installer was elevated with password during the 
> install), after all is done, the program starts the installed application 
> via:
> 
> [[NSWorkspace sharedWorkspace] launchApplication:appPath]

There's a reason Apple says "don't launch apps as part of the
Installer."

If the user wants to run your app after installing it, they will run it
themselves.

--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: __weak pointer collection firing prematurely???

2012-08-16 Thread John McCall
On Aug 15, 2012, at 6:00 PM, Britt Durbrow wrote:
> On Aug 15, 2012, at 4:46 PM, John McCall  wrote:
>> On Aug 13, 2012, at 11:38 PM, Britt Durbrow wrote:
>>> OK, I think I've isolated the issue... basically, __weak, @public, and 
>>> -fno-objc-arc don't like to play nice together. If you set a @public __weak 
>>> instance variable (may also apply to stack variables, I haven't tested that 
>>> yet) in a file compiled with -fno-objc-arc, and then access it in a file 
>>> compiled with ARC turned on, the variable gets zeroed out.
>>> 
>>> I have reduced it to a simple test project, and I'm going to file a RADAR.
>> 
>> Please do;  maybe we can find a way to warn about the assignment to a __weak 
>> object in non-ARC.  That said, your code is buggy;  we do *not* guarantee 
>> anything about the representation  of a weak object, and it is not legal to 
>> access one in non-ARC code except by explicitly calling one of the specified 
>> runtime functions (and we don't encourage you to do that).
>> 
>> John.
> 
> Done. rdar://12101247
> 
> The ARC documentation does not seem to indicate that the appropriate runtime 
> function is not emitted by the compiler when -fno-objc-arc is in effect... 
> and given that it's automatic *retain counting* that I thought I was turning 
> off; and not other parts of the runtime system, it's kinda counterintuitive 
> (well, it is to me at least :-) to have the compiler silently generate 
> erroneous code - especially when the result is a value changing on a *read* 
> operation!

Unless specifically indicated, everything in the ARC documentation is only 
enabled/valid under -fobjc-arc.  ARC's __weak semantics are new to ARC.  We did 
repurpose an existing "keyword" from GC, and it has roughly similar behavior, 
but that bites us here:  __weak was always ignored when GC was disabled, so 
changing that is source-breaking.

> I would expect either: a) the compiler would always emit the correct runtime 
> call for a __weak assignment no matter if ARC is on or off; or b) the 
> compiler would throw an error when an attempt to access a __weak variable is 
> made without ARC turned on (I don't think a warning is sufficient; given that 
> it really does mess things up).

We'll see whether we can emit a warning.  An error is unlikely.

John.


___

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: launch application de-elevated

2012-08-16 Thread danchik
Hello, I have a postinstall script that starts a program to do some final 
configurations (the installer was elevated with password during the 
install), after all is done, the program starts the installed application 
via:


[[NSWorkspace sharedWorkspace] launchApplication:appPath]

which works, however, when the app is launched this way, there seems to be 
issues with configurations, for example, when trying to pull the list of 
available paper sizes for a default printer, I get an error (in 10.7 and 
10.8) as a result instead of a list of paper sizes.  If I relaunch the app 
as user (by clicking on it in Finder) everything works fine.


So there is something that isn't quiet right when the app is launched by 
the  installer when it was elevated (even though it sais the process belongs 
to the same user as if I launched it by hand).  Is there a better way to 
launch  the app from withing the program that was started by the elevated 
installer?


Thank You

___

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


launch application de-elevated

2012-08-16 Thread danchik
Hello, I have a postinstall script that starts a program to do some finla 
configurations (the installer was elevated with password during the 
install), after all is done, the program starts the installed application 
via:


[[NSWorkspace sharedWorkspace] launchApplication:appPath]

which works, however, when the app is launched this way, there seems to be 
issues with configurations, for example, when trying to pull the list of 
available paper sizes for a default printer, I get an error (in 10.7 and 
10.8) as a result instead of a list of paper sizes.  If I relaunch the app 
as user (by clicking on it in Finder) everything works fine.


So there is something that isn't quiet right when the app is launched by the 
installer when it was elevated (even though it sais the process belongs to 
the same user as if I launched it by hand).  Is there a better way to launch 
the app from withing the program that was started by the elevated installer?


Thank You

___

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: 64-Bit Transition GuideS

2012-08-16 Thread Jerry Krinock

On 2012 Aug 15, at 22:11, Quincey Morris  
wrote:

> From the "64-Bit Transition Guide for Cocoa":

Thank you.  I see the problem.  There are two relevant 64-Bit Transition Guides:

• 64-Bit Transition Guide
• 64-Bit Transition Guide for Cocoa

I didn't notice the second one and thought that all I needed to know was in the 
first one.


___

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 memory

2012-08-16 Thread Kyle Sluder
On Aug 16, 2012, at 9:33 AM, Charlie Dickman <3tothe...@comcast.net> wrote:

> Thanks. If "integral max resident set size" means the amount of memory being 
> used then that's exactly what I want.

There is no such measurement as "the amount of memory being used."

What is your actual use case?

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

2012-08-16 Thread Charlie Dickman
Thanks. If "integral max resident set size" means the amount of memory being 
used then that's exactly what I want.

On Aug 16, 2012, at 11:30 AM, Stephen J. Butler wrote:

> getrusage?
> 
> On Thu, Aug 16, 2012 at 9:39 AM, Charlie Dickman <3tothe...@comcast.net> 
> wrote:
>> Is there a system command or any other way to get application memory stats 
>> like vm_stat does for the whole system?
>> 
>> Charlie Dickman
>> 3tothe...@comcast.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/stephen.butler%40gmail.com
>> 
>> This email sent to stephen.but...@gmail.com

Charlie Dickman
3tothe...@comcast.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: App memory

2012-08-16 Thread Stephen J. Butler
getrusage?

On Thu, Aug 16, 2012 at 9:39 AM, Charlie Dickman <3tothe...@comcast.net> wrote:
> Is there a system command or any other way to get application memory stats 
> like vm_stat does for the whole system?
>
> Charlie Dickman
> 3tothe...@comcast.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/stephen.butler%40gmail.com
>
> This email sent to stephen.but...@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: Why no keyboard or mousedown events?

2012-08-16 Thread Ken Thomases
On Aug 14, 2012, at 9:19 PM, Charlie Dickman wrote:

> When my app is running menu bar requests are honored in a timely fashion but 
> neither keyboard shortcuts nor mouse clicks not in the menu bar are.
> Can anybody tell me why and what to do about it?

Are you running a program which has been linked against AppKit but which is not 
properly bundled with an Info.plist?  Alternatively, are you running your app 
from a shell which is not part of the GUI login session (for example you've 
ssh'd into your own box)?

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


App memory

2012-08-16 Thread Charlie Dickman
Is there a system command or any other way to get application memory stats like 
vm_stat does for the whole system?

Charlie Dickman
3tothe...@comcast.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: Window Title drop-down menu in 10.8

2012-08-16 Thread James Merkel

On Aug 15, 2012, at 11:25 PM, Mike Abdullah  wrote:

> 
> On 14 Aug 2012, at 05:29, James Merkel  wrote:
> 
>> In 10.8, what capabilities does a window need in order for it to have the 
>> window title drop down menu? My windows don't seem to have this feature.
>> Does the window need to be document based?
> 
> Yes. What feature(s) would you like of the dropdown?
> 

Primarily the Rename… capability..

Jim Merkel
___

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: Classes incompatible with weak references

2012-08-16 Thread Britt Durbrow
On Aug 16, 2012, at 4:37 AM, Vincent Habchi  wrote:

> On 16 août 2012, at 03:11, Britt Durbrow 
>  wrote:
> 
>> objects must be 16-byte aligned - and that alignment requirement isn't 
>> likely to go down, but rather up in the future; using the low bits doesn't 
>> really cause the same issue that using the high bits did.
> 
> Well, I partly disagree. There is no real difference in using MSB or LSB. At 
> some point in the future, Intel can decide to use low bits to serve some 
> specific hardware purpose, like signaling uncachable addresses on a fine 
> granularity, indicating what core had fetched the pointer, or deciding at 
> fetch time what kind of info is being accessed and route the incoming data 
> accordingly, and so on.
> 

Well, they *could*, but I don't think they *will*. Doing that would cause so 
many problems that I think it's totally unfeasible:

1) At the hardware level, pointers are just unsigned integers. The same 
instruction used to fetch an integer is used to fetch a pointer.
2) Pointer arithmetic would be totally messed up. Code that did pointer 
arithmetic as unsigned integers would break (yes, I know it's outside of the 
spec for many languages, C included, but a lot of software already out there 
does this, even though it's not really supposed to. It isn't outside the spec 
for assembler though, and there's a lot of assembler out there too).
3) Due to 1 and 2, they would have to introduce a set of new instructions that 
just do pointer handling on large objects.
4) You wouldn't be able to use the same kind of pointer to reference small 
objects (char, short, etc) as large objects (i.e, stuff with the 16-byte 
alignment requirement). Also, conversion from one type to the other would be 
impossible without loosing data.
5) Backwards compatibility - both binary and source level - would be totally 
broken... a *major* consideration for Intel.
6) The runtime would have to mask off the low bits of the address anyway in 
order to follow the isa pointer - if Intel did as you suggest they might; the 
runtime could handle this by treating the pointer as a purely computed address; 
not a fetched one.
7) And other stuff that I'm sure I'm missing at the moment.

The same considerations also apply to any existing architecture (i.e, ARM, etc) 
that would do that; and most of them would apply to any potential new 
architecture.


>> Oh, and it bit the Mac too - anybody remember the Mode32 extension from the 
>> System 7 era?
> 
> At that time I wasn’t developing on Mac, which was far too expensive for the 
> means of a poor student. But I clearly remember having written the equivalent 
> for the Atari TT/Falcon, MMUPATCH.BIN, a short TSR assembly code that would 
> tinker with the MMU of the 68030 to redirect all logical addresses XXYY 
> towards physical addresses 00YY. That was a clear kludge, but it 
> prevented some occasional bombing ;)
> 
> Vincent
> 
> 

As I recall (heh, it's been a while! :-) the Mac Toolbox ROM's Memory Manager 
used to stuff metadata about handles (relocatable pointers-to-pointers) in the 
high bits of an address; and what Mode32 did was to patch the trap table to use 
the newer 32-bit clean Memory Manager routines on machines that had the older 
ROM installed (I don't *think* it patched out the whole ROM, but I could be 
mistaken... as I said, it's been a while).

> 
> ___
> 
> 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/bdurbrow%40rattlesnakehillsoftworks.com
> 
> This email sent to bdurb...@rattlesnakehillsoftworks.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: Classes incompatible with weak references

2012-08-16 Thread Vincent Habchi
On 16 août 2012, at 03:11, Britt Durbrow 
 wrote:

> objects must be 16-byte aligned - and that alignment requirement isn't likely 
> to go down, but rather up in the future; using the low bits doesn't really 
> cause the same issue that using the high bits did.

Well, I partly disagree. There is no real difference in using MSB or LSB. At 
some point in the future, Intel can decide to use low bits to serve some 
specific hardware purpose, like signaling uncachable addresses on a fine 
granularity, indicating what core had fetched the pointer, or deciding at fetch 
time what kind of info is being accessed and route the incoming data 
accordingly, and so on.

> Oh, and it bit the Mac too - anybody remember the Mode32 extension from the 
> System 7 era?

At that time I wasn’t developing on Mac, which was far too expensive for the 
means of a poor student. But I clearly remember having written the equivalent 
for the Atari TT/Falcon, MMUPATCH.BIN, a short TSR assembly code that would 
tinker with the MMU of the 68030 to redirect all logical addresses XXYY 
towards physical addresses 00YY. That was a clear kludge, but it prevented 
some occasional bombing ;)

Vincent



___

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: Basic constraints: Cancel & OK buttons

2012-08-16 Thread Rick Mann
Thanks. I keep trying to go to the constraint itself, and connect it to other 
views, etc. Setting a constraint requires touching UI bits in so many unrelated 
places.

-- 
Rick



On Aug 15, 2012, at 22:04 , Roland King  wrote:

> Ah - a question I asked myself many times until I watched the WWDC videos 
> where clearly it was meant to be so obvious that it was perhaps assumed 
> anyone would just understand how to do it. 
> 
> Select one button, then shift-select the other, you now have two buttons 
> selected. At the bottom right-hand corner of the main pane of interface 
> builder is a small, grey, pill-shaped control you perhaps missed, it looks 
> greyed out and inactive, but it's not. The middle piece of it is a bit like a 
> capital H, click that. At the bottom it says 'Widths Equally", click that. 
> That should add the constraint you want. Alternatively I'm sure you clicked 
> the Edit menu button and found nothing there, but it was there, it's called 
> Pin instead of Constrain. 
> 
> If you have not watched the WWDC 2012 videos, and have access to them, I 
> really advise watching all (there's 2 or 3 I don't recall) presentations on 
> Autolayout. When I first saw that feature I thought, bah, springs and struts 
> are fine, who needs this. Then I watched the videos. They are packed with 
> great demos, great tips and after I'd watched them I had a completely 
> different opinion and I'm very much looking forward to using them in anger 
> soon. 
> 
> 
> 
> On 16 Aug, 2012, at 9:48 AM, Rick Mann  wrote:
> 
>> So, here's a basic question about constraints: How do I make a sheet with 
>> Cancel and OK buttons, such that the two buttons keep the same width? This 
>> doesn't seem possible to do by simply dropping a couple buttons in IB. I'm 
>> sure it can be done programmatically, although I'm not sure of the best 
>> approach.
>> 
>> -- 
>> Rick
>> 
>> 
>> 
>> 
>> ___
>> 
>> 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/rols%40rols.org
>> 
>> This email sent to r...@rols.org
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to 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: Classes incompatible with weak references

2012-08-16 Thread Jean-Daniel Dupas

Le 14 août 2012 à 09:09, Vincent Habchi  a écrit :

> Le 13 août 2012, à 23:47, Mike Abdullah  scripsit:
> 
>> An idea I've vaguely wondered about would be turning the isa variable into a 
>> tagged pointer. If you know nothing is accessing it directly (to do so was 
>> deprecated with the modern runtime), then, say, the last 4 bits of the 
>> pointer could be used to record the retain count. Once they're used up (for 
>> those rare, highly retained 
> 
> Using part of pointer to do something else than record an address is 
> perilous. I remember, once again in the old days of the 68000 on the Atari 
> ST, which had a 24-bit external address bus (and not 20 as I wrote before on 
> some other thread), and 32-bit internal address registers, some developers 
> had figured out to use the MSB (unused) of these address registers (pointers) 
> to store extra information. Now, two years later the 68020 with full 32-bit 
> external address bus was released, and suddenly all the code relying on that 
> trick broke on the TT and later machines…
> 

Unless pointer alignment requirement changed, it is safe to use this technic. 
Moreover, malloc is documented to return memory properly align to be used by 
vector units, which required at least 16 bytes alignment, so it is safe to 
assume that any malloced pointer on OS X has 4 unused bits.

Not only the runtime use it (as already noted in previous posts), LLVM/clang 
also rely heavily on this feature to reduce memory usage.

But you are right to say that is may be fragile. If you thought about using 
tagged pointer to store info with your objc object pointers before 10.7, the 
change to the runtime and framework introduced in that release would have broke 
your software.


-- Jean-Daniel





___

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

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

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

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

Re: Where do these come from...

2012-08-16 Thread Graham Cox

On 16/08/2012, at 1:02 PM, Charlie Dickman <3tothe...@comcast.net> wrote:

> Here's the whole method... it is being called from within a view's drawRect 
> method...
> 
>   iDie = iRand(1, 6);



This is also nuts (though unrelated to your problem). You will get a new random 
value every time your view draws. It will be drawn at all sorts of times, not 
just when you invalidate the view yourself. If this value needs to be used 
elsewhere, it's not going to be stable.

Separate your MODEL (the die value) from the VIEW (how that die is visualised). 
Do it now. This is the path of insanity. When I see sloppy coding like this it 
throws the whole thing into doubt, and so a situation where you have an invalid 
context arising is no surprise.

--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: Mountain Lion crashes Simulator

2012-08-16 Thread Gerriet M. Denkmann

On 16 Aug 2012, at 12:51, Laurent Daudelin  wrote:

> Have you checked your fonts in Font Book to see if any would be damaged or 
> corrupted? Maybe there are duplicates?

I did Font Book → File → Validate File... with /System/Library/Fonts
It told me that all 37 fonts were ok.

It also told me: "There were no duplicated fonts found on your system."

Also: the Mountain Lion partition is a duplicate of the Lion partition (or the 
other way round) + Install Mountain Lion.app.


> 
> -Laurent.
> -- 
> Laurent Daudelin
> AIM/iChat/Skype:LaurentDaudelin   
> http://www.nemesys-soft.com/
> Logiciels Nemesys Software
> laur...@nemesys-soft.com
> 
> On Aug 15, 2012, at 20:02, Gerriet M. Denkmann  wrote:
> 
>> 
>> On 16 Aug 2012, at 07:43, Greg Parker  wrote:
>> 
>>> On Aug 14, 2012, at 3:21 AM, Gerriet M. Denkmann  
>>> wrote:
 I have an app which works fine under Lion, but with 10.8 (Xcode 4.4.1) it 
 crashes the Springboard in the Simulator (both iPhone and iPad).
 It never gets to: application:didFinishLaunchingWithOptions:
>>> 
>>> SpringBoard is trying to draw some text and crashing when interrogating the 
>>> font's attributes. I don't know what font files the simulator uses, but you 
>>> should start by making sure your OS X font files in /System/Library/Fonts/ 
>>> are correct.
>> 
>> I never did anything to /Systems/Library/Fonts at all.
>> How do I check that the fonts are ok?
>> 
>> I tried booting from a Lion (10.7.4) partition with the same Xcode (4.4.1) 
>> and everything works just fine. So Xcode does not seem to be the problem.
>> 
>> And I tried running some Apple Sample Code on Mountain Lion and it crashed 
>> with exactly the same symptoms. So it probably my code is not at fault.
>> 
>> I do not know whether this is relevant:
>> lrwxr-xr-x  1 root  admin  47 11 Aug 13:01 /Applications/Xcode.app@ -> 
>> /Volumes/สิงโต/Applications/Xcode.app
>> 
>> I.e. the Xcode on my Mountain Lion partition is just a symbolic link to 
>> Xcode on my Lion partition (สิงโต = lion).
>> 
>> 
>> Kind regards,
>> 
>> 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

Re: How to sandbox an included framework

2012-08-16 Thread Antonio Nunes
On 16 Aug 2012, at 07:34, Mike Abdullah  wrote:

Thanks for your thoughts Mike. I think they confirm my notion that this 
rejection was in error (either that, or I'm misunderstanding something):

> On 15 Aug 2012, at 18:48, Antonio Nunes  wrote:
> 
>> After a number of successful submissions of my sandboxed app tot he App 
>> Store, today Apple decided to reject my app because one of the 3rd party 
>> frameworks it includes and links against is not sandboxed. I don't recall 
>> hearing about sandboxing frameworks separately. I know they need to be 
>> codesigned, and this one is.
>> 
>> Searching through the docs and online doesn't turn up any info about 
>> framework sandboxing.
>> 
>> Can anyone point me to documentation or a tutorial on how to sandbox my 
>> third party framework. (I do have access to its source code, if necessary, 
>> but I did not see any obvious option to sandbox the framework when I opened 
>> and examined the framework's project in Xcode.
> 
> Are you sure this is really a framework? Frameworks load as part of your 
> process and so live within your app's sandbox. 

It's definitely a framework. It's open sourced: 
https://github.com/tcurdt/feedbackreporter

> Perhaps you're seeing one of the following:
> - the "framework" is, or includes, another executable which it launches to 
> perform a task

As any framework I've seen, it contains an executable with the framework code. 
I don't think it launches any other executables. As you wrote, the framework 
loads as part of the main app's process, so it's lives within the app's sandbox.

> - the framework is trying to do something blocked by the sandbox.

It has been working just fine within the sandbox for several releases. The 
framework needs network and address book access and both are covered by the 
entitlements specified for the app. I've had previous updates initially 
rejected because the framework was 'malformed' when apparently Apple tightened 
it's guidelines on framework folder structures. I've had a rejection because 
the reviewers did not keep tab of the rationale I had delivered for needing 
AddressBook access, so now I submit that with every update, to pre-empt 
rejection-by-review-process-sloppiness. But anyway, the sandbox has the 
necessary entitlements.

The reviewer's complaint is that (and I quote) "PDF 
Nomad.app/Contents/Frameworks/FeedbackReporter.framework/Versions/A/FeedbackReporter
 is not sandboxed."

Well, that's the executable that gets loaded as part of the main app's process, 
no? Neither can I find any way to sandbox the executable. It's codesigned, as 
it should be, but how would I separately sandbox it?

-António

---
And you would accept the seasons of your
heart, even as you have always accepted
the seasons that pass over your field.

--Kahlil Gibran
---





---
And you would accept the seasons of your
heart, even as you have always accepted
the seasons that pass over your field.

--Kahlil Gibran
---




___

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

NSMetadataQuery searchScopes broken in Mountain Lion?

2012-08-16 Thread Gerd Knops
Hi,

Whenever I use -setSearchScopes: in ML I get bogus results, was fine in Lion. I 
presume mdfind's "-onlyin" flag uses this as well, and delivers the same bogus 
results:

gerti@sputnik(900) ~: mdfind "kMDItemFSName == 'SomeBogusFileName.xyz'" | wc -l
   0
gerti@sputnik(901) ~: mdfind -onlyin "$HOME" "kMDItemFSName == 
'SomeBogusFileName.xyz'" | wc -l
  146006

Anybody else seeing this? Is there a workaround?

Thanks

Gerd


___

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: Where do these come from...

2012-08-16 Thread Mike Abdullah

On 16 Aug 2012, at 04:02, Charlie Dickman <3tothe...@comcast.net> wrote:

> Here's the whole method... it is being called from within a view's drawRect 
> method...
> 
> - (void) showDiceAtX: (float) x Y: (float) y {
>   NSRect imageRect1, imageRect2;
>   NSImage *die1 = nil, *die2 = nil;
>   iDie = iRand(1, 6);
>   switch (iDie) {
>   case 1:
>   die1 = [NSImage imageNamed: @"1 Die"];
>   break;
>   case 2:
>   die1 = [NSImage imageNamed: @"2 Die"];
>   break;
>   case 3:
>   die1 = [NSImage imageNamed: @"3 Die"];
>   break;
>   case 4:
>   die1 = [NSImage imageNamed: @"4 Die"];
>   break;
>   case 5:
>   die1 = [NSImage imageNamed: @"5 Die"];
>   break;
>   case 6:
>   die1 = [NSImage imageNamed: @"6 Die"];
>   }
>   jDie = iRand(1, 6);
>   switch (jDie) {
>   case 1:
>   die2 = [NSImage imageNamed: @"1 Die"];
>   break;
>   case 2:
>   die2 = [NSImage imageNamed: @"2 Die"];
>   break;
>   case 3:
>   die2 = [NSImage imageNamed: @"3 Die"];
>   break;
>   case 4:
>   die2 = [NSImage imageNamed: @"4 Die"];
>   break;
>   case 5:
>   die2 = [NSImage imageNamed: @"5 Die"];
>   break;
>   case 6:
>   die2 = [NSImage imageNamed: @"6 Die"];
>   }
>   imageRect1.origin = imageRect2.origin = NSZeroPoint;
>   imageRect1.size = [die1 size];
>   imageRect2.size = [die2 size];
>   /*
>* NSRect NSMakeRect(float x, float y, float w, float h)
>*
>* Creates an NSRect having the specified origin of [x, y] and size of 
> [w, h]
>*/
>   iDieDrawRect = NSMakeRect(x - imageRect1.size.width - 2, y, 
> imageRect1.size.width, imageRect1.size.height);
>   jDieDrawRect = NSMakeRect(x + 2, y, imageRect2.size.width, 
> imageRect2.size.height);
>   
>   while (![self lockFocusIfCanDraw]) RELQ(.1);
>   [[NSColor whiteColor] set];
>   [die1 drawInRect: iDieDrawRect
> fromRect: imageRect1
>operation: NSCompositeSourceOver
> fraction: 1.0];
>   [die2 drawInRect: jDieDrawRect
> fromRect: imageRect2
>operation: NSCompositeSourceOver
> fraction: 1.0];
>   [self unlockFocus];
>   [[self window] flushWindow];
> }

This code seems bonkers to me. If this code really is being called during 
-drawRect: then there is no need to lock focus on the view; the drawing system 
has already done that for you. Likewise, you shouldn't need to flush the window.


___

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: Speed up image display for large raw images?

2012-08-16 Thread Mike Abdullah

On 16 Aug 2012, at 04:41, Marco S Hyman  wrote:

> On Aug 15, 2012, at 8:24 PM, Jens Alfke  wrote:
> 
>>> The images are typically 25 MB Canon 7D raw image files that have
>>> been pre-alloc'ed and initWithContentsOfFile: 
>> 
>> NSImage doesn't actually load the image pixels until it needs to. Merely 
>> initializing an instance won't do it.
> 
> That matches what I'm seeing. The code didn't originally
> alloc and init the image until just prior to dropping it in
> the image well.  I tried a pre alloc/init on the off chance it
> would make things faster.  Nope.
> 
>> That said, NSImage has changed a lot over time (especially its caching) and 
>> I'm not sure what the best way is to preload an image these days.
> 
> For this application the camera preview jpg inside of the raw image
> would be of good enough quality.  I'm looking at what it would take
> to extract that.

Easy, CGImageSource.


___

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 sandbox an included framework

2012-08-16 Thread Mike Abdullah

On 15 Aug 2012, at 18:48, Antonio Nunes  wrote:

> After a number of successful submissions of my sandboxed app tot he App 
> Store, today Apple decided to reject my app because one of the 3rd party 
> frameworks it includes and links against is not sandboxed. I don't recall 
> hearing about sandboxing frameworks separately. I know they need to be 
> codesigned, and this one is.
> 
> Searching through the docs and online doesn't turn up any info about 
> framework sandboxing.
> 
> Can anyone point me to documentation or a tutorial on how to sandbox my third 
> party framework. (I do have access to its source code, if necessary, but I 
> did not see any obvious option to sandbox the framework when I opened and 
> examined the framework's project in Xcode.

Are you sure this is really a framework? Frameworks load as part of your 
process and so live within your app's sandbox. Perhaps you're seeing one of the 
following:

- the "framework" is, or includes, another executable which it launches to 
perform a task
- the framework is trying to do something blocked by the sandbox.
___

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: Window Title drop-down menu in 10.8

2012-08-16 Thread Mike Abdullah

On 14 Aug 2012, at 05:29, James Merkel  wrote:

> In 10.8, what capabilities does a window need in order for it to have the 
> window title drop down menu? My windows don't seem to have this feature.
> Does the window need to be document based?

Yes. What feature(s) would you like of the dropdown?


___

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: Where do these come from...

2012-08-16 Thread Quincey Morris
On Aug 15, 2012, at 20:39 , Charlie Dickman <3tothe...@comcast.net> wrote:

> I DO NOT call drawRect directly. I DO  call [self setNeedsDisplay: YES] to 
> keep things going. All drawing is done from inside drawRect which has been 
> invoked through the use of [self setNeedsDisplay: YES],

That's good. Next step is to eliminate your voodoo code:

>   while (![self lockFocusIfCanDraw]) RELQ(.1);
>   …
>   [self unlockFocus];
>   [[self window] flushWindow];

and look for the actual problem ("the images never show"). You shouldn't assume 
that the problem is with the 2 image 'drawInRect:…' messages. It could well be 
that the earlier code in 'drawRect:' has done something wrong.

My guess is that an earlier part of 'drawRect:' failed to save/restore the 
graphics context around some drawing that changed then invalidated the current 
context.


___

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: NSSpeechSynthesizer / DarkWake interaction

2012-08-16 Thread Quincey Morris
On Aug 15, 2012, at 20:31 , Jens Alfke  wrote:

> I have never heard the term "DarkWake" before, and I can't find anything 
> about it in Apple's docs apart from its name appearing in some low-level 
> constants. Is this the internal term for 10.8's "Power Nap"? My understanding 
> was that only certain Apple apps like Mail are allowed to run in this state, 
> not 3rd party apps; but if that's not true, I'd love to learn how. ("Power 
> Nap" doesn't turn up anything in the 10.8 docs either.)


On Aug 15, 2012, at 20:38 , Jay Reynolds Freeman  
wrote:

> I thought that DarkWake was the name for the advanced form of Power Nap on 
> 10.8; in any case that is what I meant.  I *think* I understand that the 
> system can put apps of its choice into that mode (audio and console powered 
> down, all else running).  My concern is as described -- what will 
> NSSpeechSynthesizer do when my app is placed in that state outside of my 
> control.
> 
> But I may be very confused; there is indeed little documentation on the 
> matter.

Take a look at the 2012 WWDC video on Power Management. It explains DarkWake, 
as well as power assertions which can be used to prevent the Mac from sleeping 
while your app is doing something. (Sorry, I don't know the answer to your 
original question.)




___

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