Re: Code signing checking

2023-01-29 Thread Stephane Sudre via Cocoa-dev
Is this to prevent your executable from loading plugins that are not signed
with your team ID?

Because, in this case, this would look like what the Hardened runtime does.

On Fri, Jan 6, 2023 at 9:29 PM Aandi Inston via Cocoa-dev <
cocoa-dev@lists.apple.com> wrote:

> Is there any API for doing the following activities related to code
> signing?
> - Check that the signature on the running codesigned executable is from the
> same company as the signature on a bundle?
> OR
> - Get the company from the codesigned running executable and
> - Get the company from a signature on a bundle
> (so we can check they are the same).
>
> I think this can be done calling and reading output from the codesign CLI,
> but an API seems tidier.
>
> Reference to detailed reading is fine!!
> Thanks in advance!
> ___
>
> 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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com
>


-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: /Library/Application Support off limits?

2021-04-15 Thread Stephane Sudre via Cocoa-dev
I'm not sure to understand why you think a folder whose path is
/Users/Shared could not be used to share things among users.

If the issue you see is that once a user creates a file or directory
in /Users/Shared, only this user can manipulate them, just change the
POSIX permissions to make them editable by other users.

On Thu, Apr 15, 2021 at 9:37 AM Davidap via Cocoa-dev
 wrote:
>
> Becouse is not a good place for sharing things since it is not accessible by 
> anyone but the ~ user.
>
> Davidap
>
> El 14/4/21 a las 18:41, Ben Kennedy escribió:
> >
> >> On 14 Apr 2021, at 1:14 am, Davidap via Cocoa-dev 
> >>  wrote:
> >>
> >> Apple say:
> >>
> >> [...] For example, if your app is named MyApp and has the bundle 
> >> identifier com.example.MyApp, you would put your app’s user-specific data 
> >> files and resources in the ~/Library/Application 
> >> Support/com.example.MyApp/ directory. Your app is responsible for creating 
> >> this directory as needed.
> >>
> >> Our app isn't sandboxed, but when I try to create a "/Library/Application 
> >> Support/NewFolder" folder in there I get the following message:
> >>
> >> /*You don't have permission to save the file "NewFolder" in the folder 
> >> "Application Support."*/
> > You misread. The passage you quoted above indicates "~/Library/Application 
> > Support"; i.e. under the Library inside the user's home directory.
> >
> >> I can't find anywhere else suitable to use for sharing files that need to 
> >> be read and written by different users - /Users/Shared doesn't seem right
> > Why not?
> >
> > -ben
> >
> ___
>
> 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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: Exception not being caught in try statement

2021-03-27 Thread Stephane Sudre via Cocoa-dev
It's trying to insert a NSTextTab * object.


On Fri, Mar 26, 2021 at 12:11 PM Mark Allan via Cocoa-dev
 wrote:
>
> Hi folks,
>
> Some users are reporting a crash that I can't reproduce, and in an attempt to 
> gain additional diagnostics from a user, I wrapped the affected line in a 
> try/catch block.  For two users it resolve the crash, but for a third, it's 
> still crashing at the same point!
>
> The crash occurs when a user attempts to open the "About" window from my 
> app's main menu item. I'm not using the standard about panel as there's a few 
> additional items I need to display, one of which is an NSTextView which I 
> populate with the contents of an RTF file from within the app bundle.
>
> I've symbolicated the crash log to find it's happening when populating that 
> TextView. The line in question now reads as follows:
>
> @try {
> [self.aboutBox.creditsTextView readRTFDFromFile:[[NSBundle 
> mainBundle] pathForResource:@"Credits" ofType:@"rtf"]];
> } @catch (NSException *exception) {
> NSLog(@"Error loading the contents of the text file for the 
> About Box. %@", exception);
> //Check we have a file at the expected path
> if([[NSFileManager defaultManager] 
> fileExistsAtPath:[[NSBundle mainBundle] pathForResource:@"Credits" 
> ofType:@"rtf"]]){
> NSLog(@"Yes. Found the RTF credits file");
> // check the attributes in case somehow there's no 
> permission to read the file
> NSDictionary *fileAttributes = [[NSFileManager 
> defaultManager] attributesOfItemAtPath:[[NSBundle mainBundle] 
> pathForResource:@"Credits" ofType:@"rtf"] error:nil];
> NSLog(@"RTF file has following attributes %@", 
> fileAttributes);
> }
> else {
> NSLog(@"Nope, file not found");
> }
> }
>
> This is the crash log from the newest build (with the try/catch around that 
> line):
>
> > Performing @selector(showAboutBox:) from sender NSMenuItem 0x60634540
> > *** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
> > reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
> > terminating with uncaught exception of type NSException
> > abort() called
> >
> > Application Specific Backtrace 1:
> > 0   CoreFoundation  0x7fff206ea6af 
> > __exceptionPreprocess + 242
> > 1   libobjc.A.dylib 0x7fff204223c9 
> > objc_exception_throw + 48
> > 2   CoreFoundation  0x7fff2079ea9a -[__NSCFString 
> > characterAtIndex:].cold.1 + 0
> > 3   CoreFoundation  0x7fff2079c953 -[__NSArrayM 
> > insertObject:atIndex:].cold.2 + 0
> > 4   CoreFoundation  0x7fff20610421 -[__NSArrayM 
> > insertObject:atIndex:] + 1135
> > 5   UIFoundation0x7fff23c223ab 
> > __defaultTabStops_block_invoke + 161
> > 6   libdispatch.dylib   0x7fff203cd7c7 
> > _dispatch_client_callout + 8
> > 7   libdispatch.dylib   0x7fff203ce96b 
> > _dispatch_once_callout + 20
> > 8   UIFoundation0x7fff23c229d7 
> > -[NSMutableParagraphStyle setTabStops:] + 199
> > 9   UIFoundation0x7fff23c3c697 -[NSRTFReader 
> > defaultParagraphStyle] + 75
> > 10  UIFoundation0x7fff23c3c5be -[NSRTFReader 
> > _mutableParagraphStyle] + 112
> > 11  UIFoundation0x7fff23c36113 controlClass + 
> > 1757
> > 12  UIFoundation0x7fff23c356b4 -[NSRTFReader 
> > attributedString] + 76
> > 13  UIFoundation0x7fff23c311a6 
> > _NSReadAttributedStringFromURLOrData + 3213
> > 14  UIFoundation0x7fff23d46985 
> > -[NSAttributedString(NSAttributedStringUIFoundationAdditions) 
> > initWithURL:options:documentAttributes:error:] + 228
> > 15  AppKit  0x7fff23677d9a -[NSTextView 
> > readRTFDFromFile:] + 126
> > 16  MyAppHere 0x000105fa18a7 MyAppHere+ 
> > 227495
> > 17  AppKit  0x7fff230af7fd 
> > -[NSApplication(NSResponder) sendAction:to:from:] + 283
> > 18  AppKit  0x7fff231b2611 -[NSMenuItem 
> > _corePerformAction] + 413
>
>
> Any ideas what's going on? Other than the file not being found, why else 
> might the object at line 3 in the backtrace be nil...and more interestingly, 
> why is the exception not being caught?
>
> Thanks
> Mark
> ___
>
> 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:

NSCollectionView + custom layout => missing vertical drop line

2020-07-14 Thread Stephane Sudre via Cocoa-dev
I'm currently playing with NSCollectionView (10.11+ behavior) and have
not been able to figure out a mystery when it comes to drag and drop.

I have a NSCollectionView with a custom layout.

The layout is based on the standard grid layout with the following
modifications in mind:

- there can only be one row.
- there are as many columns as items.
- the collection view can be scrolled horizontally.
- the width of the items is fixed.
- the height of the items is the height of the contents.

The mystery I'm facing is that during a local drag and drop (to switch
items), the vertical line indicating the target of the drop does not
appear.

The mysterious side here is that if I change the maximumNumberOfRows
to 0, it does appear but I lose the horizontal scrolling.

Since this is the first time I try to use the NSCollectionView class
with a custom layout, I'm probably doing something wrong. But I have
not found so far an obvious solution from the miscellaneous tutorials
here and there.

So if anyone has an idea what's wrong, I'm interested.

Sample project:

Warning: the drop indexes are computed incorrectly for the moment.
Dragging and dropping the first card between the second and third ones
is safe.

https://drive.google.com/file/d/1LsDrWjK7vg3ET8yGLaLR1OpojfA4Tlrr/view?usp=sharing
___

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: Curious bug in oPanel under Mojave in screensaver

2020-05-28 Thread Stephane Sudre via Cocoa-dev
It's a known issue in all 10.14 versions and some 10.15 versions.

Apple broke NSOpenPanel when they sandboxed the screensaver pref pane.
They also broke window focus BTW.

2 issues can be observed:

- you select a file, you get the parent folder.
- you switch to the list view mode and you can freeze/crash the System
Preferences application.

Basically, 10.14 and 10.5 have been huge nightmares when it comes to
screen savers.

On Thu, May 28, 2020 at 1:40 PM Gabriel Zachmann via Cocoa-dev
 wrote:
>
> I have screensaver where the user can select a folder through the options 
> sheet.
> In that sheet,  I open an NSOpenPanel, make a few settings, runModal,
> let the user navigate and choose a folder, then get oPanel.URL.
> (Complete code below.)
>
> The curious thing is:
> The oPanel returns only the folder that appeared at the top of the dialog in 
> the dropdown.
> In other words, when a user navigates to some folder A, then clicks on a 
> folder B inside A,
> then closes the panel (clicking "Open"), then oPanel.URL still returns A.
> The user has to navigate *into* B for the oPanel to return B.
>
> This funny behavior seems to occur only under Mojave (not Catalina),
> and it seems to occur only in the screensaver.
> Exactly the same code under Mojave works as expected when used in a 
> stand-alone app.
>
> My question is: does anyone have an idea what might be causing this?
> Am I missing something?
> Or is it "just" a bug in AppKit or the screensaverengine under Mojave?
>
> Thanks a lot in advance for all kinds of hints and insights.
>
> Best regards, Gabriel
>
>
> Enc:
>
> Complete code for my open dialog:
>
> NSOpenPanel *oPanel = [NSOpenPanel openPanel];
> [oPanel setDirectoryURL: dir];
> [oPanel setAllowsMultipleSelection: NO];
> [oPanel setCanChooseDirectories: YES];
> [oPanel setCanChooseFiles: NO];
> long int result = [oPanel runModal];
> new_url = oPanel.URL;
>
>
>
> ___
>
> 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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: Thoughts on productivity

2019-10-24 Thread Stephane Sudre via Cocoa-dev
On Fri, Oct 25, 2019 at 12:38 AM Rob Petrovec via Cocoa-dev
 wrote:
> If its a ranty bug report, which apparently happens a lot, it goes into a 
> black-hole never to see the light of day if it doesn’t just get closed right 
> off the bat.  So try to keep opinions & criticisms out of it.  Just the facts 
> and keep it professional.

Not fixing an issue because the bug report is ranty is definitely not
professional.
___

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: Need for Swift

2019-10-16 Thread Stephane Sudre via Cocoa-dev
On Tue, Oct 15, 2019 at 2:26 PM Sandor Szatmari via Cocoa-dev
 wrote:

> But honestly, I don’t have enough Swift experience to know if you can write 
> bad Swift code.

I'm just reading Swift code here and there and it's my personal
opinion that 75% of the Swift code I read is bad code.

By bad code, I mean code suffering from the "only God and I know what
I'm doing" syndrome.

The same syndrome that you can find in software using Cocoa bindings.
The same software that is terrible to maintain, even more when you're
not the original author (and you're obviously not God).

Why do Swift developers think it's mandatory to write code that is illegible?
Is Swift mainly used by freelances or consultants that will not have
to maintain the software?
___

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: Thoughts on Cocoa source code

2019-10-10 Thread Stephane Sudre via Cocoa-dev
On Wed, Oct 9, 2019 at 7:19 PM Turtle Creek Software via Cocoa-dev
 wrote:
>
> Why is Cocoa source code hidden?
>
> Many of the frustrations we had with the 64-bit update attempt were caused
> by Cocoa's lack of visible source. It was a "black box" that often required
> trial-and-error to figure out. Yeah, the headers are visible, and Apple has
> info online. But sometimes that was not sufficient to understand the actual
> implementation details.

Cocoa source code is not really hidden if you use the proper tools and
know how to use them and that you should not rely 100% on them.

With Hopper Disassembler, you can see any Obj-C framework source code
in /System/Library/(Private)Frameworks.

Although most of the time you don't need to see the source code, there
are some areas that are poorly covered by the developer documentation
and being able to see the implementation details is very useful. For
instance, if you ever had to write a custom subclass of NSCell or a
subclass of NSControl with multiple cells, the official documentation
was almost totally useless and this was a good opportunity to find out
about the private API Apple was keeping to itself to make the AppKit
controls work.

It's true that having access to the source code can also help finding
issues and suggesting patches. But it's also true that if Apple had
been doing a proper job at checking the warnings and static analysis
outputs of its own IDE, numerous issues could have been fixed without
having needed to be reported by 3rd party developers.

If you combine otool, classdump and Hopper Disassembler, you can find
how some Cocoa methods are working in any Obj-C executable pretty
easily.

https://www.hopperapp.com

http://stevenygard.com/projects/class-dump/

Checking cocotron can also be helpful if you want to see how someone
else implemented most Foundation and AppKit legacy APIs.
___

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: Screensaver icon ?

2019-09-17 Thread Stephane Sudre via Cocoa-dev
For the record, due to Apple's inability to support 3rd party screen
saver seriously, the custom icons for 3rd party screen savers are
displayed incorrectly and differently depending on the OS versions.

So don't spend too much time on getting your screen saver icon to be
pixel perfect. The Desktop and Screen Saver pref pane will always do
its best to ruin it.

On Tue, Sep 17, 2019 at 10:09 AM Felix Franz via Cocoa-dev
 wrote:
>
> Hi Gabriel,
>
>
> looks like the file Contents/Resources/thumbnail.png (or .tiff) in the bundle 
> is used. If I replace this file it simply shows up.
>
>
> Cheers,
>
>
> Felix
>
>
>
>  From:   Gabriel Zachmann via Cocoa-dev 
>  To:   
>  Sent:   9/17/2019 9:26 AM
>  Subject:   Screensaver icon ?
>
> Does anybody know how I can define/set the icon for my screensaver that 
> appears in the left hand sidebar of System Preferences / Desktop & 
> Screensaver / Screensaver ?
>
> More specifically:
> I am writing a screensaver, it works and appears in the sidebar in the System 
> Preferences Screensavers pane.
> But it has this default icon (blue swirl).
> I would like to change that to a different image/icon.
>
> What do I need to do in my code to achieve that?
>
> I checked Apple's ScreenSaver documentation, and also googled , to no avail.
>
> All hints will be highly appreciated.
>
> Best regards, Gabriel
>
>
>
> ___
>
> 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/felix.franz%40ergosign.de
>
> This email sent to felix.fr...@ergosign.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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: Screen saver sometimes starts and stops immediately

2018-11-26 Thread Stephane Sudre
Could it be that your screen saver is trying to access data in a user
folder protected by tccd like ~/Pictures ?

info 13:52:14.333614 +0100 ScreenSaverEngine stop animation   (id =
0x7ffe73822800)
default 13:52:14.334610 +0100 tccd MacOS error: -67050
default 13:52:14.335183 +0100 ScreenSaverEngine -[ScreenSaverEngine
startScreenSaver:] -- firstTime 0
info 13:52:14.335516 +0100 ScreenSaverEngine viewWillMoveToWindow was
called with NULL window.
On Sun, Nov 25, 2018 at 10:37 PM Gabriel Zachmann  wrote:
>
> I have a problem with my screensaver: it gets started as usual by the OS,
> it displays the first image for a second (approx),
> and then, sometimes (only sometimes), it gets stopped by the OS.
>
> I cannot recall anything I might have changed that might cause this behavior 
> (of course).
> Also, I cannot find any hint at a crash or other malfunction of my code.
>
>
> I have uploaded a section of the log -- copied from Console.app -- here:
>   https://www.dropbox.com/s/gkjys2yww1jz46n/log_screensaver_exit.txt?dl=0
>
> (Even though it's just 1 minute of log data , I think it is too lengthy to 
> include it here.
> I did not want to filter it because I was afraid i might loose valuable 
> information.)
>
> For instance, at 13:52:13.277129 you can see that my screensaver (ArtSaver) 
> got started,
> and at 13:52:13.465331 you can see the next message from my screensaver that 
> got logged.
> There are some more messages from my code, but nothing unusual, AFAICS.
>
> At 13:52:18.331654, the screensaver gets stopped, but I don't see any reason.
> (And as far as I can remember, I did not stop it at that point.)
>
> (The only funny thing is that there is a second "startup" message in the log 
> file at 13:52:14.655737 .
> But, IIRC, I have seen that for many years, so I doubt that is the problem.)
>
> If there is any other info I can provide, or if there is a better way t 
> provide the information, please let me know.
>
> Best regards, Gabriel
>
> ___
>
> 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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: Carbon -> Cocoa

2018-08-18 Thread Stephane Sudre
It might be the new Carbon once:

- there is ABI stability in Swift. This could be not before late 2019.

- the new APIs are only available in Swift. Is Swift NIO a hint this
is coming sooner than expected? I don't know. I don't use networking
frameworks.


Regarding the complexity of porting from C++ Carbon to Cocoa, there's
also the important question of what your minimum OS target is.

Maybe one of the reasons why you kept a Carbon version alive so long
is that the application needs to keep working on older OS versions.

Porting to OS X 10.10 or later is not the same thing as porting to
10.6 or later for instance.


On Thu, Aug 16, 2018 at 3:48 PM, Sean McBride  wrote:
> On Thu, 16 Aug 2018 11:54:59 +, Casey McDermott said:
>
>>I am curious, are there other developers on this list working on conversions
>>from C++ Carbon to Cocoa?
>
> By now, Cocoa may be the new Carbon.
>
> If you haven't switched to Cocoa after all these years, and if your app is 
> large, I'd wait to see what happens with Marzipan.
>
> Sean
>
>
> ___
>
> 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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: Detecting if current user owns the screen (screen lock/FUS)

2017-04-21 Thread Stephane Sudre
SystemConfiguration.framework?

You can:

- retrieve the current uid,gid, user name with SCDynamicStoreCopyConsoleUser
- be notified via a C callback when the console user changes
(SCDynamicStoreCreate, SCDynamicStoreKeyCreateConsoleUser(),
SCDynamicStoreSetNotificationKeys, SCDynamicStoreSetDispatchQueue or a
more classic runloop source) and then then call
SCDynamicStoreCopyConsoleUser.

Note that when the login window is displayed, the current user name is
"loginwindow".

I've never checked which uid or user name was returned when the screen
is locked.


On Fri, Apr 21, 2017 at 9:57 AM, Uli Kusterer
 wrote:
> Hi,
>
> I have an application (think hardware driver) that runs as a particular (GUI) 
> user. Now, if that user is switched out using Fast User Switching or the 
> screen lock has engaged, I want to prevent the driver from working (as the 
> user sitting in front of the computer with access to the hardware is 
> obviously not them).
>
> The only documented API I've found is 
> NSWorkspaceSessionDidResignActiveNotification etc., but this doesn't help me 
> because it only notifies me when the state changes, it doesn't let me obtain 
> an initial state (I suppose I could assume if I'm running as a user, my 
> session is active, but would prefer actually knowing).
>
> I've also found that CGSessionCopyCurrentDictionary() contains an 
> undocumented key that lets me know whether the screen lock is engaged, but 
> that reports the screen as not locked when the user is still logged on, but 
> switched out using fast user switching.
>
> Is there any official, supported way to determine whether the user my app is 
> running as actually owns the screen and screen lock is not engaged that I 
> could use for this purpose? Since I only need to know the current state when 
> the user actually triggers my device, a polling API would be fine.
>
> Cheers,
> -- Uli Kusterer
> "The Witnesses of TeachText are everywhere..."
>
>
>
> ___
>
> 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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: NSTableView column sizes

2017-03-15 Thread Stephane Sudre
On Wed, Mar 15, 2017 at 9:59 AM, Daryle Walker  wrote:
> 1. Is there a way to make the last (right in the U.S. localization) column to 
> always be at the end of the table-view, instead of a gap after a resize?

Yes, there is.

> 2. My table has two columns. Is there a way to keep their sizes in proportion 
> after a window resize? (If the divider is moved, resizes will follow the new 
> proportions.)

Yes, there is.

In both cases, if you are not happy with the Column Sizing option
(respectively Last Column Only and Uniform), you can always enumerate
the columns of the table view and set their width as you like (by
registering for the NSViewFrameDidChangeNotification notification of
the appropriate view). You need to take into account the
intercellSpacing.
___

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: Getting/Setting FinderInfo attributes using native Cocoa API?

2016-10-15 Thread Stephane Sudre
Actually, it's to put back some of them on a newly created folder. So
right now, it just retrieves the values as NSData objects but I've
added a hook to be able to convert the data to the real objects.

the - [NSFileManager copyItemAtPath:toPath:error:] API does copy at
least the FinderInfo and ResourceFork extended attributes (which are
the ones that I need). I haven't checked whether it was copying the
quarantine flag or the download history ones yet. So depending on your
needs, you may not need to use the copyfile API.


On Sat, Oct 15, 2016 at 9:20 AM, Allan Odgaard
<lists+cocoa-...@simplit.com> wrote:
> On 14 Oct 2016, at 23:33, Stephane Sudre wrote:
>
>> I ended up writing a category for NSManager to deal with this using
>> the xattr.h APIs. […]
>
>
> If the goal is to copy extended attributes (as one post alluded to) then
> there is the `COPYFILE_METADATA` flag which can be used with
> x-man-page://3/copyfile
>
> Although I seem to recall some crash issues when used with network drives,
> my code skips it for non-local drives with a reference to 
> but that report seems to have been marked “secret” so I can no longer read
> it…
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html

___

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: Getting/Setting FinderInfo attributes using native Cocoa API?

2016-10-14 Thread Stephane Sudre
I ended up writing a category for NSManager to deal with this using
the xattr.h APIs.

Something like:

- (NSDictionary *)PKG_extendedAttributesOfItemAtPath:(NSString
*)inPath error:(NSError *__autoreleasing *)outError;
- (BOOL)PKG_setExtendedAttributes:(NSDictionary *)inExtendedAttributes
ofItemAtPath:(NSString *)inPath error:(NSError *__autoreleasing
*)outError;


On Thu, Oct 13, 2016 at 6:47 PM, Gary L. Wade
<garyw...@desisoftsystems.com> wrote:
> Write bugs for the ones where there's no non-deprecated method. I don't 
> recall all the values, but there may be UNIX-level functions to do some 
> things. And if there's no real way now, look up the info on the structures 
> and set them by way of the xattr calls.
> --
> Gary L. Wade (Sent from my iPad)
> http://www.garywade.com/
>
>> On Oct 13, 2016, at 9:21 AM, Stephane Sudre <dev.iceb...@gmail.com> wrote:
>>
>> No specific attributes in the FinderInfo data. I just need to be able
>> to get it and set it on another file/folder.
>>
>> The labels case you mention is an interesting one. I had not thought
>> about it when it comes to cross-compatibility with the different OS
>> versions I need to support.
>>
>> On Thu, Oct 13, 2016 at 4:45 PM, Gary L. Wade
>> <garyw...@desisoftsystems.com> wrote:
>>> What attributes in particular do you need to work with? In case you might 
>>> be dealing with labels, those moved from the simple bitmask flag to 
>>> separate values in their own extended attribute. Other values may have 
>>> changed similarly but I haven't kept up with them.
>>> --
>>> Gary L. Wade (Sent from my iPad)
>>> http://www.garywade.com/
>>>
>>>> On Oct 13, 2016, at 7:03 AM, Stephane Sudre <dev.iceb...@gmail.com> wrote:
>>>>
>>>> Question:
>>>>
>>>> Is there a native Cocoa API that can replace the
>>>> FSGetCatalog/FSSetCatalog API when it comes to retrieving/setting the
>>>> FinderInfo (and FinderExtInfo) attributes of a file?
>>>>
>>>> OS X 10.8 and later.
>>>>
>>>> Problem:
>>>>
>>>> The FS CoreCarbon APIs are deprecated but apparently, there's nothing
>>>> to replace them completely in Cocoa (Foundation).
>>>>
>>>> The NSURL resources APIs does not support the FinderInfo attributes
>>>> (no obvious key in the broken documentation and using
>>>> "com.apple.FinderInfo" does not work).
>>>>
>>>>
>>>> Workaround:
>>>>
>>>> This can be worked around by using the xattr.h APIs but if it could be
>>>> possible to avoid this, it would be better.
>>
>>
>>
>> --
>> Packaging Resources - http://s.sudre.free.fr/Packaging.html
>



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html

___

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: Getting/Setting FinderInfo attributes using native Cocoa API?

2016-10-13 Thread Stephane Sudre
No specific attributes in the FinderInfo data. I just need to be able
to get it and set it on another file/folder.

The labels case you mention is an interesting one. I had not thought
about it when it comes to cross-compatibility with the different OS
versions I need to support.

On Thu, Oct 13, 2016 at 4:45 PM, Gary L. Wade
<garyw...@desisoftsystems.com> wrote:
> What attributes in particular do you need to work with? In case you might be 
> dealing with labels, those moved from the simple bitmask flag to separate 
> values in their own extended attribute. Other values may have changed 
> similarly but I haven't kept up with them.
> --
> Gary L. Wade (Sent from my iPad)
> http://www.garywade.com/
>
>> On Oct 13, 2016, at 7:03 AM, Stephane Sudre <dev.iceb...@gmail.com> wrote:
>>
>> Question:
>>
>> Is there a native Cocoa API that can replace the
>> FSGetCatalog/FSSetCatalog API when it comes to retrieving/setting the
>> FinderInfo (and FinderExtInfo) attributes of a file?
>>
>> OS X 10.8 and later.
>>
>> Problem:
>>
>> The FS CoreCarbon APIs are deprecated but apparently, there's nothing
>> to replace them completely in Cocoa (Foundation).
>>
>> The NSURL resources APIs does not support the FinderInfo attributes
>> (no obvious key in the broken documentation and using
>> "com.apple.FinderInfo" does not work).
>>
>>
>> Workaround:
>>
>> This can be worked around by using the xattr.h APIs but if it could be
>> possible to avoid this, it would be better.
>



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html

___

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

Getting/Setting FinderInfo attributes using native Cocoa API?

2016-10-13 Thread Stephane Sudre
Question:

Is there a native Cocoa API that can replace the
FSGetCatalog/FSSetCatalog API when it comes to retrieving/setting the
FinderInfo (and FinderExtInfo) attributes of a file?

OS X 10.8 and later.

Problem:

The FS CoreCarbon APIs are deprecated but apparently, there's nothing
to replace them completely in Cocoa (Foundation).

The NSURL resources APIs does not support the FinderInfo attributes
(no obvious key in the broken documentation and using
"com.apple.FinderInfo" does not work).


Workaround:

This can be worked around by using the xattr.h APIs but if it could be
possible to avoid this, it would be better.
___

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: Class is implemented in both

2016-08-16 Thread Stephane Sudre
Regarding the solution that requires to change the name of the class
in the binary (and nib), here is what I used:

https://github.com/packagesdev/rsscommon/tree/master/refafactor/refafactor

It would require to change the name of the renamable classes (and
files if needed).


On Mon, Aug 15, 2016 at 9:41 AM, Stephane Sudre <dev.iceb...@gmail.com> wrote:

> - you could rename the class after one of the 2 projects has been
> built and then codesign the new binary. Basically, you scan the
> executable binary for the name of the class and you replace it with a
> name of the same length. I'm doing this for screen saver modules who
> share some code which is within a submodule.
___

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: Class is implemented in both

2016-08-15 Thread Stephane Sudre
On Mon, Aug 15, 2016 at 3:29 AM, Trygve Inda  wrote:
> I have a Pref Pane and a Screen Saver module. They both share a common
> helper class (MyDisplayManager).
>
> When the pref pane has been loaded and I go into the screen saver (or vis
> versa), because the host app is System preferences, I get:
>
> Class MyDisplayManager is implemented in both One of the two will be
> used. Which one is undefined.
>
> The class comes from the same source file. What is the best way to handle
> this? I could ignore it because the classes are the same (same source file)
> so it should not matter which one is used.
>
> Is there a better way without duplicating and renaming the class?

IMHO, it depends on how your produce is distributed:

- if you're distributed it via an Installation package and the
components are installed in /Library, you could use a Framework with
the shared class and install it in /Library/Frameworks (and of course
use the framework in both your Pref Pane and Screen Saver module).

- if the installation is supposed to be done manually or with the user
double-clicking the Pref Pane and Screen Saver module to get the OS to
install them either for all users or the current user:

. you could redefine the class name in the .pch of one project.
- you could rename the class after one of the 2 projects has been
built and then codesign the new binary. Basically, you scan the
executable binary for the name of the class and you replace it with a
name of the same length. I'm doing this for screen saver modules who
share some code which is within a submodule.
- you could parse the Mach-O executable file and parse the appropriate
sections (__objc_classname, __objc_classlist, etc.) of the appropriate
segments (__TEXT, __DATA, __OBJC)  (which depends on the Objective-C
version for instance) to find your class name and replace it with a
unique name (again same length unless you're looking into rebuilding
the entire Mach-O).

  e.g. __DATA, __objc_classlist contains 64-bit references to struct
objc2_class_t records in __DATA, __objc_data. The data record of such
a struct will point to a objc2_class_ro_t record in __DATA,
__objc_const and the name record of this struct will point to the name
of the class in __TEXT, __objc_classname.
___

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

[NSXPCConnection] Getting the effective user/group ids of the listener

2016-08-14 Thread Stephane Sudre
It's possible to retrieve the effective user/group ids of the remote
peer from the listener delegate method.

But it there a way for the remote peer to get the effective user/group
ids of the remote listener?

According to the CREDENTIALS section of the xpc_objects(3) man page,
it seems to be possible but even after a message has been exchanged
the values are still -1 and -1.
___

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: Thoughts on autolayout

2016-04-22 Thread Stephane Sudre
I tend to believe that it's because of step 4 that some developers
(#include me) still do not like auto layout. Because even with a very
simple view, you can waste a lot of time with this step.

On Thu, Apr 21, 2016 at 9:49 PM, Bill Cheeseman  wrote:
>
>> On Apr 21, 2016, at 3:19 PM, Charles Srstka  wrote:
>>
>> Am I the only one who likes autolayout?
>
>
> No, I like it, too. I developed an approach that I'm comfortable with, and if 
> I stick to it I can get the job done quickly. Of course, trying to accomplish 
> something I haven't done before requires a little more thought, but I find 
> that I can figure it out pretty quickly. It almost comes natural now.
>
> I use IB exclusively. My approach goes like this, on a one-window-at-a-time 
> or one-view-at-a-time basis:
>
> 1. Drag all the views and controls onto the canvas and drop them more or less 
> where I want them to end up. Don't waste any time trying to align them or 
> make them the right size exactly -- just get position and size approximately 
> right and move on. Leave it looking a little ragged. Above all, don't create 
> any constraints yet.
>
> 2. Write enough of the application code to get a sense whether the layout 
> needs to be changed. Change it as needed, but again don't waste any time 
> getting it exactly right and don't create any constraints yet.
>
> 3. When the design feels like its ready to be frozen, create the constraints. 
> DO NOT move the controls and views into the exact place they belong and then 
> add constraints -- instead, do it the other way around: create the 
> constraints first and then tell the controls and views to obey them. It will 
> be much easier to see that they all moved into the right place, because they 
> will all move a relatively short distance. More on this step below.
>
> 4. Every time you tell a window or view to obey new constraints, watch very 
> carefully. If the controls and views move or resize in unexpected ways, or 
> disappear completely, immediately choose undo to get back to where you were 
> (with all the controls and views in approximately the right locations). Then 
> figure out which constraint you left out or got wrong, and fix it. Repeatedly 
> undo and fix as needed.
>
> 5. When you think you're done, lock the constraints down and do a lot of 
> window resizing, divider dragging, and so on to test them.
>
> More on step 3. I create constraints the way I read: start at the top left 
> corner, move item by item to the right, then move down one "row" and start at 
> the left again, and so on until I reach the bottom right corner. This leads 
> to some useful consistencies to help my brain figure out why something went 
> wrong. (a) For example, it is often only the leftmost button in the top "row" 
> of controls that needs a top constraint to the superview; the other buttons 
> in that "row" will have their vertical dimension controlled by baseline or 
> center alignment, or something similar. (b) Horizontal constraints are easily 
> made complete, because I account for each piece one step at a time from left 
> to right: leading constraint, width constraint, trailing constraint, etc. (c) 
> I don't worry about hugging priorities and the like until all else fails, 
> because the default priorities are designed to be right for most situations.
>
> --
>
> Bill Cheeseman - wjcheese...@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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html

___

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: Thoughts on autolayout

2016-04-21 Thread Stephane Sudre
Thanks for the reference.

Unfortunately, according to the documentation, it's only available on
OS X 10.11 or later.

On Thu, Apr 21, 2016 at 12:55 PM, Jonathan Mitchell
<li...@mugginsoft.com> wrote:
>
>> On 21 Apr 2016, at 11:48, Stephane Sudre <dev.iceb...@gmail.com> wrote:
>>
>>
>> - you still have to use intermediary subviews to deal with complex cases.
> NSLayoutGuide can help out here
> https://developer.apple.com/library/mac/documentation/AppKit/Reference/NSLayoutGuide_ClassReference/index.html#//apple_ref/doc/uid/TP40016078-CH1
>
> J
>
>
>
> ___
>
> 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/dev.iceberg%40gmail.com
>
> This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: Thoughts on autolayout

2016-04-21 Thread Stephane Sudre
On Thu, Apr 21, 2016 at 10:36 AM, Kristof Van Landschoot
 wrote:
> All of these points sound more like "Thoughts on Interface Builder to me".
> Using autolayout without Interface Builder is a better experience (although
> not perfect, surely).

Not using autolayout is an even better experience so far for me because:

- autolayout was released when it was not ready and so while it's
supported on some earlier OS X versions, it does not work correctly on
them: slowness, different behaviors depending on the OS release, etc.

- autolayout still seems unpredictable when you think to have
understood how it works and some error messages are written in
Klingon.

- for simple cases, autolayout is not simpler than resizing masks. For
complex cases, it's more complex and time consuming than writing the
layout code to deal with these complex cases.

- you still have to use intermediary subviews to deal with complex cases.

The only thing that isreally missing with resizing masks isthe ability
to center a view vertically or horizontally in its superview.
___

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: API to determine status of System Integrity Protection?

2015-09-13 Thread Stephane Sudre
On Sat, Sep 12, 2015 at 9:53 PM, Ed Wynne  wrote:
>
> On Sep 12, 2015, at 1:45 PM, sqwarqDev  wrote:
>
>>
>>> On 13 Sep 2015, at 00:43, SevenBits  wrote:
>>>
>>> That document doesn't mention an API…
>>>
>> Hence, since that is the current documentation, my conclusion : “Don’t think 
>> so”.
>
>
> There is an API. Much like with sandboxing it just may not be public, which 
> means it is inappropriate for discussion here. I’m not sure why Apple 
> considers this kind of thing off limits, but that is inappropriate for 
> discussion here as well.

I must be missing something but why should there be an API?

- determining whether SIP is on requires to check whether the running
OS on 10.11 or later. Also it could done by parsing the output of $
csrutil status but this would assume the output format will not change
in the future.
- determining whether you can write to a file or folder can be done
with the usual BSD, Cocoa APIs, can't it?
- knowing which parts of the file hierarchy are protected is covered
by the documentation (Interestingly I've just discovered that
/Applications/Utilities is a no trespassing area).

___

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: runModalForWindow is disabling my menus

2015-09-06 Thread Stephane Sudre
On Sun, Sep 6, 2015 at 10:20 AM, Felipe Monteiro de Carvalho
<felipemonteiro.carva...@gmail.com> wrote:
> On Sat, Sep 5, 2015 at 8:49 PM, Stephane Sudre <dev.iceb...@gmail.com> wrote:
>> Which feature of a modal window are you looking for?
>
> Disabling all other windows in the app and staying on top of them.
>
>> Because having
>> all the menu items being enabled in the case of a modal dialog does
>> not match the nature of the modal mode (i.e. restricted mode).
>
> In Mac OS X maybe, but in Linux and Windows there is no problem in a
> modal window having a menu, so its not like its a conceptual problem.
>
>>> Each menu item has itself as target and a method to respond to the action.
>> Why not have at least a shared object as the target?
>
> Why does this make any difference? The target supposedly is just a
> method of an object, I don't see why Cocoa cannot call it. The object
> must remain in memory. And if the object is in memory the method can
> be called.

IMHO, it would just be cleaner both from a code and architecture (MVC)
point of view. Because the final target of your action is not the menu
item.

>
> So you are saying that it would work if the target is not the menu item 
> itself?

Usually, the FirstResponder object would be the target of the menu
item action so that if you implement the action in your window/dialog
controller or in another potential first responder in the dialog, the
menu item will be enabled (even without a validateMenuItem:
implementation).
___

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: runModalForWindow is disabling my menus

2015-09-05 Thread Stephane Sudre
On Sat, Sep 5, 2015 at 2:14 PM, Felipe Monteiro de Carvalho
 wrote:
> Hello,
>
> I want to have a modal window which has menus, so I setup the menus
> for the window and make it modal with NSApp.runModalForWindow and
> everything is OK, except that my menu items are all disabled!

Which feature of a modal window are you looking for? Because having
all the menu items being enabled in the case of a modal dialog does
not match the nature of the modal mode (i.e. restricted mode).

> Each menu item has itself as target and a method to respond to the action.

Why not have at least a shared object as the target?

> If I only change from runModalForWindow to a non-modal window show,
> then everything works ok!
>
> Any ideas or is it impossible to have menu items and use runModalForWindow?

It's possible to have (enabled) menu items for a window running as
modal. For instance, if you have a NSWindowController subclass
controlling an empty modal window panel, you can add a - (IBAction)
cut:(id)sender {} method to the controller and the Cut menu item will
become enabled.
___

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: Will iOS app accepted on App Store if 80% of UI is rendered on UIWebView and 20% being native OCR

2015-08-20 Thread Stephane Sudre
From your description, your app would use official APIs. So in theory,
it doesn't matter if your app is just presenting a web view (like a
lot of apps).

But considering that the interpretation of the App Store Guidelines
can vary depending on the reviewer or the weather forecast, the only
way to know if your app will be accepted is to submit it to the review
process.

My $0.02


On Thu, Aug 20, 2015 at 8:21 AM, Devarshi Kulshreshtha
devarshi.bluec...@gmail.com wrote:
 I have a mobile website which at high level provides these functionalities:

  1. Sign-in
  2. Sign-up
  3. Few forms where user can fill his additional details
  4. Providing some capabilities to user based on information provided by him

 Now I want to integrate OCR capabilities such as:

  1. ID card scan
  2. Debit card scan
  3. Void check scan

 So that some of the forms can be automatically filled by information
 extracted from these.

 I am planning to make a native app in iOS consuming most of the forms, flow
 from my mobile website by rendering respective weburls on webview, and
 integrating vendor SDKs to provide OCR capabilities.

 Will Apple accept my iOS app in App Store if I have 80% of flow, UI
 rendered on UIWebView and remaining 20% being integration and use of native
 vendor SDKs for OCR capabilities?


 --
 Thanks,

 Devarshi
 ___

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

 This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: Tech update avoiding legacy code

2015-08-14 Thread Stephane Sudre
On Fri, Aug 14, 2015 at 8:01 AM, Jens Alfke j...@mooseyard.com wrote:
 Do you have a definite business need to keep supporting 10.5? I can’t believe 
 you have many customers still running it — it came out in 2007 (the last 
 release I worked on at Apple!)

 In terms of priorities, I think ARC is the biggest win, followed by GCD. Some 
 people might rate auto-layout higher; I might if I did more GUI stuff.

Auto-layout in (too) many cases is no gain, lots of pain.
Considering the issues (e.g. performance) with the earlier versions,
planning on losing only 10.5 and 10.6 might be overly optimistic. Even
more if Storyboards are included.

Appa Rao Mulpuri wrote:
 ARC - We lost Mac 10.5 support. And chance of loosing 10.6 as Weak references 
 are not supported in OS X v10.6.

Regarding ARC, there are still some limitations in 10.7 in the AppKit
(window controllers) IIRC.

___

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: Tech update avoiding legacy code

2015-08-14 Thread Stephane Sudre
On Fri, Aug 14, 2015 at 6:42 PM, Jens Alfke j...@mooseyard.com wrote:

 On Aug 13, 2015, at 11:27 PM, Appa Rao Mulpuri appar...@ivycomptech.com 
 wrote:

 Thanks for the priority order. In GDC Vs ARC, GCD is the first one to opt
 unless if you are app has more memory leaks. Correct me If I am wrong.

 ARC will simplify your source code, make new code easier to write

It can depend on how much code you have that is toll-free bridging
CFSomething and NSSomething.

 One thing we both forgot to mention is blocks — I can’t remember, can you 
 even use blocks in an app targeting 10.5?

Nope. 10.6.

Regarding the things you forget to mention is GateKeeper v2. AFAIK,
this requires to build (or at least codesign)  on OS X 10.9.5 or
later.

If your build system is your development system, then this imposes a
minimum Xcode version and so a minimum SDK version. IMHO, it's easier
to develop with a OS SDK version that is close to the target OS
deployment version. With 10.9.5, you probably need Xcode 5 or later,
which could mean a 10.7 SDK or later. So if you're targeting 10.5 or
10.6 compatibility, you may end up with some surprises during
development and testing regarding the available APIs.

___

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: Updating a screensaver from 10.6 to 10.10

2015-07-27 Thread Stephane Sudre
• You may also need|have to consider moving away from Garbage
Collection. 10.10 (or 10.11?) is the last version to support it.

• You need to codesign the screen saver on 10.9.5 or later, otherwise,
it won't be GateKeeper v2 compatible and the user won't be able to
double-click it in the Finder to install it in the now hidden
~/Library/Screen Savers folder.

• You may need to consider providing Retina compatible image resources.

• If you want to provide a thumbnail preview to be displayed in the
Screen Savers Pref Pane list, you can add 2 PNGs in your .saver
bundle: thumbnail.png and thumbn...@2x.png. (3)

• Depending on the age of your code source, you may also want to start
using a NSWindowController for the configuration sheet of the screen
saver module.

• When it comes to detecting the main screen, it depends on your
definition of the main screen. The mainScreen method returns the
screen containing the window with the keyboard focus, this may not be
the screen with the menu bar (1) (2). It's usually easier to identify
the screen with the menu bar as the first screen in the array returned
by screens.


I'm currently updating a few OS X ports of Windows Screen Savers. I'm
using mostly the same templates for all of them. Just in case, you're
looking for a template:
https://github.com/packagesdev?tab=repositories


(1) Of course, since the menu bar can be displayed on every screen in
recent versions of OS X, this can be even more confusing.
(2) Considering the menu bar is not displayed when the screen saver is
running (i.e. not preview mode), this is not really a definition of
the main screen either.
(3) Due to bugs and lack of commitment from Apple, the rendering of
one's thumbnail preview is not really good in recent OS versions. I'm
getting not too catastrophic result using this project:

https://github.com/packagesdev/screensaverthumbnailfactory

It currently requires to complete the windowDidLoadMethod of the
SSTFWindowController class to call showScreenSaverForBundle: with the
appropriate bundle for your screen saver.



On Sun, Jul 26, 2015 at 11:11 PM, Gabriel Zachmann z...@tu-clausthal.de wrote:
 Dear all,

 I have written a screensaver , but unfortunately, I didn't have the time to 
 update the source code sine OS X 10.7 .
 It is still working so-so, but showing signs of code aging.

 Now I would like to bring the source code up to date.

 Does anybody know of some guidelines , or a list of hints, or any other 
 document anywhere, that would outline the exact changes
 I need to do.
 In particular, I'd like to learn more about the changes needed in 
 CoreAnimation, in Scripting Bridge to retrieve photos from iPhoto-now-Photos,
 and the way I identify the current display/monitor.
 Below are a few code snippets, for your information.

 And I am interesting in anything else you might deem worthy of upgrading in 
 the source code.

 Thanks a lot in advance.

 Best regards,
 Gabriel.



 -
 Code snippet I used to make a layer (containing only one image) 
 cross-dissolve with a new one:

 [CATransaction begin];
 if ( crossDissolve_ )
   [CATransaction setAnimationDuration: fading_duration];
 else
   [CATransaction setValue: (id)kCFBooleanTrue forKey: 
 kCATransactionDisableActions];
 [mainLayer_ replaceSublayer: currentLayer_ with: newlayer];
 currentLayer_ = newlayer;
 [CATransaction commit];

 --
 Code snippet I used to identify monitors/displays (this seems to fail since 
 OS X 10.9 ):

 displayNumber_ = [ [[newWindow screen] deviceDescription] 
 objectForKey: @NSScreenNumber];
 displayID_ = [displayNumber_ unsignedIntValue];
 unsigned int main_screen_id = [[ [[NSScreen mainScreen] 
 deviceDescription] objectForKey: @NSScreenNumber] unsignedIntValue];

 I suspect , this code does not work any more as intended, because I get often 
 a new display ID for exactly the same monitor (just a cinema display).



 ___

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

 This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html

___

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: Can I show different content in different screens? (screensaver)

2015-07-25 Thread Stephane Sudre
Another solution: use Objective-C.

It will also allow your screen saver to be compatible with older OS X
releases (10.8 if you are using ARC).



On Fri, Jul 24, 2015 at 7:13 PM, Juanjo Conti jjco...@carouselapps.com wrote:
 I wonder why the second line doesn't' compile

 var screens = NSScreen.screens() as! [NSScreen]

 find(screens, window?.screen!)

 On Fri, Jul 24, 2015 at 1:19 PM, Juanjo Conti jjco...@carouselapps.com
 wrote:

 I was able to use this code, but only after init

 var screens = NSScreen.screens() as! [NSScreen]

 for screen in screens {

 if screen == window?.screen! {

 NSLog(MY SCREEN \(screen))

 }

 }

 On Wed, Jul 22, 2015 at 5:09 PM, Dave d...@looktowindward.com wrote:

 Yes, Grab it’s global coords and then scan the NSScreen Array til you
 find it, there are some API calls to do this too I think, but off the top I
 can’t remember the details and not at my machine at the moment.

 Cheers
 Dave




  On 22 Jul 2015, at 20:01, Juanjo Conti jjco...@carouselapps.com
 wrote:
 
  So, from the code, I can tell in which screen my code is running?
 
  On Wed, Jul 22, 2015 at 2:38 PM, Steve Mills sjmi...@mac.com wrote:
 
  On Jul 22, 2015, at 12:13 PM, Juanjo Conti jjco...@carouselapps.com
  wrote:
 
  I'm writing an screensaver and I wonder what happens if I have more
 than
  one screen.
 
  So far, the screensaver is displayed in all the screens.
 
  But, what about if I want to show different content in each? do you
 know if
  the screen saver framework has support for this?
 
 
  Each screen gets its own executable, so each screen shows different
  content. For instance, the built-in ones that show photos have
 different
  photos on each screen.
 
  Sent from iCloud's horrible UI
 
 
 
 
  --
 
  Juanjo Conti jjconti http://goog_2023646312@carouselapps.com
  jjco...@carouselapps.com
 
  Software Engineer - Carousel Apps https://carouselapps.com
 
  --
  Carousel Apps Limited, registered in England  Wales with registered
 number
  7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket
  Street, London SE1 3HN. Any communication sent by or on behalf of
 Carousel
  App Ltd or any of its subsidiary, holding or affiliated companies or
  entities (together Watu) is confidential and may be privileged or
  otherwise protected. If you receive it in error please inform us and
 then
  delete it from your system. You should not copy it or disclose its
 contents
  to anyone. Messages sent to and from Watu may be monitored to ensure
  compliance with our internal policies and to protect our business.
 Emails
  are not secure and cannot be guaranteed to be error free. Anyone who
  communicates with us by email is taken to accept these risks.
  ___
 
  Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
  Please do not post admin requests or moderator comments to the list.
  Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
  Help/Unsubscribe/Update your Subscription:
 
 https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com
 
  This email sent to d...@looktowindward.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/jjconti%40carouselapps.com

 This email sent to jjco...@carouselapps.com




 --

 Juanjo Conti jjconti http://goog_2023646312@carouselapps.com
 jjco...@carouselapps.com

 Software Engineer - Carousel Apps https://carouselapps.com




 --

 Juanjo Conti jjconti http://goog_2023646312@carouselapps.com
 jjco...@carouselapps.com

 Software Engineer - Carousel Apps https://carouselapps.com

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

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

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

 Help/Unsubscribe/Update your 

Re: Language options: Objective-C, Swift, C or C++?

2015-06-21 Thread Stephane Sudre
On Wed, Jun 17, 2015 at 10:16 AM, Quincey Morris
quinceymor...@rivergatesoftware.com wrote:
 On Jun 17, 2015, at 00:56 , Graham Cox graham@bigpond.com wrote:

 To me this is actually a good thing that I’ll be sorry to see go away in 
 Swift.

 With a separate header that only contains the public stuff, I can see at a 
 glance what a class does without being overwhelmed by its implementation 
 details.

 It’s already done in Swift 2. While you’re editing in the one pane, the 
 Counterparts setting in the assistant pane (which in Obj-C shows the .h when 
 you edit the .m) shows exactly this view, along with documentation (///) 
 comments. It actually shows public and internal API within a module 
 (basically the same thing), but I assume when used cross-module it shows only 
 public API, but I haven’t had a chance to try that yet (though this is what 
 Command-click on Cocoa APIs shows you, so I assume it works the same).

Maybe I misinterpreted the presentations, but this is not a property
of the language (i.e. Swift 2), it's the IDE that does this. Which
means that would you edit Swift code in TextWrangler, you would still
only have the verbose source file.

___

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: Try to open an app from a screensaver

2015-04-25 Thread Stephane Sudre
On Sat, Apr 25, 2015 at 12:40 AM, Juanjo Conti jjco...@carouselapps.com wrote:
 I'm developing a screensaver. I want to achieve the following: then the
 user hits the key 's', stop the screensaver and open a program.

 Handling the key stroke is done, and I'm launching the program as:

 (the following code search runningApplications to see if the app is already
 running, if not it's open with launchApplicationAtURL. Finally I take it to
 foreground with activateWithOptions)

[…]

 After that i raise the event that finish the screensaver.

 The problem is that sometimes, if there is a Finder window open, my app
 ends at the bottom of it (!) Anybody knows why can this be happening?

And this does not happen when there is another application's window?

Because this looks like the same kind of issue you can encounter when
you open a Cocoa app without a menu bar and its icon in the Dock.

 --

 Juanjo Conti jjconti http://goog_2023646312@carouselapps.com
 jjco...@carouselapps.com

 Software Engineer - Carousel Apps https://carouselapps.com

 --
 […] Bunch of boring legal terms […]

___

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: Setup an icon for a screensaver

2015-03-04 Thread Stephane Sudre
What do you consider to be the icon for the screensaver?

The icon that is shown in the Finder for the .saver file or the the
thumbnail preview you see in the Desktop  Screen Saver Pref pane?

Unless I'm mistaken, for the first one: it would require to add a
custom icon either via the Finder Info Window or via a script.

For the second one, you need to have thumbnail(@2x).(png|tiff)
images in the Resources (90x58, 180x116).

On Wed, Mar 4, 2015 at 6:52 PM, Juanjo Conti jjco...@carouselapps.com wrote:
 Hi there!

 I have setup an icon for a Cocoa App (following this SO question
 http://stackoverflow.com/questions/11660736/xcode-4-4-removed-icon-composer-in-developer-tools)
 and I tried to do the same for a screensaver plugin.

 I had not luck. Do you know if there are any special steps needed to setup
 an icon for a screensaver? The product is a .saver file. I've checked and
 it includes the .icns file in Components/Resources.

 --

 Juanjo Conti jjconti http://goog_2023646312@carouselapps.com
 jjco...@carouselapps.com

 Software Engineer - Carousel Apps https://carouselapps.com

 --
 [TL;DR; disclaimer]
___

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: Extrange problem with screensaver in 2 monitors and key stroke

2015-02-02 Thread Stephane Sudre
If you are subclassing the keyDown:|keyUp: method of the screensaver
view, you are limited by the fact that there can only be one first
responder.

A solution could be to post a notification when you detect the N key
being pressed (or released) and refresh the Web View from the
notification observer callback.


On Mon, Feb 2, 2015 at 2:51 PM, Juanjo Conti jjco...@carouselapps.com wrote:
 Hi! I'm writing a screensaver that shows a web page, the idea is that every
 certain number of seconds the page is changed but the user can also change
 it pressing the N key.

 If I use the screensaver having 2 monitors (not configured as mirrors), the
 time based change works ok, but the key based only changes the page in one
 of the screens.

 Was I clear describing the problem? I'm kind of lost. I don't know where to
 start digging. I suspect that it can be related to the fact that the key
 NSEevent has a windown property and there is a window per screen...?

 Thanks in advance!

 --

 Juanjo Conti jjconti http://goog_2023646312@carouselapps.com
 jjco...@carouselapps.com

 Software Engineer - Carousel Apps https://carouselapps.com

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

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

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

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

 This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html
___

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: Blurry is the New Sharp

2015-01-05 Thread Stephane Sudre
On Tue, Jan 6, 2015 at 12:38 AM, Graham Cox graham@bigpond.com wrote:

 It's not just pointless eye-candy, it's actually contrary to usability. In 
 Safari, I'd come to the conclusion that the window frame tint was an 
 indication of whether you were in a private session or a non-private one, but 
 after some time realised that the tint was merely an effect of what colour 
 the content of the web page happened to be that had been scrolled up behind 
 the title bar. A small thing, but nevertheless misleading.

 It's also completely arbitrary; what meaning does having a blurry translucent 
 background in a souce list (but not for other window content) actually 
 convey? The whole idea should be canned before it becomes more pervasive. 
 It's already a nuisance and causes numerous graphics glitches (e.g weird 
 black outlines around a non-active progress bar when on a vibrant 
 background). Developers have better things to worry about.

The problem is that when these issues were reported (*) just after the
first Yosemite seed, the Radar tickets were quickly closed as Behaves
as expected.

* including the suggestion to not enabled Vibrancy for apps built with
previous OS X SDKs.

___

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: NSTableColumn second Text Cell child

2014-12-01 Thread Stephane Sudre
That's correct.

You will have a cell (NSCell in the project I used to check) in the
hierarchy when you use a view-based table view.
I would tend to believe it's an IB bug that the data cell for the
TableColumn is displayed.
___

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: OS X MapKit issues

2014-09-17 Thread Stephane Sudre
Is it signed with the appropriate Mac App Store Developer Certificate?

On Wed, Sep 17, 2014 at 9:31 PM, Rick Mann rm...@latencyzero.com wrote:
 I've built the beginnings of a simple OS X app that will display some stuff 
 on a map. Although the Map View I put in the window is displaying a map, and 
 is set to show the user location, and the app asked for permission and I 
 clicked OK, it's not actually displaying the location.

 I'm also using CLLocationManager to get the location, and it's not returning 
 a location. I do see this in the console, though:

 2014-09-17 12:30:02.413 App[8615:303] Internal name did not resolve to 
 internal address!
 2014-09-17 12:30:04.372 App[8615:303] Retry to locate user

 Any idea what those mean?

 TIA,

 --
 Rick Mann
 rm...@latencyzero.com



 ___

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

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

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

 This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html

___

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 iOS

2013-09-11 Thread Stephane Sudre
On Wed, Sep 11, 2013 at 12:41 PM, Jean-Daniel Dupas
devli...@shadowlab.orgwrote:


 Thanks for this remainder, but I think we all already know that 620k is
 enough for anyone…


Well, I must confess I didn't know that. I thought 640k was required.
___

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: [BUG?] LSUIElement=YES and NSWorkspaceDidTerminateApplicationNotification

2013-08-01 Thread Stephane Sudre
On Thu, Aug 1, 2013 at 1:31 AM, Jerry Krinock je...@ieee.org wrote:

 On 2013 Jul 31, at 12:46, Stephane Sudre dev.iceb...@gmail.com wrote:

 I will file one because I consider that even if LSUIElement is set, it's 
 still an application (otherwise there would no point in returning an running 
 application instance when launched using NSWorkspace APIs)

 Although you are correct (a running application is indeed an 
 application), your bug should ask that the 
 NSWorkspaceDidTerminateApplicationNotification *documentation* be clarified, 
 because, as Peter Ammon confirmed, it's way too late for Apple to change the 
 behavior.

Yes, that what I'm going to do. I will also suggest to add a comment
in the header.

___

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

[BUG?] LSUIElement=YES and NSWorkspaceDidTerminateApplicationNotification

2013-07-31 Thread Stephane Sudre
Is it a known bug that the
NSWorkspaceDidTerminateApplicationNotification notification is not
sent for applications whose LSUIElement key is set to YES?

I've found an entry for this in StackOverflow but the explanations
provided to the original poster are forgetting the LSUIElement factor.

Mac OS X 10.7.5.
___

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: [BUG?] LSUIElement=YES and NSWorkspaceDidTerminateApplicationNotification

2013-07-31 Thread Stephane Sudre
I will file one because I consider that even if LSUIElement is set,
it's still an application (otherwise there would no point in returning
an running application instance when launched using NSWorkspace APIs)

On Wed, Jul 31, 2013 at 6:28 PM, Jerry Krinock je...@ieee.org wrote:

 On 2013 Jul 31, at 06:32, Stephane Sudre dev.iceb...@gmail.com wrote:

 Is it a known bug that the NSWorkspaceDidTerminateApplicationNotification 
 notification is not
 sent for applications whose LSUIElement key is set to YES?

 The *behavior* is known, at least by me, and is as you say, Stephane.  The 
 question is: Does Apple consider it to be a bug?

 The documentation of NSWorkspaceDidTerminateApplicationNotification states 
 that it is posted when an application finishes executing.  Is an 
 application running with LSUIElement considered to be an application?  
 Unfortunately, NSWorkspace documentation throws out the word application 
 like that in quite a few places without a precise definition.

 This is likely one of those cases where it would be safe to assume that Apple 
 will not change (fix) the behavior, because to do so might break apps 
 expecting the old behavior.

 Have you filed a bug on this and has there been any response?  If not, I'll 
 file one because I too use this notification and would at least like the 
 behavior to be properly documented.
 ___

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

 This email sent to dev.iceb...@gmail.com



-- 
Packaging Resources - http://s.sudre.free.fr/Packaging.html

___

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: Defaults not stored

2013-04-04 Thread Stephane Sudre
On Thu, Apr 4, 2013 at 5:56 AM, Steve Mills sjmi...@mac.com wrote:
 My screensaver follows examples I've seen as far as creating its defaults in 
 its initWithFrame method:

 ScreenSaverDefaults*defaults = [ScreenSaverDefaults 
 defaultsForModuleWithName:MyModuleName];

 // Register our default values:
 fileMan = [[NSFileManager alloc] init];

 NSURL*  defaultURL = [NSURL URLWithString:@/Applications];
 NSArray*pictFolders = [fileMan 
 URLsForDirectory:NSPicturesDirectory inDomains:NSUserDomainMask];

 if(pictFolders != nil  [pictFolders count]  0)
 defaultURL = [[pictFolders objectAtIndex:0] filePathURL];

 [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
 defaultURL, kImageFolderPathPrefKey,
 [NSNumber numberWithInteger:NSOnState], 
 kUsePolaroidBorderPrefKey,
 nil]];

 Then later in my startAnimation method I grab that value, but it's nil:

 ScreenSaverDefaults*defaults = [ScreenSaverDefaults 
 defaultsForModuleWithName:MyModuleName];
 NSURL*  url = [defaults 
 URLForKey:kImageFolderPathPrefKey];

 I tried calling [defaults synchronize] after registerDefaults, but that 
 didn't help. I also tried creating a mutable dictionary and adding the url 
 and integer via setObject:forKey:. No matter which method I use to create the 
 defaults, I can definitely *see* the url in the defaults object, but it comes 
 out nil when I ask for URLForKey. If I actually go through the System 
 Preferences window and set my screen saver's prefs from there, then the url 
 comes out as a valid value.

 What am I doing wrong?

AFAIK, you can't save a NSURL instance in the defaults/preferences of
an application using a NSDictionary or NSArray that contain a NSURL
object. You have to use the setURL: forKey: for it work.

Personally, I've given up thinking about using NSURL in defaults for a
screen saver and just use a NSString with the absolute path.

___

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: Turning off screen shot ability

2013-03-07 Thread Stephane Sudre
On Wed, Mar 6, 2013 at 9:43 PM, Brad O'Hearne br...@bighillsoftware.com wrote:
 2. NSWindow allows you to specify the level of access other processes have to 
 the window's content. Aside from the fact that is seems a bit bizarre that 
 there's the ability to grant no access (NSWindowSharingNone, which doc states 
 should prevent the window's contents to be read by another process), and a 
 screen shot still works, the mere presence of this configurable parameter 
 acknowledges the potential need of an app to secure its displayed content. 
 Therefore, it doesn't seem such a stretch to imagine that if a window's 
 contents were secured, that screen shots would follow right along as 
 something desired to be turned off.

Does this restriction work for the screencapture command line tool?

___

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: 2 icons showing in dock

2013-02-27 Thread Stephane Sudre
On Wed, Feb 27, 2013 at 9:27 AM, Rick C. rickcort...@gmail.com wrote:
 Hi,

 When a customer adds my app to Login Items in System Preferences it 
 (sometimes) causes my app to launch showing 2 icons in the dock after a 
 restart.  Only one instance is running (Activity Monitor) and only one icon 
 shows in Command-tab.  What normally happens is if my app icon is in the dock 
 let's say somewhere in the center area when the 2nd icon appears it will 
 appear at the far right.  Then let's say when you quit the app the icon will 
 still remain (the one on the far right) until you click it and it will 
 disappear.  Does this make any sense at all and does anyone know what could 
 cause this behavior?  Thanks,

For the each of item in the Dock:

1. ctrl + click on the item
2. Choose Options  Show in Finder

It will probably show 2 different instances (locations) of the application.

___

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: nswindow close button for my splitview does not display cross while mouse hover

2012-10-16 Thread Stephane Sudre
On Tue, Oct 16, 2012 at 9:35 AM, Sanjay Arora saar...@quark.com wrote:
 Hi,
 I am creating a  new Button like the window's close button to attach it to my 
  splitview to give is same close action.

 The problem is the button does not displays cross while I the hover mouse 
 over it.

 NSButton *closeControl = [NSWindow standardWindowButton:NSWindowCloseButton 
 forStyleMask:[myNSWindow styleMask]];
 [myNSView addSubview: closeControl];

 Setting it as highlight does not help, it showsup the pressed state. Is there 
 a setting that I am missing?

It's a bug/limitation of the AppKit since this API was introduced.
There's no real easy way to get the hovered state.
___

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: Sandboxing die.die.die

2012-08-30 Thread Stephane Sudre
On Thu, Aug 30, 2012 at 1:59 AM, Greg Parker gpar...@apple.com wrote:
...
 OS X does not require sandboxing. For apps that are not sandboxed, 
 traditional file access is unchanged. Mountain Lion's Gatekeeper can be 
 configured to require signed apps, but it does not enforce sandboxing.

Somehow, Gatekeeper can be configured to require sandboxed apps (and
only some of them actually).

When the option to only accept applications from the Mac App Store is
on, this somehow implies that the applications will (*) be sandboxed
(since they are to be sandboxed to be submitted to the Mac App Store).



(*) at the time of this writing, insert a probably since previously
non-sandboxed apps are still available through the Mac App Store.
___

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: Sandboxing die.die.die

2012-08-22 Thread Stephane Sudre
On Wed, Aug 22, 2012 at 5:18 PM, Alex Zavatone z...@mac.com wrote:
 Regarding Sandboxing on Mac OS or iOS, the situations I want to see addressed 
 are these:

 The app gets regularly updated.  Preferences must exist out side of the app.  
 What easy and straightforward method that does not require the developer to 
 jump through hoops supports preservation of app preferences when an app may 
 be deleted or upgraded WITHOUT using the cloud, as this is completely in 
 violation of many companies' policies.

 If you never ever submit apps to the app store, or you have your own managed 
 app store and develop apps solely for the enterprise, and never mass market 
 apps, then be it on iOS or Mac OS, you are expected to have access outside of 
 the sandbox.  It is expected that you will have access to the device and 
 different folders to create useful software.

I don't see why you have to care about the Sandbox in the case you
describe. The only issue there could be so far at that time is you
would have to codesign/productsign your application/installation
packages for 10.8 and pay the Gatekeeper rent.

Moreover, Gatekeeper is so easy to work around when you have control
on the way your application is deployed (which you seem to have in the
case you describe) that you could even get away without
codesigning/productsigning your products for OS X 10.8.

___

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: Drag-and-drop crashes

2012-07-30 Thread Stephane Sudre
On Mon, Jul 30, 2012 at 10:31 PM, McLaughlin, Michael P.
mp...@mitre.org wrote:
 I have a Mac OS app that worked fine in Snow Leopard.  In moving up recently 
 to Lion, I also moved up to Xcode 4.4 and recompiled the app, targeting 10.6 
 but without otherwise changing the source code.   I got two problems when 
 running the resulting app under Lion.

 I fixed the first problem by deselecting the restorable checkbox in all the 
 windows.

 My remaining problem is that drag-and-dropping an input file crashes the app. 
  Likewise, opening the app by double-clicking its input file also crashes.  
 Opening input files from within the app does not cause a crash; everything 
 works perfectly in that case.

 Since the docs are voluminous, could anyone suggest where I should start 
 looking?  Clearly, something here has changed since Snow Leopard.

I would tend to believe that you should do what BugReporter requires
when a crash is being reported: provide the crash report (or the
interesting part). Otherwise, it's difficult to guess where the
problem is coming from.

___

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: Quit helper app when main app terminates

2012-07-12 Thread Stephane Sudre
On Thu, Jul 12, 2012 at 9:33 AM, Jerry Krinock je...@ieee.org wrote:
 What is the best way to make a helper app quit when the associated main app 
 quits (or crashes)?  No harm will be done if it keeps running for a minute or 
 so.

A solution that does not involve killing the helper application from
the main application:

Observe the end of the main application from the helper application.

[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
selector:@selector(apocalypseNow:)
name:NSWorkspaceDidTerminateApplicationNotification];

[...]

- (void) apocalypseNow:(NSNotification *) inNotification
{
NSRunningApplication * tRunningApplication=[[inNotification
userInfo] objectForKey:NSWorkspaceApplicationKey];

if ([[tRunningApplication bundleIdentifier]
isEqualToString:@the.bundle.identifier.of.the.main.application]==YES)
[NSApp terminate:self];
}
___

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: CFPreferences and Mountain Lion

2012-06-22 Thread Stephane Sudre
On Thu, Jun 21, 2012 at 10:27 PM, Scott Ribe
scott_r...@elevated-dev.com wrote:
 I'm not sandboxed, and the preferences I'm sharing are between my own apps. 
 Also it variously works then doesn't work for a while on the same machine, 
 same OS release, same app build.

Can you post a small sample code showing how you save and read your preferences?

Are you calling CFPreferencesSetAppValue, CFPreferencesSetMultiple or
CFPreferencesSetValue? Are you calling CFPreferencesAppSynchronize?
___

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 get SDK 10.5 on XCode 4?

2012-06-05 Thread Stephane Sudre
On Tue, Jun 5, 2012 at 1:39 AM, Jens Alfke j...@mooseyard.com wrote:

 On Jun 4, 2012, at 3:58 PM, Vojtěch Meluzín wrote:

 But I want to generate builds for
 10.5 SDK, but using the new GCC. XCode 4 installer created SDKs for 10.6
 and 10.7, how can I get the 10.5 SDK?

 You'll need to build with the 10.7 SDK that comes with Xcode. You can still 
 build apps that target 10.5 as long as you don't use any newer APIs; just set 
 the Deployment Target build setting to 10.5.

You also need to change the deployment target for each xib file you create.

On Tue, Jun 5, 2012 at 12:58 AM, Vojtěch Meluzín
meldaproduct...@gmail.com wrote:

 I just upgraded to Lion and XCode 4, because the previous version of GCC
 distributed with XCode 3 was just buggy.

Switching from a good version of the IDE with a supposedly buggy gcc
version to a version of the IDE that's well known for being buggy is a
strange move when you do need to support Mac OS X 10.5 and later.

___

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: Sandboxing and helper apps

2012-05-30 Thread Stephane Sudre
On Wed, May 30, 2012 at 3:28 AM, Todd Heberlein todd_heberl...@mac.com wrote:
  In the past you could include a full UNIX application inside a Mac 
 application bundle. For example, in the directory

        MyApp.app/Contents/MacOS

 could be the Cocoa executable MyApp and the UNIX executable my_helper_app.

 In addition to running this helper app from the Cocoa app, this UNIX app 
 could be launched by the command line from a Terminal application

        $ /Applications/MyApp.app/Contents/MacOS/my_helper_app -i 
 /Users/Todd/some_file

 or via a launchd configuration to be run in the background when I log in.


 Is this functionality no longer allowed with Sandboxing?

It's allowed. IIRC, when the helper app is launched from the main
application, it inherits the entitlements/restrictions of its parent.

___

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: Sandboxing and helper apps

2012-05-30 Thread Stephane Sudre
On Wed, May 30, 2012 at 4:20 PM, Todd Heberlein todd_heberl...@mac.com wrote:

 On May 30, 2012, at 4:53 AM, Stephane Sudre wrote:

 It's allowed. IIRC, when the helper app is launched from the main
 application, it inherits the entitlements/restrictions of its parent.

 I thought (and I'm barely getting up to speed on this) if the program was 
 launched as an NSTask, it would inherit the entitlements  container of the 
 parent. If it was launched as an XPC service it would have its own 
 entitlements and container.

 But… if the program is launched from a Terminal window or by launchd (e.g., 
 scheduled to run at midnight), what then?  Does it run like a normal UNIX 
 program with no sandboxing?  What if this UNIX helper app is copied to a 
 different directory?  Does Apple forbid a program from MAS that can be 
 launched this way or if the developer induces its users to run it this way?

I would believe this is the same case as for code-signing. Every
executable must define its entitlements.

___

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: Sandboxing and calling Launchctl

2012-05-29 Thread Stephane Sudre
On Tue, May 29, 2012 at 10:52 AM, Mark Allan
markjal...@blueyonder.co.uk wrote:
 Hi all,

 I posted this to the developer forums yesterday but I think this list 
 probably gets a good bit more eyeball than the forum, so I'm sending here 
 too. Sorry for the cross-post if you're seeing it twice.  Anyway...

 I'm trying to put together the last bits and pieces of sandboxing my app but 
 I've just hit a problem.  I don't appear to be able to use launchctl to 
 schedule tasks any more.

 With my app sandboxed, I'm launching an NSTask with the following launch path 
 and arguments:
 /bin/launchctl load -w /Users/mark/Library/Containers/my app 
 identifier/Data/Library/LaunchAgents/my app identifier.helpername.plist


 I'm using the correct APIs to get the path and read/write the 
 helpername.plist file.  As per other command line tools I launch via NSTask, 
 launchctl is presumably inheriting the same entitlements as my main 
 application, but launchctl obviously needs to modify other files to which my 
 app normally wouldn't have access - namely:[...]

SMLoginItemSetEnabled can be a solution.

https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html

___

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: NSView + NSScrollView, not scrolling

2012-05-05 Thread Stephane Sudre
A question that could give a better idea of the issue:

Is the scroller thumb visible?

On Sat, May 5, 2012 at 12:31 AM, qvacua qva...@gmail.com wrote:
 I have got a very basic question about NSScrollView. I embedded my
 custom NSView into an NSScrollView using Xcode's Embed In... menu
 item. The following is my custom NSView:

 @implementation MyView

 - (void)drawRect:(NSRect)dirtyRect {
    [[NSColor yellowColor] set];
    NSRectFill([self frame]);
 }

 - (void)keyDown:(NSEvent *)theEvent {
    unichar key = [[theEvent characters] characterAtIndex:0];
    NSLog(@\\U%X pressed, (int)key);

    [self interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
 }

 - (BOOL)acceptsFirstResponder {
    return YES;
 }
 @end

 In applicationDidFinishLaunching: I set the frame size of the view
 to something big using setFrameSize.

 What I want — but now working — is scrolling via Page Up/Down key. If
 I understand the doc correctly, I just have to call
 interpretKeyEvents: like above  and since MyView does not respond to
 appropriate messages, the responder chain will forward the messages to
 the scroll view. However, it does not scroll. What am I missing?

 Thanks in advance.

___

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 set the foreground and background colors of selected text in a field editor (NSTextView)?

2012-04-10 Thread Stephane Sudre
Interesting problem.

I'm afraid one of the easier solutions is to use a NSTextView instead
of a NSTextField. When you set the selectedAttributes of the field
editor, I believe it will be forgotten as the field editor will try to
mimick the way the text look like when not edited, (Sure the doc says
these attributes are OK but they are for the NSTextView that will be
edited AFAIK).

Allowing rich text, subclassing NSTextField and add some methods from
NSTextView did not work so far. No obvious private API for this in the
AppKit.

On Tue, Apr 10, 2012 at 7:51 AM, Michael Crawford
michaelacrawf...@me.com wrote:
 I've tried two different approaches.  The first thing I tried was to make may 
 app-delegate the delegate for my window and then implement 
 -windowWillReturnFieldEditor:toObject:.

 - (void)awakeFromNib
 {
    _fieldEditor = [NSTextView new];
    [_fieldEditor setFieldEditor:YES];

    NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                [NSColor redColor], 
 NSBackgroundColorAttributeName, /* something obvious so I can see it */
                                [NSColor yellowColor], 
 NSForegroundColorAttributeName,
                                nil];
    [_fieldEditor setSelectedTextAttributes:attributes];
 }

 - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client
 {
    if ( [client isKindOfClass:[NSTextField class]] )
    {
        return _fieldEditor;
    }

    return nil;
 }

 Next, I tried something I found in a blog via Google at 
 http://www.ff00aa.com/fr/archives/2009/02/28/9969-changing-the-selected-text-s-color-for-an-nstextfield/.

 - (void)viewDidMoveToWindow:(NSWindow *)window
 {
    if ( window != nil )
    {
        NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                    [NSColor redColor], 
 NSBackgroundColorAttributeName,
                                    [NSColor yellowColor], 
 NSForegroundColorAttributeName,
                                    nil];

        // object-shadow text-field
        NSTextView *fieldEditor = (NSTextView *)[window fieldEditor:YES 
 forObject:_shadowTextField];
        [fieldEditor setSelectedTextAttributes:attributes];

        // vignette text-field
        fieldEditor = (NSTextView *)[window fieldEditor:YES 
 forObject:_vignetteTextField];
        [fieldEditor setSelectedTextAttributes:attributes];

        // opacity text-field
        fieldEditor = (NSTextView *)[window fieldEditor:YES 
 forObject:_opacityTextField];
        [fieldEditor setSelectedTextAttributes:attributes];
    }
 }

 End result: In both cases I get the default white on cyan or whatever color 
 you call it.  Anyone have a technique that works or some experience with this 
 type of modification?

 -Michael
 ___

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

 This email sent to dev.iceb...@gmail.com

___

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

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

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

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

Re: How to set the foreground and background colors of selected text in a field editor (NSTextView)?

2012-04-10 Thread Stephane Sudre
With the delegate method, you get the appropriate NSTextView field
editor. The issue is that you're not editing this NSTextView, you're
editing the NSTextField.

At least that's my take on this.

On Tue, Apr 10, 2012 at 12:09 PM, Kyle Sluder k...@ksluder.com wrote:
 On Apr 10, 2012, at 11:29 AM, Stephane Sudre wrote:

 Allowing rich text, subclassing NSTextField and add some methods from
 NSTextView did not work so far.

 Subclassing NSTextField and implemented -setUpFieldEditor didn't do the trick?

 --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: TextView cannot Use Selection for Find

2012-04-07 Thread Stephane Sudre
On Sat, Apr 7, 2012 at 10:23 AM, Gerriet M. Denkmann
gerr...@mdenkmann.de wrote:
 I have a window with an NSTextView (inside a ScrollView).
 Everything works as expected, but when I select some text and do command-e it 
 just beeps.
 Same for Find Next and Find Previous.
 (Edit → Find → has these commands grayed out).

 Using Find Bar or Find Panel makes no difference. Making it editable or not 
 also not.

 How can I make this work? I have used NSTextView many times before, and they 
 just did work.

 10.7.3, Xcode 4.3.2.

It looks like it beeps when there is no active selection or when the
textview is not the first responder.

Might be worth checking if you don't have some validateMenuItem code
disabling these menu items too.

___

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: What to use instead of operatingSystemVersionString

2012-02-24 Thread Stephane Sudre
If this is an AppKit related bug then you could check the
NSAppKitVersionNumber if a newer version was released for 10.6.1 that
solved the issue.

On Fri, Feb 24, 2012 at 7:56 AM, Gerriet M. Denkmann
gerr...@mdenkmann.de wrote:
 The documentation says of NSProcessInfo operatingSystemVersionString:
 This string is not appropriate for parsing. But if fails to mention what to 
 use instead.

 So what should I use? Gestalt? Or is there some more convenient Cocoa 
 alternative?

 (I need this info for a bug workaround which occurs only in 10.6.)


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

 This email sent to dev.iceb...@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: Localization for nibs

2012-02-18 Thread Stephane Sudre
On Thu, Feb 16, 2012 at 4:37 AM, Satyanarayana Chebrolu
satyanaraya...@ivycomptech.com wrote:
 Hi,
 currently my application supports only English. In the future versions we 
 would like to have it in around 15 languages.

 What is the best practice for having localized nibs.

 1) Common approach, different nibs for different languages.
  +ve, straight forward.
  -ve, Time consuming and maintenance effort.
 2) By using Auto layout feature.
  +ve, available only in Lion
  -ve, not in Leopard and Snow Leopard

Some things that could be useful to make your decision:

- When in Rome, do as the Romans do: check what Apple does. As far
as I know, they are still localizing with multiple nibs.

- Check what the guys who will localize the software would rather use.
The localization solutions based on just localizing the strings have
some side issues:

  - you absolutely need to provide context information for all the strings.

  - you generally end up with duplicates in your .strings files (e.g. DL2).

   - it's more difficult to adjust the layout for specific
localization requirements.

   - you absolutely need to provide a working binary, otherwise it's
not possible to do any kind of check.

- With .strings only localization, you're adding code to handle
something that can be done without additional code.

___

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

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

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

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

Re: TextEdit - Open Recent - slow

2012-02-06 Thread Stephane Sudre
On Sun, Feb 5, 2012 at 9:24 AM, Gerriet M. Denkmann
gerr...@mdenkmann.de wrote:
 Since some time when I click in TextEdit:
 File → Open Recent
 it takes a long time for the menu to appear. Sometimes 10 seconds, sometimes 
 7.
 When I do it again it is faster (but not instantaneous as in all other apps).
 When I try it again after some time - it is slow again.

 Is this a known problem? If so, what is the reason?

It can happen also if a secondary disk is in sleep mode.

 As the code for TextEdit is on my disk, I am thinking of investigating this.

Is the source code for the recent version of TextEdit available? I
thought it had been removed for some times from the AppKit examples.

___

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: Square NSWindow corners?

2012-02-02 Thread Stephane Sudre
Have you set some special flags in Interface Builder for this window?
Is is a NSWindow or a NSPanel?

On Thu, Feb 2, 2012 at 2:27 AM, Samuel Williams
space.ship.travel...@gmail.com wrote:
 Hi,

 I seem to be getting some weird artefacts on my sheets:

 http://imgur.com/3L8Hk

 The corners next to the Cancel and Create buttons are not looking so good.

 There is no view affecting this - I removed everything from the window and
 still got the same effect.

 Anyone have any ideas?

 Kind regards,
 Samuel
 ___

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

 This email sent to dev.iceb...@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: Screensaver via App Store?

2012-01-11 Thread Stephane Sudre
On Wed, Jan 11, 2012 at 8:08 AM, Gabriel Zachmann z...@tu-clausthal.de wrote:
 Can someone enlighten me whether / how it would be possible to distribute a 
 screensaver via the Mac App Store?

 What I would like to provide via AppStore is a real screensaver, i.e., one 
 that lives in ~/Library/Screen Savers/ .
 I suppose, I would need to write a little application, the only purpose of 
 which is to copy the screensaver bundle to ~/Library/Screen Savers/.
 Is that correct?

Yes.

Is that the easiest way?

No. The easiest way would be to install the screen saver from the
installation package. But Xcode does not allow this.

 Do you think, Apple might allow such an app into the AppStore?

No, because unless your company name is Apple, Inc, you are not
allowed to distribute what is basically an installer on the Mac App
Store.

So your best course of action is either to wait and see whether Apple
does something to allow screen savers (or Preferences Panes) in the
future on the Mac App Store or you could just start saving money to
perform a hostile takeover of Apple and make the changes you would
need to the Mac App Store policy.

 If so, what would be the easiest way to write such a copy-cat app?

 Also, I am a bit concerned about sandboxing.

As is probably everyone.

 Could that be a problem? (once it's enforced)

No, as most screen savers are good candidates for sandboxing
(exceptions would include the slideshow screen savers).
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Is there any API to detect the WIFI/CELL Signal Strength

2011-08-24 Thread Stephane Sudre
There are both supported and private APIs to get this kind of data.

In Mac OS X 10.6 and later, check the CoreWLAN.framework.

On Wed, Aug 24, 2011 at 5:19 AM, Jens Alfke j...@mooseyard.com wrote:

 On Aug 23, 2011, at 5:38 PM, Sasikumar JP wrote:

 For my education, could you let me know,if there is any API to get the 
 WIFI/CELL signal strength.

 At some level there probably is. I have no idea whether it’s private or not. 
 (Particularly on iOS, which exposes a lot fewer system-level APIs than Mac 
 OS.) And it’s definitely going to be something down at the kernel or IOKit 
 level, not in Cocoa, so I’ll bet you the people who know the answer aren’t on 
 this mailing list.

 http://lists.apple.com has a list of dozens of Apple developer mailing lists; 
 take a look and see if there’s one that seems relevant.

 —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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How do you create a QTMovieView programmatically?

2011-08-19 Thread Stephane Sudre
On Fri, Aug 19, 2011 at 11:51 PM, Seth Willits sli...@araelium.com wrote:
 On Aug 19, 2011, at 2:19 PM, Charles Srstka wrote:

 Looking through the docs for QTMovieView, it seems that not only is its 
 only initializer, -initWithFrame: deprecated, but according to the docs 
 it’s not even available past OS X 10.5. Surely there must be a way to 
 initialize a QTMovieView in code, right? Or is there some other class 
 we’re supposed to use instead of QTMovieView to view AV content?

 Does -initWithFrame: followed by -setMovie: not do the job?

 I haven’t tried it yet, but I would assume this would not be a good way to 
 go about doing it, given that -[QTMovieView initWithFrame:] is both listed 
 as deprecated and also as “Available Mac OS X 10.3 through 10.5” in the 
 docs, suggesting that it probably won’t work at all in 10.6 and up, and even 
 if it did, it’s deprecated.

 So how are we supposed to make a QTMovieView in code?


 Ignore the documentation; it's a bug. Use initWithFrame:

 initWithFrame: used to be explicitly listed in the QTMovieView header, and my 
 guess is when it was removed, it was marked as deprecated in the 
 documentation which was wrong. initWithFrame: is a valid initializer.

Also using QTMovieView initWithFrame: for this project:
http://s.sudre.free.fr/Software/SaveHollywood.html (source code
available on the page).
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to detect Time Machine volume?

2011-08-03 Thread Stephane Sudre
I agree that the idea is to skip the Time Machine directory (current
or old), not the entire partition.

On Tue, Aug 2, 2011 at 8:51 PM, Charles Srstka cocoa...@charlessoft.com wrote:
 On Aug 2, 2011, at 12:37 PM, Stephane Sudre wrote:

 Worse case: an old time machine partition has been replaced by a new
 one. Since the old partition is some kind of a second backup, the user
 has not removed the Time Machine files.
[...]
 Typical scenario: Encountering a Time Machine drive causes a nice and quick
 recursive search through not many files, since most users don’t store too
 many extra files on their Time Machine backup drive.
 In either case, you *will* find the file you need, regardless of whether or
 not there happens to be a Backups.backupdb there.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to detect Time Machine volume?

2011-08-02 Thread Stephane Sudre
This code would work in most cases but is actually unreliable.

Obvious cases: you have 2 text files with these names ar the root of a
partition.
Worse case: an old time machine partition has been replaced by a new
one. Since the old partition is some kind of a second backup, the user
has not removed the Time Machine files.

For Boot Camp, I tend to believe it's possible to get the information
using the statfs API.

For Time Machine, maybe it's safe to get the info from the
/Library/Preferences/com.apple.TimeMachine.plist file (assuming it's
there).


On Tue, Aug 2, 2011 at 5:57 PM, Leonardo Borsten
le...@prepressmiami.com wrote:
 Hello,

 What is the most reliable way to detect in code if a mounted volume is the 
 Time Machine disk?
 Currently I'm using the following code (also to detect a Boot Camp volume):

 - (Boolean)isNotSearchable:(NSString *)volumePath
 {

 NSFileManager *fm = [NSFileManager defaultManager];

        NSString *timemachine = [volumePath 
 stringByAppendingPathComponent:@Backups.backupdb];
        NSString *winSystem = [volumePath 
 stringByAppendingPathComponent:@MSDOS.SYS];

        if ([fm fileExistsAtPath:timemachine]) return YES;
        if ([fm fileExistsAtPath:winSystem]) return YES;

        return NO;
 }

 This works fine on my system. Will this code work reliably on my user's 
 systems? Is there a better way?
 The same question can apply for iDisk and iCloud, probably.

 The reason I need to know is that I have a function using FSCatalogSearch 
 where I definitely don't want to access these type of volumes.

 Thanks!


 Leonardo Borsten
 ___

 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:
 http://lists.apple.com/mailman/options/cocoa-dev/dev.iceberg%40gmail.com

 This email sent to dev.iceb...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to disable double tap on UIWebView

2011-07-11 Thread Stephane Sudre
Is it to disable zooming? Because there's apparently a property for that.

On Mon, Jul 11, 2011 at 2:27 PM, Symadept symad...@gmail.com wrote:
 Hi,

 How can I disabe double tap on UIWebView. I tried to override touchesBegan
 but it is not invoked. Any idea how can I fix this.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


[MapKit] Question regarding a workaround of one of its shortcomings?

2011-05-17 Thread Stephane Sudre
As far as I can tell, OverlayViews are not clickable.

So, I'm subclassing MKMapView and overloading the GestureRecognizers
actions handlers to deal with that.

Considering that these actions handlers are not documented (well, they
are through a quick NSLog output), would doing that be considered
using private APIs by you-know-who?

If it is, is there a more friendly way of doing it? Removing the
current GestureRecognizers and adding my owns might be one but I
haven't checked the GestureRecognizers API in details yet.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: [MapKit] Question regarding a workaround of one of its shortcomings?

2011-05-17 Thread Stephane Sudre
Solved.

Saving the original gesture recognizers and replacing them with other
ones works well.

On Tue, May 17, 2011 at 5:10 PM, Stephane Sudre dev.iceb...@gmail.com wrote:
 As far as I can tell, OverlayViews are not clickable.

 So, I'm subclassing MKMapView and overloading the GestureRecognizers
 actions handlers to deal with that.

 Considering that these actions handlers are not documented (well, they
 are through a quick NSLog output), would doing that be considered
 using private APIs by you-know-who?

 If it is, is there a more friendly way of doing it? Removing the
 current GestureRecognizers and adding my owns might be one but I
 haven't checked the GestureRecognizers API in details yet.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Framework Installation Directory

2011-04-09 Thread Stephane Sudre
If you're not limited by the Mac App Store requirements (for 3rd party
dev), another solution might be to install your framework in
/Library/Frameworks. Of course, this would require an installation
package.

On Friday, April 8, 2011, Mr. Gecko grmrge...@gmail.com wrote:
 I need help with the Installation Directory for a framework that will be 
 shared between a application and 2 daemons within side it. I think I may be 
 able to do it if I were to have the 2 daemons executables in the MacOS path 
 or another folder such as one named Daemons in the Contents folder. I am 
 needing at least 1 of the daemons to be a bundle based daemon as it'll have 
 some UI elements and such. The installation directory that I have been doing 
 is @executable_path/../Frameworks which according to this, it'll go back 1 
 directory from the path of the executable and into the Frameworks directory 
 to find the framework. The reason I am thinking in doing this as a framework 
 is because some of the code I am using will be used in the daemons such as 
 core code.

 Thanks for any help,
 Mr. Gecko
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Distribution via DMG fails

2011-03-31 Thread Stephane Sudre
Not the issue AFAIK. The quarantine flag does not affect the
double-click action on a screen saver module.

My $0.02

On Thu, Mar 31, 2011 at 10:43 AM, Warren Dodge li...@warrendodge.com wrote:
 On Mar 29, 2011, at 1:39 AM, Stephane Sudre wrote:
 Do you know what the testers reporting the issue have all in common?
 ...
 On Tue, Mar 29, 2011 at 9:22 AM, Gabriel Zachmann z...@tu-clausthal.de 
 wrote:
 ...

 I have developed a little program (a screensaver, actually).

 When I send it (just the .saver bundle as-is) to some beta testers via 
 email, everything seems to be fine.

 But when I put it in a DMG, some testers (not all) can't install it!
 They get the error message You cannot use the screen saver on this 
 computer. Contact the developer ...

 I checked and the executable in the DMG is byte-wise the same as the one in 
 the bundle on my disk.


 Perhaps all the users with trouble are using some form of web mail that sets 
 the this file was downloaded from the internet attribute on the dmg?

 Warren
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Distribution via DMG fails

2011-03-30 Thread Stephane Sudre
On Wed, Mar 30, 2011 at 4:04 AM, Gabriel Zachmann z...@tu-clausthal.de wrote:
 Are you sure you're building the application the same way for both cases? If 
 one's a debug build and the other is a release build, then that could 
 explain that you're not getting all architectures in one case.

 Yes, I am sure about that.
 I built the screensaver, then put this very screensaver into a DMG.
 I then sent both the screensaver and the DMG to the tester.

 Here is what he tried:
 
 I just double click on the screensaver in the the DMG.
 The double click on DMG still cause error I sent you.
 Double clicking on the .saver file from email works fine.
 Moving the .saver in the DMG to desktop before double click does not work 
 either.
 However, moving the .saver from DMG to /Library/Screen Saver/ manually and 
 then opening the System Preference works.
 

 Any ideas, what might be going on?

Check the Info.plist file of your screensaver. You might be missing some keys.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Distribution via DMG fails

2011-03-29 Thread Stephane Sudre
Do you know what the testers reporting the issue have all in common?

Have you asked them to check the Console logs?


On Tue, Mar 29, 2011 at 9:22 AM, Gabriel Zachmann z...@tu-clausthal.de wrote:
 I don't know if this is the correct forum, so please advise if there is a 
 more suitable one.

 I have developed a little program (a screensaver, actually).

 When I send it (just the .saver bundle as-is) to some beta testers via email, 
 everything seems to be fine.

 But when I put it in a DMG, some testers (not all) can't install it!
 They get the error message You cannot use the screen saver on this computer. 
 Contact the developer ...

 I checked and the executable in the DMG is byte-wise the same as the one in 
 the bundle on my disk.

 Does anyone have an idea, what might be going on?

 All kinds of insights, tips, and suggestions will be highly appreciated.

 Best regards,
 Gabriel.

 PS:
 For that it's worth, here is an outline, how I create the DMG:

 hdiutil create $dmg_file -megabytes $image_size -volname $volume_name -fs 
 HFS+ -quiet
 hdiutil attach $dmg_file -readwrite -noautoopen -mountpoint $mount_point 
 -quiet
 cp -R $binary Help_ReadMe_Changelog.rtf LICENSE.html $mount_point
 .. copy background image to the DMG
 .. set some window attributes, such as size, using osascript
 sync
 hdiutil detach $mount_point -quiet
 hdiutil convert -quiet -format UDBZ -o $dmg_file2 $dmg_file



 ___

 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:
 http://lists.apple.com/mailman/options/cocoa-dev/dev.iceberg%40gmail.com

 This email sent to dev.iceb...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Books covering iOS security issues

2011-03-16 Thread Stephane Sudre
I haven't read it so it's just to add a reference to the list:

Professional Cocoa Application Security
Graham J. Lee, Wrox, 2010
ISBN 978-0-470-52595-1, £33.99
http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470525959.html
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


NSShowNonLocalizedStrings?

2011-02-01 Thread Stephane Sudre
Is the NSShowNonLocalizedStrings default values supposed to work as
described in the documentation?

If you set this default to YES (in the global domain or in the
application’s domain), then when the method can’t find a localized
string in the table, it logs a message to the console and capitalizes
key before returning it.

From what I've experienced, when this key is set to YES, almost all
the localized strings are displayed upper-case in the UI (even the
ones in nib files).
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: LOCATING MEDIA FILES IN MACINTOSH

2011-01-06 Thread Stephane Sudre
1) You should probably get a Google Laptop to solve this caps lock issue.

2) There's a framework for your media question:

http://www.karelia.com/imedia/

On Thu, Jan 6, 2011 at 12:54 PM, Abhinav Tyagi abhityag...@gmail.com wrote:
 Hi All,

 Although this querry may seem simple to you but since i dont have any idea
 about it,
 i am clueless as how to approach.

 Problem: Scanning the disc for media files. As the media files can be
 present anywhere
 in the disc, searching whole disc by enumerating the directory listings will
 be very tedious
 i guess (like combining ls and grep in the terminal).

 1) I need an efficient approach to solve this problem using Cocoa or C++.
 (very Important)
 2) How will check a file if its a valid media file or data file. Like we can
 have .dat files that
    are video files but data files can also have .dat extension. not much
 significant. Is there
    api that can tell whether a file is media file or not? (not s
 important).

 Thanks in advance for your help.



 Abhinav Kumar Tyagi
 www.verizon.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


UTI for ScreenSaver, Automator Actions and PreferencePanes?

2010-12-18 Thread Stephane Sudre
Which UTIs are supposed to be used for CFBundleDocumentTypes 
LSItemContentTypes for :

- Screen Savers

- Automator Actions

- PreferencePanes

?

I want to be able to drag and drop them on an application icon.

I'm looking into getting rid of the CFBundleTypeExtensions array in my
Info.plist.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


[NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5

2010-11-22 Thread Stephane Sudre
According to the NSDate.h header:

- (id)dateByAddingTimeInterval:(NSTimeInterval)ti
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

Problem is when I run the following code on Mac OS X 10.5 on a
PowerMac G5, I get the result listed below.

#import Foundation/Foundation.h

int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSLog(@dateByAddingTimeInterval: %@,[[NSDate date]
dateByAddingTimeInterval:24*60*60]);

NSLog(@addTimeInterval: %@,[[NSDate date] addTimeInterval:24*60*60]);
[pool drain];
return 0;
}


$ ./TestAPIDate
2010-11-22 16:59:15.900 TestAPIDate[4192:10b]
dateByAddingTimeInterval: 2020-10-13 09:58:31 +0200
2010-11-22 16:59:15.901 TestAPIDate[4192:10b] addTimeInterval:
2010-11-23 16:59:15 +0100

So it looks like this API is broken on Mac OS X 10.5 and should not be
said to be available for Mac OS X 10.5 in the 10.5 SDK Headers.

Am I missing something obvious? (I will file a bug report later if I'm
not missing anything).
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: [NSImage] Bug in System Preferences? [solved]

2010-10-26 Thread Stephane Sudre
On Tue, Oct 26, 2010 at 4:14 AM, Gregory Weston gwes...@mac.com wrote:
 Iceberg-Dev wrote:

 When working with NSBitmapImageRep, calling -bitmapData is a signal
 that you may be editing the data. It is not repackaged until the
 bitmap is drawn, or somesuch. It's illegal to just stash a pointer
 to the data and use it arbitrarily later - that won't necessarily
 be the same data as now backs the image. This is described in the
 10.6 AppKit release notes.

 Calling -bitmapData works on Mac OS X 10.5, it does not work on Mac
 OS X 10.6. On 10.6, it's slow and the data gets zeroed. Bug?

 It would seem, but where is uncertain. I just threw something together to 
 access every byte of a 3MPixel image sequentially. It consistently took just 
 over 0.02s and did not result in data loss.

Well, on my MacBook Pro:

- it's slow
- it zeroes the data

and it crashes:

0   libSystem.B.dylib   0x7fe006c5 __bzero + 197
1   com.apple.Foundation0x7fff87909245
-[NSConcreteMutableData setLength:] + 214
2   com.apple.Foundation0x7fff87909155
-[NSConcreteMutableData initWithLength:] + 404
3   com.apple.AppKit0x7fff86c03eae
NSNewBitmapBackingStore + 220
4   com.apple.AppKit0x7fff86c3e4e2
-[NSBitmapImageRep _fromCGImage:performBlockUsingMutableData:] + 191
5   com.apple.AppKit0x7fff86c03d85
__-[NSBitmapImageRep
_withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke_1
+ 341
6   com.apple.AppKit0x7fff86b2f9a2
-[NSBitmapImageRep _performBlockUsingBacking:] + 45
7   com.apple.AppKit0x7fff86c03c2c
-[NSBitmapImageRep
_withoutChangingBackingPerformBlockUsingBackingMutableData:] + 79
8   com.apple.AppKit0x7fff86c03bc2
__-[NSBitmapImageRep
_performBlockUsingBackingMutableData:]_block_invoke_1 + 125
9   com.apple.AppKit0x7fff86b2f9a2
-[NSBitmapImageRep _performBlockUsingBacking:] + 45
10  com.apple.AppKit0x7fff86c03b41
-[NSBitmapImageRep _performBlockUsingBackingMutableData:] + 79
11  com.apple.AppKit0x7fff86c03aef
-[NSBitmapImageRep getBitmapDataPlanes:] + 79

Without calling - bitmapData, it's reasonably fast and does not crash.


Can you post your sample code?
___

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

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

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

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


Re: remove icon from Dock

2010-10-13 Thread Stephane Sudre
On Tue, Oct 12, 2010 at 9:50 PM, Charles Srstka
cocoa...@charlessoft.com wrote:
 and the Dashboard server gets killed, terminating all active Dashboard 
 widgets.

Is it an issue?
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Make checkbox in table view uneditable

2010-09-15 Thread Stephane Sudre
On Wed, Sep 15, 2010 at 4:29 AM, Keary Suska cocoa-...@esoteritech.com wrote:

 On Sep 14, 2010, at 5:59 PM, Shane Stanley wrote:

 I have a table view using Cocoa bindings, and all columns have editable
 turned off in the Attributes panel. However one column, which contains a
 checkbox cell, steadfastly remains editable.

 I've also tried binding its editable property to a boolean property set to
 NO, but that made no difference.

 Is there some other way I can make a column of checkboxes uneditable, or is
 this a bug?

 Checkboxes aren't edit controls, they are buttons, and to my knowledge don't 
 even have an editable property (even though the table column has such a 
 binding). To prevent changing a button state (without significant 
 subclassing) you must disable it. In this case, of course, we are talking 
 about NSCells.

IIRC, it does not require significant subclassing. Maybe 1 or 2 short methods.

Anyway, this is indeed only interesting in very uncommon cases as a
user will usually expect a checkbox to be clickable if it's enabled.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Continuous animation locks UI?

2010-09-07 Thread Stephane Sudre
Not sure if this is the same on iOS but in Mac OS X, you can call -
[NSRunLoop addTimer: forMode:] on the current run loop.
NSEventTrackingRunLoopMode would be a good candidate.

On Tue, Sep 7, 2010 at 6:32 AM, Dave DeLong davedel...@me.com wrote:
 Hi everyone,

 I'm working on an iPhone app, and I'm trying to make the title in the 
 navigation bar scroll.  I've got a UIView subclass that I wrote that, given a 
 string, will lay out some UILabels and then animate a frame change to give 
 the appearance of scrolling.  This works just fine.  I instantiate one of 
 these scrolling label objects and set it as the titleView property of my 
 viewController's navigationItem.  This also works fine, and the title scrolls 
 as expected.

 The problem is that the entire UI is totally unresponsive.  Nothing registers 
 user interaction.  My timers still fire, the UI can get updated 
 programmatically, but gestures, taps, swipes, etc are all totally ignored.  
 Even the UIBarButtonItems in the navigationItem are unresponsive.

 If I take out my scrolling text view, everything works fine (except I 
 obviously don't have a scrolling title).  As soon as I put it back in, the UI 
 goes dead.

 I'm doing the animations with the 4.0 UIView block-based animation API.  I 
 tried using an NSTimer to animate frame changing, but parts of my app 
 require dragging for user interaction.  The dragging would prevent the timer 
 from firing at consistent intervals, resulting in the scrolling slowing down 
 dramatically.  As far as I'm aware, the only reasonable way to animate a user 
 interface element without interfering with the main thread's run loop is with 
 CoreAnimation and layers (correct?).

 So:

 Why would my scrolling text view be killing my UI?  What can I do to get 
 around this?

 (For reference, the implementation of my ScrollingTextView is here: 
 http://pastie.org/1142995 , along with a relevant UIView category)

 Thanks,

 Dave
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


[NSTextView] Is there a workaround for Snow Leopard new word selection behavior/bug?

2010-09-02 Thread Stephane Sudre
Case:
-

I need to detect double-click on a word when the alt key is hold down
(to do something similar to what Xcode does).

To do this I subclassed NSTextView and implemented a custom the
mouseDown: method (that calls the super method, don't panic).

This works fine on Mac OS X 10.4.x and 10.5.x.

Problem:


This does not work as well in Mac OS X 10.6.

Because when you double-click on the word myclass in a text like this:

myclass.mymethod

this selects myclass.mymethod.

On previous OS versions, only myclass was selected.

Question:
-

Is there a way to revert to the previous/right behavior?

I looked in the documentation which is full of set/is methods but not
the one I'm looking for as far as I can tell.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: [NSTextView] Is there a workaround for Snow Leopard new word selection behavior/bug?

2010-09-02 Thread Stephane Sudre
It's a good solution if you need in which direction you need to shrink
the selection. But I can't know that.

On Thu, Sep 2, 2010 at 12:57 PM, vincent habchi vi...@macports.org wrote:
 Le 2 sept. 2010 à 21:42, Stephane Sudre a écrit :


 This does not work as well in Mac OS X 10.6.
 Because when you double-click on the word myclass in a text like this:

 myclass.mymethod

 this selects myclass.mymethod.

 On previous OS versions, only myclass was selected.

 You can add a delegate to your NSTextView that will intercept the proposed 
 selection and shrink it. That's what I do with my custom SQL text view: it 
 extends selections ending in the middle of a keyword to its end. What you try 
 to do is somehow the contrary, but it should not be much more difficult.

 Check: -(NSRange)textView: willChangeSelectionFromCharacterRange: 
 toCharacterRange:

 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ANN: Syntax highlighting editor view

2010-06-02 Thread Stephane Sudre
Which license? One file mentions Apache, others don't.

On Wed, Jun 2, 2010 at 12:53 PM, jonat...@mugginsoft.com
jonat...@mugginsoft.com wrote:
 From time to time the issue of syntax highlighting/colouring is raised on the 
 list.

 Fragaria is framework based on Smultron (now Fraise) that provides a simple 
 way of embedding a syntax aware editor in an application.

 The project includes a simple demo application that illustrates how to embed 
 a Fragaria view into an existing hostview.

 The project can be downloaded and forked at:

 http://github.com/mugginsoft/Fragaria
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Weird iPhone OS 4.0 Library dialog popping up

2010-05-05 Thread Stephane Sudre
The iPhone OS 4 SDK is probably under NDA. You should probably use the
Developer Forums on the ADC website instead.

On Wed, May 5, 2010 at 1:49 PM, Tino Rachui tino.rac...@googlemail.com wrote:
 I've installed beta 3 of the new iPhone OS 4 SDK. From time to time a dialog 
 pops up now titled iPhone OS 4.0 Library - To download this update, log in 
 to Apple Developer Connection at connect.apple.com. Your login information 
 will be sent securely. asking me for name and password. This looks extremely 
 suspicious to me. Has anyone an explanation for that?

 Thanks in advance,
 Tino
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSDistributedNotificationCenter and Launchd

2009-01-09 Thread Stephane Sudre


On Jan 9, 2009, at 12:58 AM, Aaron Scott wrote:

I have a background process that when started manually talks  
correctly with the GUI app using NSDistributedNotificationCenter.


However, once I use launchd to start it as a LaunchDaemon I get no  
receiving of notifications from either the daemon or the GUI app.  
Is there a way to get the notifications to come through or is it  
near impossible?


You can send distributed notifications from the daemon to the GUI app  
if you use the flag to send the notification to all user sessions.


But it will not work the other way.


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: [NSOutlineView/NSTableView] Returning nil enables auto-edition?

2008-06-18 Thread Stephane Sudre


On Jun 13, 2008, at 11:23 AM, Corbin Dunn wrote:


You probably mean, editing (not edition).


Certainly.



[...]
- (BOOL) outlineView:(NSOutlineView *) inOutlineView  
shouldEditTableColumn:(NSTableColumn *) inTableColumn item:(id)inItem


First off -- 10.4 *requires* a double click to begin an editing  
session. Are you sure you aren't manually starting the editing by  
calling - (void)editColumn:(NSInteger)column row:(NSInteger)row  
withEvent:(NSEvent *)theEvent select:(BOOL)select;


In fact, you can break on that method and see when it is invoked,  
and look at the bt to figure out why.


No, I checked the source.


Is it a bug or just an unsupported scenario?


I don't think it should happen the way you described, see the notes  
above. Really, you should return non-nil from the method. I have a  
feeling something else is going on.


This is the solution I used to fix the issue.


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


[NSOutlineView/NSTableView] Returning nil enables auto-edition?

2008-06-13 Thread Stephane Sudre

Mac OS X 10.4.11 (PPC)

I'm seeing a potential bug or unsupported behavior when it comes to  
cell edition.


I have a NSOutlineView. One of the column data cell of this view is a  
text field cell which is potentially editable.


Now, if I return nil in

- (id) outlineView:(NSOutlineView *) inOutlineView  
objectValueForTableColumn:(NSTableColumn *) inTableColumn byItem:(id)  
inItem


and then later set the string value (through setStringValue:) in

- (void) outlineView:(NSOutlineView *) inOutlineView willDisplayCell: 
(NSCell *)cell forTableColumn:(NSTableColumn *) inTableColumn item: 
(id) inItem


there's a very weird behavior with leaf rows:

When I select them (first click, it's not like the default behavior  
in 10.5), the text field cell automatically enters edition mode  
without even asking the opinion of


- (BOOL) outlineView:(NSOutlineView *) inOutlineView  
shouldEditTableColumn:(NSTableColumn *) inTableColumn item:(id)inItem



Is it a bug or just an unsupported scenario?


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Tooltip and 10.4.11. Bug?

2008-06-10 Thread Stephane Sudre
Is there  a known bug in Mac OS X 10.4.11 when it comes to tooltips  
attached to a NSTableView rows?


I'm seeing tool tips being cut off when the mouse is over a row and a  
medium length string should be displayed in the tool tip.



___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Main window disappears. Sometimes.

2008-06-03 Thread Stephane Sudre


On Jun 2, 2008, at 19:50, Bill Bumgarner wrote:


On Jun 2, 2008, at 10:31 AM, Michael Vannorsdel wrote:

On Jun 2, 2008, at 5:24 AM, Francis Perea wrote:


Hi Graham, thanks for your reply.

I didn't know I could set any memory setting trough Interface 
Builder!


After your question I looked into and I've seen that it states as 
Beffered.


I've tried to use the Retained option, thinking that this way I 
shouldn't use the retain message, but with Retained the windows 
appears but doesn't accept any interaction.


I'd take a deep look into de Memory Management doc you suggest.


While learning the retain/release paradigm is certainly useful, it is 
considerably more complex than GC.  It is also unnecessary while 
learning Cocoa.   Specifically, GC is intended to be a production 
quality solution that you can use in your Cocoa applications, without 
exception.   In Leopard, there have been a handful of bugs and they 
have been addressed through software updates -- not surprising given 
the rather sweeping and intrusive set of changes needed to support GC. 
  And GC will get better / faster in future releases.


An issue is that the previous releases still exist (retail Mac OS X 
Leopard boxes are still 10.5?) and that someone may need to support 
them. And in these cases, I would consider that retain/release is more 
reliable.


I have a stupid question too. Considering that I sometimes see warnings 
in Console.app related to Garbage Collection, does this mean that:


- the issue is in the application (Xcode sometimes display warnings for 
instance) and not in the GC?


or

- that GC is more complex than retain/release in some cases?

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Main window disappears. Sometimes.

2008-06-03 Thread Stephane Sudre


On Jun 3, 2008, at 18:29, Bill Bumgarner wrote:


On Jun 3, 2008, at 9:20 AM, Stephane Sudre wrote:
An issue is that the previous releases still exist (retail Mac OS X 
Leopard boxes are still 10.5?) and that someone may need to support 
them. And in these cases, I would consider that retain/release is 
more reliable.


Let me re-emphasize one point:  I'm referring to new development.   
Given the APIs and technologies in Leopard, its maturity within the 
marketplace, the sales rate of Macs, the typical multi-month app 
development cycle, and the extremely high upgrade rate for previous 
owners,  targeting new development to Leopard only makes a lot of 
sense.


Targeting Leopard makes sense. I was just referring to Leopard 10.5, 
10.5.1 and 10.5.2 assuming the bugs had been fixed in 10.5.3.


I have a stupid question too. Considering that I sometimes see 
warnings in Console.app related to Garbage Collection, does this mean 
that:


- the issue is in the application (Xcode sometimes display warnings 
for instance) and not in the GC?


or

- that GC is more complex than retain/release in some cases?


The warning you are referring to is likely this one?

6/2/08 11:31:59 AM [0x0-0x4a34a3].com.apple.Xcode[21294] 
Xcode(21294,0xb0103000) malloc: free_garbage: garbage ptr = 0x39f3fb0, 
has non-zero refcount = 1


Affirmative.

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to solve application hang issue?

2008-03-13 Thread Stephane Sudre


On Mar 13, 2008, at 11:43, parag vibhute wrote:


Hi guys,

I have implemented cocoa application in which I am using threading. 
While
running the application hangs in between  I am unable to find out 
where

exactly in code it is hanging. Can you tell me how to debug hang issue?


Thread Viewer, sample, Instruments, Console.app ?

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to make a UI like in Mail?

2008-03-13 Thread Stephane Sudre


On Mar 13, 2008, at 10:04, Thomas Engelmeier wrote:



On 12.03.2008, at 23:54, Thomas Wickl wrote:

I´m new to Cocoa and I really need a hint in UI Design. How can I 
create this Panel like it is shown in a lot of

Application like Mail?



That is not a panel (a panel is a window with a small title bar)


Isn't a window with a small title bar a palette window? I thought a 
panel could either be a standard window used for dialogs or a palette 
window.



And also how do they make this Bar at the Bottom?



The only real answer to that is Use FScript to find out. 
http://www.fscript.org. You'll need to download a separate version of 
FScript Anywhere for Leopard. Apple is usually not eating it's own 
dog food, Apple apps notoriously use their own UI implementation.


If you are interested how _you_ can achieve something similar, there 
is a chance to build a view containing some NSButtons with gradient 
look and either add manually the pulldown functionality to them or use 
an NSPopupButton and tinker with the menu contents so it always shows 
the icon and not the selected item.


The NSActionTemplate and NSAddTemplate should also be handy. Many 
goodies (gradient look, system provided images) are Leopard only.


Well, with only Interface Builder and the Finder (Mac OS X 10.4.11), 
you can find that it's custom views/controls with custom pictures (no 
gradient code AFAIK).


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Check box cell in NSTableView

2008-03-11 Thread Stephane Sudre


On Mar 11, 2008, at 13:15, Ivan C Myrvold wrote:

I can not get my check boxes in an NSTableColumn to show the mixed 
state.
The first time I click an empty check box, it shows as if it is 
checked, it should have been mixed.


A mixed state can not be determined by a click.

What a click should do:

Unchecked - Checked

Mixed - Checked

Checked - Unchecked

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: [newbie] NSTableView - First NSColumn should not be affected by horizontal scrollbar

2008-03-10 Thread Stephane Sudre


On 10 mars 08, at 12:54, Tobias R. wrote:


Hi,

I have a csv-file as datasource for an NSTableView. This part of my
project works.

And now my Question:
Is there a way to make the first NSColumn of my NSTableView ...
a) always visible and
b) not being affected by the horizontal scrollbar, but only the
vertical scrollbar?


Short answer: No.

It might be easier to use 2 NSTableViews side by side, hide the 
vertical scrollbars on the leftmost tableview and synchronize the 
scrolling and selection (both key and scroller) in both tableviews.


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: on launched with cocoa

2008-03-10 Thread Stephane Sudre


On Mar 10, 2008, at 18:28, Mr. Gecko wrote:

Hello, I have done an application with applescript studio and I'm 
trying to make it a cocoa application I had an on launched command 
where it did some things and I can't seem to find a way to do an on 
launched with cocoa I know there is a way.  I already tried - 
(void)awakeFromNib but I can't seem to make it do what I want it to 
do. Is there any other way I can do this?


applicationDidFinishLaunching:

?

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: localizable strings file with macro

2008-03-04 Thread Stephane Sudre


On 4 mars 08, at 11:27, Jean-Daniel Dupas wrote:



Le 4 mars 08 à 11:21, Stephane Sudre a écrit :



On 4 mars 08, at 10:28, Julien Jalon wrote:

1) Might not be a good idea to use CFStringGetCStringPtr as it might  
return

NULL2) kCFStringEncodingMacRoman is likely not a good choice as the
encoding, especially for localized strings

If I were you, I'd do something like (warning: Mail compiled code):
const char* MyGetLocalizedCString(CFStringRef string)
{
   // if you need to be thread safe, add proper locks around that
   static CFMutableDictionaryRef mapping = NULL;
   if(mapping == NULL) {
   mapping = CFDictionaryCreateMutable(NULL, 0,
kCFTypeDictionaryKeyCallBacks, NULL);
   }

   const char* result = (const char *)CFDictionaryGetValue(mapping,
string);
   if(result == NULL) {
CFStringRef localizedString =  
CFCopyLocalizedStringFromTable(string,

CFSTR(LibraryLocalizable), NULL);
result = (const char
*)malloc(CFStringGetMaximumSizeForEncoding(CFStringGetLength(localize 
dString),

kCFStringEncodingUTF8);
CFStringGetCString(localizedString, (char *)result, bufferSize,
kCFStringEncodingUTF8);
CFDictionarySetValue(mapping, string, result);


I'm not sure CFDictionarySetValue would accept a char *.


It accepts whatever you want. You just have to set the corresponding  
callback when you create it. As you can see here, this sample use NULL  
as Value CallBack, so it perfectly valid to set a char *.


You're right. It just seems strange from a memory management point of  
view.



___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


  1   2   >