Re: Status bar item icon is always black

2020-06-20 Thread Georg Seifert via Cocoa-dev
Why do you put the images in an asset catalog? I use PDFs a lot for icons, (in 
my case mostly as Template images). But I just drag them into a groups in Xcode 
and they are copied into the Resource folder. Then you can load them with 
-[NSBundle imageForResource:]. If you have @2x version, they are loaded 
automatically (if they are not combined on build time.
To control if it is a Template, add that string to the file name, or in your 
case, don't add it.
Sometimes I "preload" images early and then do [image setName:@"imageName"]. 
That way you can get it by calling [NSImage imageNamed:@"imageName"] (not sure 
if that is really needed).

Asset catalogs are useful if you need more functionality. e.g. if you actually 
need a .icns files. Or if you have different versions for light and dark mode. 
 
Georg

> On 19. Jun 2020, at 21:54, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I think, I solved the mystery.
> Just for the record, in case someone else stumbles across this 
> (it's probably old news for you guys on this list):
> 
> You can use a vector drawing in a PDF , drag it into the asset catalog (not 
> into the default AppIcon!),
> and load it as if it were a regular image , and it works, even with 
>   itemImage?.isTemplate = false
> (in that case, colors in the icon will be nicely preserved).
> I believe, NSImage() converts it into a bitmap during loading. Maybe, Xcode 
> does it already.
> 
> If you want to load a bitmap image, then do NOT try to populate the default 
> AppIcon with all the resolutions , from 16x16 pixels through 512x512@2x !
> You will get a mostly black-ish status bar icon.
> You would do that for a regular app, but it does NOT work for status bar 
> items.
> 
> You must use a 32x32 image, and this shows fine in color in the status bar.
> If you drag that into the asset catalog, you will get a regular image set in 
> Xcode;
> then you can also populate the 2x and the 3x versions with resolutions of 
> 64x64 and 96x96 bitmaps.
> 
> 
> Best, G.
> 
> ___
> 
> 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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Re: Localization under Catalina

2020-05-27 Thread Georg Seifert via Cocoa-dev
The apps work with either, nibs and Base localisation. The main advantage is 
that it provides an app for the translators and a file format that contains all 
the keys. So you don’t need to send all those .strings files (if you have a 
couple sub projects that gets really messy (I have 40 or 50 plugins and 
frameworks). You send your translators a .loc file, they translate it and send 
the file back. You import it in the Manager app and it will update all your 
.nibs and .strings. Adding a new language to my app took one hour or so on my 
part. Importing new translations takes 1 minute. I wouldn’t be able to have any 
localisation without those tools. 

Georg

> Am 27.05.2020 um 22:51 schrieb Georg Seifert via Cocoa-dev 
> :
> 
> You find them in the releases section in the repo: 
> https://github.com/schriftgestalt/LocalizationSuite/releases 
> 
> Georg
> 
>> Am 27.05.2020 um 21:12 schrieb Eyal Redler :
>> 
>> Thanks! 
>> Do you have perhaps a working distribution of your version?
>> What is the status of the original set of tools? It seems to be working (at 
>> least launching)
>> 
>> Eyal
>> 
>> 
>> 
>>> On 27 May 2020, at 21:17, Georg Seifert via Cocoa-dev 
>>>  wrote:
>>> 
>>> I use the http://www.loc-suite.org for all my localisations. The original 
>>> author is not there any more but I my versions should work: 
>>> https://github.com/schriftgestalt/LocalizationSuite
>>> 
>>> It is very good at keeping existing translations. 
>>> 
>>> Best
>>> Georg Seifert
>>> 
>>> 
>>>> Am 27.05.2020 um 19:30 schrieb Rob Petrovec via Cocoa-dev 
>>>> :
>>>> 
>>>> I have never used AppleGlot.  However, I’m curious why you don’t set up a 
>>>> .lproj for each localization you support containing .strings files with 
>>>> your translated strings inside?
>>>> 
>>>> —Rob
>>>> 
>>>> 
>>>>> On May 27, 2020, at 10:04 AM, Eyal Redler via Cocoa-dev 
>>>>>  wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> It looks like Apple has dropped support for AppleGlot under Catalina. The 
>>>>> latest version (from 2017) will not install on Catalina and links and 
>>>>> mentions to AppleGlot have been removed from their localisation page 
>>>>> (https://developer.apple.com/localization/).
>>>>> 
>>>>> It looks like Apple wants us to use Xcode's localisation tools which is 
>>>>> OK but it doesn't seem to address at all the issue of incremental 
>>>>> localization, my app is already localized in 14 languages and I just need 
>>>>> to add the new strings/nibs and update the changed nibs, not create a 
>>>>> localisation from scratch.
>>>>> 
>>>>> I think that for now I'll switch back to Mojave to build this 
>>>>> localisation using my workflow with AppleGlot but it would be great if I 
>>>>> could run AppleGlot on Catalina, was anyone successful in doing that?
>>>>> Also, is there some support for incremental localisation using the xcode 
>>>>> localization tools? Maybe I'm missing something here
>>>>> 
>>>>> Thanks,
>>>>> 
>>>>> 
>>>>> Eyal Redler
>>>>> 
>>>>> "If Uri Geller bends spoons with divine powers, then he's doing it the 
>>>>> hard way."
>>>>> --James Randi
>>>>> www.eyalredler.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/petrock%40mac.com
>>>>> 
>>>>> This email sent to petr...@mac.com
>>>> 
>>>> ___
>>>> 
>>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>>> 
>>>> Please do not post admin requests or moderator comments to the list.
>>>> Contact the

Re: Localization under Catalina

2020-05-27 Thread Georg Seifert via Cocoa-dev
You find them in the releases section in the repo: 
https://github.com/schriftgestalt/LocalizationSuite/releases 

Georg

> Am 27.05.2020 um 21:12 schrieb Eyal Redler :
> 
> Thanks! 
> Do you have perhaps a working distribution of your version?
> What is the status of the original set of tools? It seems to be working (at 
> least launching)
> 
> Eyal
> 
> 
> 
>> On 27 May 2020, at 21:17, Georg Seifert via Cocoa-dev 
>>  wrote:
>> 
>> I use the http://www.loc-suite.org for all my localisations. The original 
>> author is not there any more but I my versions should work: 
>> https://github.com/schriftgestalt/LocalizationSuite
>> 
>> It is very good at keeping existing translations. 
>> 
>> Best
>> Georg Seifert
>> 
>> 
>>> Am 27.05.2020 um 19:30 schrieb Rob Petrovec via Cocoa-dev 
>>> :
>>> 
>>> I have never used AppleGlot.  However, I’m curious why you don’t set up a 
>>> .lproj for each localization you support containing .strings files with 
>>> your translated strings inside?
>>> 
>>> —Rob
>>> 
>>> 
>>>> On May 27, 2020, at 10:04 AM, Eyal Redler via Cocoa-dev 
>>>>  wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> It looks like Apple has dropped support for AppleGlot under Catalina. The 
>>>> latest version (from 2017) will not install on Catalina and links and 
>>>> mentions to AppleGlot have been removed from their localisation page 
>>>> (https://developer.apple.com/localization/).
>>>> 
>>>> It looks like Apple wants us to use Xcode's localisation tools which is OK 
>>>> but it doesn't seem to address at all the issue of incremental 
>>>> localization, my app is already localized in 14 languages and I just need 
>>>> to add the new strings/nibs and update the changed nibs, not create a 
>>>> localisation from scratch.
>>>> 
>>>> I think that for now I'll switch back to Mojave to build this localisation 
>>>> using my workflow with AppleGlot but it would be great if I could run 
>>>> AppleGlot on Catalina, was anyone successful in doing that?
>>>> Also, is there some support for incremental localisation using the xcode 
>>>> localization tools? Maybe I'm missing something here
>>>> 
>>>> Thanks,
>>>> 
>>>> 
>>>> Eyal Redler
>>>> 
>>>> "If Uri Geller bends spoons with divine powers, then he's doing it the 
>>>> hard way."
>>>> --James Randi
>>>> www.eyalredler.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/petrock%40mac.com
>>>> 
>>>> This email sent to petr...@mac.com
>>> 
>>> ___
>>> 
>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>> 
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>> 
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/georg.seifert%40gmx.de
>>> 
>>> This email sent to georg.seif...@gmx.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/eyal%40mellel.com
>> 
>> This email sent to e...@mellel.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 under Catalina

2020-05-27 Thread Georg Seifert via Cocoa-dev
I use the http://www.loc-suite.org for all my localisations. The original 
author is not there any more but I my versions should work: 
https://github.com/schriftgestalt/LocalizationSuite

It is very good at keeping existing translations. 

Best
Georg Seifert


> Am 27.05.2020 um 19:30 schrieb Rob Petrovec via Cocoa-dev 
> :
> 
> I have never used AppleGlot.  However, I’m curious why you don’t set up a 
> .lproj for each localization you support containing .strings files with your 
> translated strings inside?
> 
> —Rob
> 
> 
>> On May 27, 2020, at 10:04 AM, Eyal Redler via Cocoa-dev 
>>  wrote:
>> 
>> Hi,
>> 
>> It looks like Apple has dropped support for AppleGlot under Catalina. The 
>> latest version (from 2017) will not install on Catalina and links and 
>> mentions to AppleGlot have been removed from their localisation page 
>> (https://developer.apple.com/localization/).
>> 
>> It looks like Apple wants us to use Xcode's localisation tools which is OK 
>> but it doesn't seem to address at all the issue of incremental localization, 
>> my app is already localized in 14 languages and I just need to add the new 
>> strings/nibs and update the changed nibs, not create a localisation from 
>> scratch.
>> 
>> I think that for now I'll switch back to Mojave to build this localisation 
>> using my workflow with AppleGlot but it would be great if I could run 
>> AppleGlot on Catalina, was anyone successful in doing that?
>> Also, is there some support for incremental localisation using the xcode 
>> localization tools? Maybe I'm missing something here
>> 
>> Thanks,
>> 
>> 
>> Eyal Redler
>> 
>> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
>> way."
>> --James Randi
>> www.eyalredler.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/petrock%40mac.com
>> 
>> This email sent to petr...@mac.com
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Re: Finding memory leaks

2020-05-20 Thread Georg Seifert via Cocoa-dev
You need to check the backtrace where the leaking object was created. Sometimes 
it points to a line that has nothing to do with the leak, it is just triggering 
it.

g

> On 20.05.2020, at 16:03, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I have a few stupid questions regarding (potential) memory leaks,
> so please bear with me.
> First of all, my code is ARC managed.
> 
> I tried the Leaks tool of Instruments.
> 
> It tells me, if i understand correctly, that I have a leak at this line of my 
> code:
> 
>CFDictionaryRef fileProps = CGImageSourceCopyPropertiesAtIndex( new_image, 
> 0, NULL ); 
> 
> This line is in a method I declared like that:
> 
> - (void) loadNextImageWithIndex: (unsigned long) next_index image: 
> (CGImageRef *) next_image
>  withProps: (CFDictionaryRef *) next_props
> 
> and at the end of the function, I pass fileProps back like so
> 
>   *next_props = fileProps;
> 
> The caller then makes a copy of next_props for later use, and CFRelease's 
> next_props.
> (That copy is also released later.)
> 
> So it is unclear to me why the Leaks tool thinks that the above line leaks 
> memory.
> 
> 
> 
> Another area of questions is around CALayer's and images.
> I create images like so:
> 
>CGImageRef newImageRef = CGImageSourceCreateThumbnailAtIndex( new_image, 0,
>   (__bridge 
> CFDictionaryRef) imageOpts );
> I store newImageRef in an array (history_of_images).
> Then, I assign newImageRef to a CALayer like this:
> 
>imgLayer.contents = (__bridge id)(newImageRef);
> 
> At some point later, when the layer is no longer part of the layer hierarchy, 
> I release it like this:
> 
>   CGImageRelease( history_of_images[k].img );
> 
> Can you spot any point in this sequence where there could be a memory leak?
> Does any of the assignments I described create a copy?
> Should I release CALayer's myself after I have removed it from its super 
> layer?
> By the growth of the memory usage of my app I suspect that the images I've 
> been loading keep lingering on somewhere in memory.
> 
> 
> Another area of questions centers around dispatch queues.
> The above stuff (loading, thumbnail creation) is, mostly, done in a 
> background thread via dispatch_async.
> I have tried to put an @autoreleasepool around the code that runs in the 
> background thread, to no avail.
> (My code is under ARC.)
> 
> But in Instruments, all indications (e.g., Heaviest stack trace) point to 
> CGImageSourceCreateThumbnailAtIndex, that shows a stack trace like that:
> 
>  13 libdispatch.dylib  269.42 KB _dispatch_client_callout
>  12 ArtSaverApp  269.42 KB -[ArtSaverView loadNextImage] 
> /Users/zach/Code/ArtSaver/ArtSaverView.m:2045
>  11 ArtSaverApp  269.42 KB -[ArtSaverView 
> loadNextImageWithIndex:image:withProps:] 
> /Users/zach/Code/ArtSaver/ArtSaverView.m:2083
>  10 ImageIO  248.44 KB CGImageSourceCopyPropertiesAtIndex
>   9 ImageIO  248.44 KB IIOImageSource::copyPropertiesAtIndex(unsigned 
> long, IIODictionary*)
>   8 ImageIO  248.30 KB 
> IIOImageSource::getPropertiesAtIndexInternal(unsigned long, IIODictionary*)
>   7 ImageIO  244.78 KB IIOImageSource::makeImagePlus(unsigned long, 
> IIODictionary*)
>   6 ImageIO  100.08 KB 
> IIO_Reader_AppleJPEG::initImageAtOffset(CGImagePlugin*, unsigned long, 
> unsigned long, unsigned long)
>   5 ImageIO   97.58 KB IIOReadPlugin::callInitialize()
>   4 ImageIO   93.64 KB AppleJPEGReadPlugin::initialize(IIODictionary*)
>   3 ImageIO   52.00 KB AppleJPEGReadPlugin::appleJPEGDecodeSetup()
>   2 AppleJPEG   52.00 KB applejpeg_decode_create
>   1 libsystem_malloc.dylib   52.00 KB malloc
>   0 libsystem_malloc.dylib   52.00 KB malloc_zone_malloc
> 
> (ArtSaverApp is, of course, my code.)
> Similar backtraces show up when I click on the various Malloc leaks in the 
> Leaks by Backtrace view.
> Almost all of them go through CGImageSourceCopyPropertiesAtIndex(), and the 
> responsible library is 
> ImageIO.
> 
> 
> Thanks a lot in advance for all kinds of insights and hints.
> 
> 
> 
> ___
> 
> 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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Re: Concurrent loading of images ?

2020-05-09 Thread Georg Seifert via Cocoa-dev
The last time I used layers to draw images it made a HUGE difference if the 
image was pixel perfect matching the size of the layer. If the image needed 
scaling, it was quite slow (I had really tiny images, but a lot of them).

g

> Am 9. May 2020 um 19:16 schrieb Steve Mills via Cocoa-dev 
> :
> 
>> On May 9, 2020, at 12:13, Gabriel Zachmann via Cocoa-dev 
>>  wrote:
>> 
>> Would that really make the background (worker) thread execute all that 
>> internal copying/decoding of images in the *background* thread?
>> 
>> I am asking because, currently, all this stuff gets executed in the main 
>> thread invoked by some observer.
>> And, after all, even a background thread eventually has to put the new image 
>> in the layer hierarchy, which, I fear, will cause the heavy lifting to be 
>> done by the main thread, again.
> 
> The point is, yes, the worker thread would be handling the image manipulation 
> to resize it to something that lets the main drawing thread work more 
> efficiently.
> 
> Steve via iPad
> 
> ___
> 
> 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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Re: Concurrent loading of images ?

2020-05-09 Thread Georg Seifert via Cocoa-dev
Have you profiled this? The first thing I would to is run that in Instruments.

Georg


> Am 9. May 2020 um 14:44 schrieb Gabriel Zachmann via Cocoa-dev 
> :
> 
> Again, thanks a lot for all the helpful hints.
> 
> Before restructuring my code, I did a few timings, using a set of test images 
> ranging in size from 30 through 300 MB.
> I used mach_absolute_time() for this experiment.
> And now, I am confused.
> 
> These are the execution times I have found for some of the methods that I 
> invoke in the process of loading and displaying the next image:
> 
> CGImageSourceCreateWithURL: 0.4-1.4 millisec
> CGImageSourceGetStatus: 10-600  microsec
> CGImageSourceCopyPropertiesAtIndex: 0.8-9   millisec 
> CGImageSourceCreateImageAtIndex:15  microsec
> convertToNSImage (*):   25  microsec
> imgLayer.contents = nsimage:1-5 microsec
> removeFromSuperlayer:   0.1 microsec
> addSublayer:5-10microsec
> 
> (*): this is a wrapper method of mine that does a few calls to 
> CIImage/NSImage/NSCIImageRep methods.
> 
> Overall, none of the methods I invoke seems to incur a long execution time.
> Yet, there is a noticeable lag when my app switches from one image to the 
> next one.
> I can tell because all layers have an animation assigned.
> Sometimes , there is even a stutter in the animation itself.
> 
> But it doesn't seem like it makes sense at this point to load images in a 
> concurrent/background dispatch queue, does it?
> 
> So, I am confused: where is the lag coming from?
> 
> Any ideas how I might be able to prevent the lag/stutter when loading and 
> switching to big images?
> 
> 
> Best, G.
> 
> ___
> 
> 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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Re: Check if there are autosaved documents

2020-04-27 Thread Georg Seifert via Cocoa-dev
perfect. Thanks a lot.

Georg

> Am 27.04.2020 um 12:26 schrieb Allan Odgaard via Cocoa-dev 
> :
> 
> On 27 Apr 2020, at 15:35, Georg Seifert via Cocoa-dev wrote:
> 
>> Is there a method/callback that is called when all loading is done 
>> (including the loading of documents).
> 
> Have a look at applicationOpenUntitledFile: 
> https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428491-applicationopenuntitledfile?language=objc
> 
> This is called during startup or clicking application icon in Dock when there 
> are no open windows, so it should not be called after restoring saved 
> documents.
> 
> It would be a suitable place to open your “welcome screen” with recent 
> documents (instead of creating a new untitled document).
> ___
> 
> 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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Check if there are autosaved documents

2020-04-27 Thread Georg Seifert via Cocoa-dev
Hi,

my app shows a welcome screen (that offers to open recent documents or to make 
a new). I like to not show it, when there are autosaved documents that open 
automatically. 

Now I open that window in applicationDidFinishLaunching: but that is called 
before the documents start to load. 

Is there a method/callback that is called when all loading is done (including 
the loading of documents). 

Or, is there a way to check if there are autosaved docs (before they are 
loaded)?

Thanks
Georg
___

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: Catalina scroll view issues

2019-12-19 Thread Georg Seifert via Cocoa-dev
I read most of the discussion but maybe missed some parts so it might repeat 
something or miss the point altogether. 

How big is your view. I had a lot problems with a big view and layer backing. 
It will use tiled layers as a layer can only be a few thousand pixels tall. 
And when you do any checking for the dirty rect you will miss drawing in some 
of the tiles...

Georg


> Am 19.12.2019 um 16:10 schrieb Gary L. Wade via Cocoa-dev 
> :
> 
> Interesting.  This could be a layering issue then, and it could be due to a 
> configuration unique to your customer’s setup.  Since you’re doing things on 
> a lower level than expected, there may be some nuance you need to add or 
> something Apple needs to fix that may work fine using higher level 
> frameworks.  Since there’s lots of little things going on, it definitely 
> warrants a feedback report.  Please add its number to your reply when you 
> submit it.
> 
> FYI, Apple has been putting a lot of effort to support RTL better; in one of 
> this year’s early general presentations at WWDC, you might have seen an 
> engineer talking about RTL support within the App Store on all devices (well, 
> maybe not the HomePod, of course), and the labs definitely had staff there to 
> help.  Where you may find your implementation better than what you see in the 
> frameworks, please write as many feedback reports as needed so all developers 
> can benefit from the desired changes.
> --
> Gary L. Wade
> http://www.garywade.com/ 
> 
>> On Dec 19, 2019, at 6:09 AM, Redler Eyal  wrote:
>> 
 
 OK, I'll try to get the sysdiagnose from my users before submitting. I 
 must say I'm really skeptic regarding the relation with my use of CG. It 
 is not that CG is not used by CT and everything else is also using CG.
>>> 
>>> CG may not be the issue… and I cannot offer a better suggestion, but when I 
>>> rule out a possibility without proof, it usually turns out that I over look 
>>> the solution to the problem.  Good luck!
>> 
>> You're right, and I wasn't ruling it out. I actually sent my user a special 
>> build with an defaults option to turn off page drawing (so the page views 
>> are not doing any drawing CG or otherwise), the issue persists.
>> 
>> I also tried to see this issue while doing remote access using anyDesk, for 
>> some reason, the issue never showed up, when I disconnected, it showed up 
>> again.
>> 
>> Eyal
>> 
>> 
>> 
>>> Sandor
>>> 
 The way it looks it seems very much related to the scrolling mechanism, 
 the pre-rendered portion is not rendered but for some reason the scrolling 
 mechanism thinks that it is. I really don't see how a core-graphic issue, 
 and certainly not a misuse on my part could cause a view to be partially 
 rendered.
 BTW, do you think this type of issue is appropriate for a DTS incident?
 
> Here’s the developer release notes for Catalina:
> https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_release_notes
 
 Thanks. I saw that but I recall that in the past you used to have app-kit 
 specific release notes which were usually more detailed. 
 
> As an aside, it would be helpful to know why you chose CG for text 
> rendering. CT has gotten better with RTL and bidi text, but if you saw 
> particular issues there, reports about those can help everyone.
 
 When I started developing this app (2002), there was no choice other then 
 CG since core text didn't exist and the other technologies didn't support 
 Hebrew and RTL well, if at all. So I wrote my own text engine and this was 
 very good for me commercially as my app was the the first and only 
 word-processor to support Hebrew (and later Arabic) properly on Max OS X. 
 I had a similar experience with OpenType which was not initially supported 
 and that also gave me an edge. As time passed Apple did improve the RTL 
 support and was offering more APIs so theoretically I could have rewritten 
 my code to use the new APIs but in reality I actually did the opposite and 
 relied less on Apple's APIs (for example, parsing 'cmap' tables) because 
 there were always bugs and even regressions which could render my app 
 unusable upon an OS upgrade. Beyond the bugs, I think my RTL is better, or 
 at least as far as I'm concerned as a native Hebrew speaker and having 
 such low-level control over something that is core to my app is essential 
 IMO.
 
 Eyal Redler
 
 "If Uri Geller bends spoons with divine powers, then he's doing it the 
 hard way."
 --James Randi
 www.eyalredler.com
 
 
 
 
 
 
> Gary L. Wade
> http://www.garywade.com/
> 
>>> On Dec 17, 2019, at 2:12 AM, Redler Eyal  wrote:
>> 
>> I am drawing using core 

Re: Cannot include Carbon on Mojave

2019-05-14 Thread Georg Seifert
I had a lot strange build errors like this when I updated to Mojave. Somehow 
they whet away after trying a lot for some time. 

Georg

> Am 14.05.2019 um 20:02 schrieb Vojtěch Meluzín :
> 
> Not really, I searched and it is still there, the headers are inside
> CarbonSound framework, which is inside Carbon framework. And as i wrote,
> XCode compiles fine, like there's something new... I'll need to anazy
> XCode's command lines apparently...
> 
> Cheers!
> Vojtech
> 
> Dne út 14. 5. 2019 18:01 uživatel Richard Charles 
> napsal:
> 
>> 
>>> On May 14, 2019, at 9:29 AM, Vojtěch Meluzín 
>> wrote:
>>> 
>>> Hey folks,
>>> 
>>> I have a brand new computer (as well as old one), newest XCode, Mojave
>>> (unfortunately!). Compiling carbon.h ends up with this:
>>> 
>>> 
>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/
>>> Carbon.framework/Headers/Carbon.h:34:10: fatal error:
>>> 'CarbonSound/CarbonSound.h' file not found
>> 
>> CarbonSound was depreciated in OS X v10.5.
>> 
>> 
>> https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html
>> 
>> It looks to me like Apple is making good on their promise.
>> 
>> --Richard Charles
>> 
>> 
> ___
> 
> 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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


printing black

2019-01-22 Thread Georg Seifert
Hi

I have a app that can print black shapes (using normal cocoa view based 
printing). A lot users complain that the printouts are not really black (the 
printouts are rastered, so the color sync tries to simulate a CMJK black but 
even thou that it is black already). 

We played around with the pdf made form the print dialog. Printing that from 
Adobe Acrobat produces the same results. But Acrobat has an option to convert 
the PDF to optimise it for Digital printing. It attaches a genericGrayscale 
profile to the PDF. 

Does any have a hint what to do? 

Thanks
Georg
___

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: Crash in terminate: on Mavericks

2019-01-21 Thread Georg Seifert
Your symbol settings are wrong. Make sure you use a target that has any. 

DEBUG_INFORMATION_FORMAT = dwarf
COPY_PHASE_STRIP = NO
STRIP_INSTALLED_PRODUCT = NO

Then you should at least see where it happens. 

Georg

> Am 21.01.2019 um 18:39 schrieb James Walker :
> 
> On 1/18/19 6:30 PM, Ken Thomases wrote:
>> You haven't included the nature of the crash, like an access violation or 
>> uncaught exception.  That would be in the lines just above the excerpt you 
>> sent.  Also, if you're able to reproduce this yourself, try running your app 
>> under the Zombies instrument template.
> 
> Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
> Exception Codes: KERN_INVALID_ADDRESS at 0x00010c3013e6
> 
> I used LLDB, and said
> 
> env NSZombieEnabled=YES
> 
> before starting the process.  That didn't make any apparent difference. But 
> thanks for the suggestion.
> 
> 
> 
>>> On Jan 18, 2019, at 6:48 PM, James Walker  wrote:
>>> 
>>> When my app runs in Mavericks (10.9.5), it crashes on quit, but in High 
>>> Sierra it's fine.  The backtrace doesn't show any of my code, so I'm not 
>>> sure how to proceed.  I don't suppose this means anything to anyone?
>>> 
>>> Application Specific Information:
>>> Performing @selector(terminate:) from sender NSMenuItem 0x6180002a0780
>>> 
>>> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
>>> 0   ??? 0x00010c3013e6 0 + 4499444710
>>> 1   com.apple.Foundation0x7fff952019d3 -[NSRecursiveLock 
>>> lock] + 11
>>> 2   com.apple.AppKit0x7fff93355ed1 -[NSApplication 
>>> _copyWindows] + 68
>>> 3   com.apple.AppKit0x7fff93355e79 -[NSApplication 
>>> windows] + 17
>>> 4   com.apple.AppKit0x7fff93589e0f 
>>> -[NSPersistentUIManager 
>>> flushAllChangesOptionallyWaitingUntilDone:updatingSnapshots:] + 384
>>> 5   com.apple.AppKit0x7fff93589c58 
>>> -[NSPersistentUIManager flushPersistentStateAndClose:waitingUntilDone:] + 
>>> 181
>>> 6   com.apple.AppKit0x7fff935d7347 -[NSApplication 
>>> terminate:] + 1671
>>> 7   ??? 0x000102e436a0 0 + 4343477920
>>> 8   com.apple.AppKit0x7fff93582260 -[NSApplication 
>>> sendAction:to:from:] + 327
>>> 9   ??? 0x00010319fdf3 0 + 4347002355
>>> 10  com.apple.AppKit0x7fff9359d1c8 -[NSMenuItem 
>>> _corePerformAction] + 394
>>> 11  com.apple.AppKit0x7fff9359cf04 -[NSCarbonMenuImpl 
>>> performActionWithHighlightingForItemAtIndex:] + 117
>>> 12  com.apple.AppKit0x7fff9359c07c -[NSMenu 
>>> performKeyEquivalent:] + 289
>>> 13  com.apple.AppKit0x7fff935988e1 -[NSApplication 
>>> _handleKeyEquivalent:] + 822
>>> 14  com.apple.AppKit0x7fff93507acc -[NSApplication 
>>> sendEvent:] + 3293
>>> 15  ??? 0x0001031a01d4 0 + 4347003348
>>> 16  com.apple.AppKit0x7fff933579f9 -[NSApplication run] 
>>> + 646
>>> 17  com.apple.AppKit0x7fff93342783 NSApplicationMain + 
>>> 940
>>> 18  ??? 0x0001034e3f10 0 + 4350426896
>>> 19  ??? 0x000102e3e034 0 + 4343455796
>>> ___
>>> 
>>> 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/ken%40codeweavers.com
>>> 
>>> This email sent to k...@codeweavers.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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Xcode 10 and disable layer backed windows in Mojave

2018-10-25 Thread Georg Seifert
When I build my app with Xcode 10, Mojave uses the new layer backed windows. My 
view drawing is (not yet) able to dealt with layer backed views. 

So is there a way to disable the new window system? The only way I fond is not 
to link against the 10.14 SDK. But that is the SDK Xcode 10 is using even in 
10.13. 

Is there a way to link against the 10.13 SDK in Xcode 10. Any other ideas?

Thanks
Georg
___

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

2018-10-03 Thread Georg Seifert
But you can simulate a drawer by adding the extra view and resizing the window 
to fit. This is done automatically when you use autolayout (a stack view would 
be more useful than a split view) or a few lines of code when you do it 
manually. 

georg

> On 3. Oct 2018, at 04:00, Casey McDermott  wrote:
> 
>>> One potential problem I see with drawers is - if the window was in full 
>>> screen mode, nothing appears to happen unless they know to get out of full 
>>> screen (which isn’t a good experience).
> 
> In our case, the data entry screens have a fixed-size layout, so the window 
> is also a fixed size. No full screen mode: it would just look weird.
> 
> We can't put the extra info in front of the main layout because users need to 
> see both.  NSSplitView would be half-empty most of the time.
> 
> NSDrawer is working great, and hopefully it won't be removed despite the 
> deprecation.
> 
> Thanks, Casey McD
> ___
> 
> 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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Re: Typing with multiple selections in NSTextView

2018-09-20 Thread Georg Seifert
Thanks for the explanation. 

I wonder why it supports multiple selection in the first place, when you can do 
almost nothing with it?

Georg

> On 19. Sep 2018, at 18:26, Martin Wierschin  wrote:
> 
> So far as I know this is not possible with a stock NSTextView. The selected 
> range array is automatically normalized by NSTextView, to sort and coalesce 
> ranges as needed. If any zero-length ranges are in a given selection array, 
> only a single zero-length range is allowed and maintained by NSTextView. Any 
> other zero-length ranges are discarded straight away.
> 
> Even if you override selection methods to coerce NSTextView to maintain 
> multiple zero-length selections, I’d be leery about it doing the right thing 
> when it comes to text insertion and other behaviors. I doubt it’s written 
> with multiple zero-length selections in mind. At the very least you’d 
> probably also need to override text insertion and insertion-point drawing, 
> but who knows what other things you’d need to shore up.
> 
> If I were you and wanted to write this in the safest way possible, to ensure 
> no unforeseen consequences, I’d probably subclass NSTextView to add a new 
> property like “multipleInsertionPointIndexes”. Only your own code would need 
> to interact with this property. Of course you’d still have to add NSTextView 
> overrides to handle things and keep those indexes in sync, but this would 
> ensure NSTextView’s code never sees multiple zero-length selections and never 
> potentially enters unknown states.
> 
> Good luck!
> 
> ~Martin Wierschin
> 
> 
>> On Sep 19, 2018, at 12:13 AM, Georg Seifert > <mailto:georg.seif...@gmx.de>> wrote:
>> 
>> Hi
>> 
>> Is it possible to make NSTextView to allow typing with multiple insertion 
>> points? One can set multiple selection and delete all of them at once. But 
>> typing only replaces the first range and ignores the other ranges. 
>> 
>> Thanks
>> Georg
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/martin%40nisus.com 
>> <https://lists.apple.com/mailman/options/cocoa-dev/martin%40nisus.com>
>> 
>> This email sent to mar...@nisus.com <mailto:mar...@nisus.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


Typing with multiple selections in NSTextView

2018-09-19 Thread Georg Seifert
Hi

Is it possible to make NSTextView to allow typing with multiple insertion 
points? One can set multiple selection and delete all of them at once. But 
typing only replaces the first range and ignores the other ranges. 

Thanks
Georg
___

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 handling

2018-06-14 Thread Georg Seifert
The hockeyApp framework has a lot explanation about this:

https://www.hockeyapp.net/help/sdk/mac/4.0.2/Classes/BITCrashExceptionApplication.html

Best
Georg Seifert


> Am 14.06.2018 um 14:33 schrieb Casey McDermott :
> 
> Thanks, this is all useful info.  I checked NSExceptionHandler and
> NSUncaughtExceptionHandler, but they are just for logging before termination.
> NSRunLoop is accessible but there's not much there.
> 
> However, simply replacing the C++ throw with a Cocoa exception via
> [NSException raise : errString  format : errString]; seems to work great.
> Apparently it unwinds the call stack and is swallowed in the run loop.  
> 
> It doesn't use the error string but that's fine.  We already show a dialog 
> before the throw, with file & line number. Helps enormously for fixing bugs.
> 
> Thanks for all the help,
> 
> Casey McDermott
> 
> 
> On Thu, 6/14/18, Alastair Houghton  wrote:
> 
> Subject: Re: Exception handling
> To: "Jens Alfke" 
> Cc: "Casey McDermott" , "cocoa-dev list" 
> 
> Date: Thursday, June 14, 2018, 1:11 PM
> 
> On 14 Jun
> 2018, at 18:00, Jens Alfke 
> wrote:
> 
> On Jun 13, 2018, at 7:22
> PM, Casey McDermott 
> wrote:
> 
> Our Carbon event loop had
> a try/catch block, which caught most exceptions, and then
> continued.  It started
> as an expedient in early production, but it remained in
> production code 
> since
> it often allows users to continue, save their work, etc.
>  
> 
> That's actually how
> Cocoa used to work. I can't recall whether an alert
> panel popped up or if it was just silent. The behavior
> changed to crashing sometime in the past, um, 8 years or
> so.
> 
> I don’t
> think it’s changed in any obvious way; the framework has
> always swallowed exceptions in certain contexts, but not in
> others. Obviously the precise detail may have changed over
> time, but it’s certainly crashed on exceptions for as long
> as I remember, outside of the places where they get ignored
> for whatever reason.
> Is there a way to override
> the event loop in Cocoa?  Some other way we can escape to
> 
> the event loop and
> then continue from there? 
> 
> There used to be either a callback or
> an overridable NSApplication method to handle an uncaught
> exception, but looking at current headers I can't find
> what I'm looking for; maybe it's been gone for a
> long time and removed?
> 
> Perhaps
> you’re thinking of NSSetUncaughtExceptionHandler()? I
> don’t think there’s much you can usefully do from that,
> though, besides logging the exception.
> Kind regards,
> Alastair.
> --http://alastairs-place.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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Re: Very slow NSTableView

2017-07-05 Thread Georg Seifert
Any reason you set the tableview to be "Source List". Set it to regular and it 
will work perfectly. It seems that the NSPopUpButtonCell don’t like to be in a 
source list. Maybe you can subclass it and draw yourself?

Georg

> On 05.07.2017, at 03:36, Graham Cox  wrote:
> 
> 
>> On 5 Jul 2017, at 11:23 am, Graham Cox  wrote:
>> 
>> If anyone can offer a place to host the project, I’d be happy to share it, 
>> and see whether the problem is seen by others. (I no longer have file 
>> hosting services).
> 
> 
> Never mind - I remembered I had an Amazon S3 account.
> 
> http://s3.amazonaws.com/Mapdiva/Source/Test%20Projects/TestTableViewPopups.zip
> 
> 
> —Graham
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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


Re: Prioritizing drawing of the important stuff

2016-10-31 Thread Georg Seifert

___

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: iOS app communicating with macOS app

2016-09-29 Thread Georg Seifert
Maybe this helps: https://github.com/rsms/peertalk 
<https://github.com/rsms/peertalk>

Best
Georg Seifert

> On 28 Sep 2016, at 14:57, Eric E. Dolecki <edole...@gmail.com> wrote:
> 
> I'd like to make an iOS application communicate with a macOS application.
> No App Store involvement - just to prototype something local. What would be
> the best approach/easiest solution? A GameKit type thing or something else
> like BLE or something maybe even easier? Would only need to send small
> strings.
> 
> Thanks,
> Eric
> ___
> 
> 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/georg.seifert%40gmx.de
> 
> This email sent to georg.seif...@gmx.de

___

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

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

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

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

undomanger performance

2016-04-30 Thread Georg Seifert
Hi

My app deals with an object tree that can have millions of leaves. It is 
possible to run an operation on all of them. Each will register its own change 
with the undo manager. The hole operation might tale a few second (the last 
line in the trace below). But after my operation is finished, there is another 
operation triggered by the system that takes much longer than the original task 
and it blocks the UI. It is directly linked to the undo registration, if I 
disable it, this does not happen. 

Running TimeSelf (ms)   Symbol Name
26258.0ms   81.3%   0,0 _dispatch_mgr_thread  0x4ef18d
26258.0ms   81.3%   0,0  _dispatch_mgr_thread
26258.0ms   81.3%   0,0   _dispatch_mgr_invoke
26250.0ms   81.2%   0,0_dispatch_mgr_queue_drain
26248.0ms   81.2%   48,0_dispatch_queue_drain
26168.0ms   81.0%   1,0  _dispatch_client_callout
26141.0ms   80.9%   97,0  _dispatch_source_set_timer3
25561.0ms   79.1%   25561,0_dispatch_timers_update
481.0ms1.4% 8,0_dispatch_resume_slow
2.0ms0.0%   2,0_dispatch_queue_wakeup
8.0ms0.0%   0,0   free
6.0ms0.0%   6,0   dispatch_release
6.0ms0.0%   6,0   _os_object_release
4.0ms0.0%   4,0   dispatch_resume
1.0ms0.0%   1,0   nano_free_definite_size
1.0ms0.0%   0,0   
12.0ms0.0%  12,0 OSAtomicEnqueue
9.0ms0.0%   4,0  gcd_queue_item_complete_hook
6.0ms0.0%   1,0  _dispatch_continuation_free_to_cache_limit
3.0ms0.0%   2,0  
_dispatch_introspection_queue_item_dequeue_hook
1.0ms0.0%   1,0  DYLD-STUB$$free
1.0ms0.0%   0,0  
2.0ms0.0%   2,0 _dispatch_introspection_callout_return
7.0ms0.0%   6,0_dispatch_cache_cleanup
1.0ms0.0%   0,0_dispatch_timers_run
4162.0ms   12.8%0,0 Main Thread  0x4ef176

Does anyone has an idea what’s going on?

Thanks
Georg Seifert
Xcode 7.2 on MacOS 10.10.5, 27" Retina-iMac.


___

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

Plugin bundle with Javascript

2015-05-19 Thread Georg Seifert
Hi,

I hope this it the right place to ask, if not can you point me the right 
direction.

Is it possible to build plugin bundles using Javascript? I know how to to that 
with ObjectiveC and python (with py2app) but could’n find anything about 
Javascript.

Georg


___

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: Cocoa GUI app getting slower on MacPro or MacMini when disconnecting all screens

2015-03-13 Thread Georg Seifert
Macs still do that. I needed to get an adapter to get decent performance out of 
my headless macMini.


Am 12.03.2015 um 21:18 schrieb Matthieu Beghin matthieu.beg...@garagecube.com:

 Yes I do OpenGL… I can’t see any process using CPU, so I was thinking it’s 
 not related, but maybe for some reason the glSwap is blocking for some time…
 The strange thing is that in Instruments it looks that my threads are not 
 blocked. I will do further investigations on monday.
 Thx !
 Matthieu
 
 On 12 Mar 2015, at 16:21, Uli Kusterer witness.of.teacht...@gmx.net wrote:
 
 On 11 Mar 2015, at 23:40, Matthieu Beghin matthieu.beg...@garagecube.com 
 wrote:
 Any idea ?
 
 You're not doing anything graphics or OpenGL-related, are you? At least in 
 the old days, Macs would turn off the GPU when no screen was attached, 
 meaning that you'd end up in software emulation when you did any openGL 
 calls. I thought that was different these days, but maybe this reminds you 
 of something you're doing that could cause this slowdown?
 
 -- Uli/
 
 
 
 ___
 
 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/georg.seifert%40gmx.de
 
 This email sent to georg.seif...@gmx.de


___

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

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

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

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

Re: UIColor in CoreData database into NSColor

2015-02-20 Thread Georg Seifert
That would only work it UIColor and NSColor would encode themselves in exactly 
the same way. Any guess what, they aren’t.

Georg

On 20 Feb 2015, at 22:53, Alex Zavatone z...@mac.com wrote:

 Would it be correct to not care about UIColor or NSColor, encode the data to 
 be stored in 64 bit NSData, store that and when accessed, decode it?
 
 Sent from my iPad. Please pardon typos.
 
 On Feb 20, 2015, at 2:15 PM, Alex Kac a...@webis.net wrote:
 
 We have a CoreData database on iOS that we want our users to be able to 
 restore in our OS X app from backups. It uses UIColor while our desktop app 
 uses NSColor for now. The correct method for us is to save our color info in 
 a non-platform specific way…but people have database backups where its going 
 to stay a UIColor - its a backup and we can’t go and change those.
 
 So with that in mind, has anyone tackled a conversion process of reading in 
 UIColor data into NSColor via CoreData?


___

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 Georg Seifert
 
 I guess the best we can do as developers is to vote with our feet by not 
 adopting it in our apps. (I haven't had to deal with an OS X source list in a 
 while; I assume vibrancy has to be opted into? Or at least there's a way to 
 opt out?)

No, it is on by default and no way (that I know of, and I would be very happy 
to be proven wrong) to opt out. 

Georg
___

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

Frame of views during awakeFromNib or restoration

2014-10-23 Thread Georg Seifert
Hi,

I see a problem on several places in my app. In awakeFromNib, in 
restoreStateWithCoder: or just after adding a view programmatically, the bounds 
aren’t in sync with the final size or with the super view. The relayout is done 
at the end of the runloop. This was not the case in 10.7 but is now in 10.9. I 
think I read somewhere about that but cant find it.

I have several things I need to do. One is to set the initial scroll position, 
another is that I want to manually restore some split views.

Thanks
Georg Seifert
___

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: My services in my own app

2014-09-08 Thread Georg Seifert

On 03 Sep 2014, at 01:20, dangerwillrobinsondan...@gmail.com wrote:

 
 
 Sent from my iPhone
 
 On 2014/09/03, at 3:45, Georg Seifert georg.seif...@gmx.de wrote:
 
 Here are some more information. 
 
 I created a small test app following the example on apples documentation. 
 The service works fine if invoked from other apps but if you select it from 
 within the same app with text selected in a text view, the app menu will 
 stay highlighted for 30s and after that it will give an error dialog: 
 
 The “reverse String” service could not be used because the application did 
 not respond to a request for services.
 Try reopening “(null),” or contact the vendor for an updated version.
 
 This is the backtrace (if I press pause in the debugger during that 30s):
 #00x7fff8d805a1a in mach_msg_trap ()
 #10x7fff8d804d18 in mach_msg ()
 #20x7fff8d434f15 in __CFRunLoopServiceMachPort ()
 #30x7fff8d434539 in __CFRunLoopRun ()
 #40x7fff8d433e75 in CFRunLoopRunSpecific ()
 #50x7fff8872ea0d in RunCurrentEventLoopInMode ()
 #60x7fff8872e7b7 in ReceiveNextEventCommon ()
 #70x7fff8872e5bc in _BlockUntilNextEventMatchingListInModeWithFilter 
 ()
 #80x7fff8ddbe24e in _DPSNextEvent ()
 #90x7fff8ddbd89b in -[NSApplication 
 nextEventMatchingMask:untilDate:inMode:dequeue:] ()
 #100x7fff8e55f85d in _checkForUserCancelledEventUpToDate ()
 #110x7fff8e560d92 in +[NSServicesMenuHandler 
 _performServiceFromEntry:withPasteboard:withRequestor:withCarbonFocus:withSendTypes:withReturnTypes:canReleasePasteboardImmediately:]
  ()
 #120x7fff8e56150d in +[NSServicesMenuHandler 
 _performServiceFromEntry:withPasteboard:withRequestor:] ()
 #130x7fff8dfdc260 in -[NSApplication sendAction:to:from:] ()
 #140x7fff8dff71c8 in -[NSMenuItem _corePerformAction] ()
 #150x7fff8dff6f04 in -[NSCarbonMenuImpl 
 performActionWithHighlightingForItemAtIndex:] ()
 #160x7fff8e04640d in -[NSMenu _internalPerformActionForItemAtIndex:] 
 ()
 #170x7fff8e046289 in -[NSCarbonMenuImpl 
 _carbonCommandProcessEvent:handlerCallRef:] ()
 #180x7fff8dfecff6 in NSSLMMenuEventHandler ()
 #190x7fff887081d4 in DispatchEventToHandlers(EventTargetRec*, 
 OpaqueEventRef*, HandlerCallRec*) ()
 
 Here is the app:
 https://dl.dropboxusercontent.com/u/3563666/ServiceTest.zip (app and 
 sources). 
 First activate the Service reverse String in System Preferences. 
 Open a new document, type something, select it and run the filter.
 
 I think is happens if both, the NSSendTypes and NSReturnTypes are set. 
 Services that only have one seem to work fine.
 
 If anyone can help me with this?
 
 Best
 Georg  
 It's a bit more work, but if you supplied the service via a helper app 
 embedded in your app bundle, does that make it work?

I didn't see anything in the docs about how to set it up. Can you just set the 
post name to the helper apps name? who would be responsible for first starting 
the app? 

Are there any examples on how to set it up?

Thanks
Georg


___

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: My services in my own app

2014-09-02 Thread Georg Seifert
Here are some more information. 

I created a small test app following the example on apples documentation. The 
service works fine if invoked from other apps but if you select it from within 
the same app with text selected in a text view, the app menu will stay 
highlighted for 30s and after that it will give an error dialog: 

 The “reverse String” service could not be used because the application did 
 not respond to a request for services.
 Try reopening “(null),” or contact the vendor for an updated version.

This is the backtrace (if I press pause in the debugger during that 30s):
#0  0x7fff8d805a1a in mach_msg_trap ()
#1  0x7fff8d804d18 in mach_msg ()
#2  0x7fff8d434f15 in __CFRunLoopServiceMachPort ()
#3  0x7fff8d434539 in __CFRunLoopRun ()
#4  0x7fff8d433e75 in CFRunLoopRunSpecific ()
#5  0x7fff8872ea0d in RunCurrentEventLoopInMode ()
#6  0x7fff8872e7b7 in ReceiveNextEventCommon ()
#7  0x7fff8872e5bc in _BlockUntilNextEventMatchingListInModeWithFilter 
()
#8  0x7fff8ddbe24e in _DPSNextEvent ()
#9  0x7fff8ddbd89b in -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#10 0x7fff8e55f85d in _checkForUserCancelledEventUpToDate ()
#11 0x7fff8e560d92 in +[NSServicesMenuHandler 
_performServiceFromEntry:withPasteboard:withRequestor:withCarbonFocus:withSendTypes:withReturnTypes:canReleasePasteboardImmediately:]
 ()
#12 0x7fff8e56150d in +[NSServicesMenuHandler 
_performServiceFromEntry:withPasteboard:withRequestor:] ()
#13 0x7fff8dfdc260 in -[NSApplication sendAction:to:from:] ()
#14 0x7fff8dff71c8 in -[NSMenuItem _corePerformAction] ()
#15 0x7fff8dff6f04 in -[NSCarbonMenuImpl 
performActionWithHighlightingForItemAtIndex:] ()
#16 0x7fff8e04640d in -[NSMenu _internalPerformActionForItemAtIndex:] ()
#17 0x7fff8e046289 in -[NSCarbonMenuImpl 
_carbonCommandProcessEvent:handlerCallRef:] ()
#18 0x7fff8dfecff6 in NSSLMMenuEventHandler ()
#19 0x7fff887081d4 in DispatchEventToHandlers(EventTargetRec*, 
OpaqueEventRef*, HandlerCallRec*) ()

Here is the app:
https://dl.dropboxusercontent.com/u/3563666/ServiceTest.zip (app and sources). 
First activate the Service reverse String in System Preferences. 
Open a new document, type something, select it and run the filter.

I think is happens if both, the NSSendTypes and NSReturnTypes are set. Services 
that only have one seem to work fine.

If anyone can help me with this?

Best
Georg  

On 01 Sep 2014, at 21:30, Georg Seifert georg.seif...@gmx.de wrote:

 Just wanted to follow up on this. The bug is not fixed. It is still there in 
 10.9. Any other news on it?
 
 Georg
 
 On 16 Jan 2012, at 22:27, Mark Munz unmar...@gmail.com wrote:
 
 
 You didn't indicate what version of Mac OS X you were running under.
 
 If this is happening under Snow Leopard, then this is a known issue in
 Snow Leopard that Apple fixed in Lion.
 
 The only work around I know is to put the service code in a separate
 (background) application that then calls back into your app to do
 whatever task you need it to do.
 
 Mark
 
 Hi,
 
 My app registers some services and they work just fine. Only if I invoke 
 then from within the same application, the app hangs. I tried with other 
 apps and they had the same problem.
 
 I searched the web for it but could not find anything.
 
 Is there anything I can do about it?
 
 Thanks
 Georg
 
 
 ___
 
 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/georg.seifert%40gmx.de
 
 This email sent to georg.seif...@gmx.de


___

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

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

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

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

Re: My services in my own app

2014-09-01 Thread Georg Seifert
Just wanted to follow up on this. The bug is not fixed. It is still there in 
10.9. Any other news on it?

Georg

On 16 Jan 2012, at 22:27, Mark Munz unmar...@gmail.com wrote:

 
 You didn't indicate what version of Mac OS X you were running under.
 
 If this is happening under Snow Leopard, then this is a known issue in
 Snow Leopard that Apple fixed in Lion.
 
 The only work around I know is to put the service code in a separate
 (background) application that then calls back into your app to do
 whatever task you need it to do.
 
 Mark
 
 Hi,
 
 My app registers some services and they work just fine. Only if I invoke 
 then from within the same application, the app hangs. I tried with other 
 apps and they had the same problem.
 
 I searched the web for it but could not find anything.
 
 Is there anything I can do about it?
 
 Thanks
 Georg


___

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

Custom view and NSText

2013-12-11 Thread Georg Seifert
Hi,

I have an view that acts as an text view by implementing the NSTextInputClient 
protocol. This works fine in 10.8 but leads to crashes in 10.9. The report says:

 Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
 reason: 'All NSText methods must be implemented by subclassers.  They should 
 not call super.'

It seems to be related to the new input methods in 10.9. Like if you hold a key 
it will show a small popover that gives you some variants of that character 
(like accented characters) similar to the iOD keyboard. I tried to find any 
documentation about this...

The problem goes away if I link to the 10.9 SDK but I can't do that as I still 
support 10.6 and need to build on a 10.7 machine.

So can anyone point me in the right direction on how to implement the popovers?

below is a backtrace.

Thanks
Georg 

Last Exception Backtrace:
0   CoreFoundation  0x7fff89467404 ___exceptionPreprocess + 
148
1   libobjc.A.dylib 0x7fff921a0e75 _objc_exception_throw + 
43
2   CoreFoundation  0x7fff894672cc +[NSException 
raise:format:] + 204
3   AppKit  0x7fff8c41c1ff -[NSText string] + 43
4   AppKit  0x7fff8bfb786c -[NSTextInputContext 
handleTSMEvent:] + 3555
5   AppKit  0x7fff8bfb6a65 __NSTSMEventHandler + 205
6   HIToolbox   0x7fff8cf5f6d4 
__ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec
 + 892
7   HIToolbox   0x7fff8cf5ec87 
__ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec
 + 385
8   HIToolbox   0x7fff8cf72d90 _SendEventToEventTarget 
+ 40
9   HIToolbox   0x7fff8cfb40ed _SendTSMEvent + 33
10  HIToolbox   0x7fff8d16171f _SendTextInputEvent + 
1028
11  HIToolbox   0x7fff8d1ac8ec -[IMKInputSession 
_copyUniCharsForRange:intoBuffer:ofLength:] + 268
12  HIToolbox   0x7fff8d1ac9bb -[IMKInputSession 
_coreAttributesFromRange:whichAttributes:actualRange:] + 137
13  HIToolbox   0x7fff8d1adaac -[IMKInputSession 
attributedSubstringFromRange:] + 89
14  CoreFoundation  0x7fff89352dec ___invoking___ + 140
15  CoreFoundation  0x7fff89352c54 -[NSInvocation invoke] + 
308
16  CoreFoundation  0x7fff893f57a6 -[NSInvocation 
invokeWithTarget:] + 54
17  CoreFoundation  0x7fff893c5384 forwarding___ + 452
18  CoreFoundation  0x7fff893c5138 __CF_forwarding_prep_0 + 
120
19  CoreFoundation  0x7fff89352dec ___invoking___ + 140
20  CoreFoundation  0x7fff89352c54 -[NSInvocation invoke] + 
308
21  Foundation  0x7fff90130c67 -[NSConnection 
dispatchInvocation:] + 135
22  Foundation  0x7fff9013092d -[NSConnection 
handleRequest:sequence:] + 1434
23  Foundation  0x7fff900d7cf0 -[NSConnection 
handlePortCoder:] + 652
24  Foundation  0x7fff900d7628 -[NSConnection 
dispatchWithComponents:] + 50
25  Foundation  0x7fff900bbed8 ___NSFireMachPort + 257
26  CoreFoundation  0x7fff89398d04 ___CFMachPortPerform + 
388
27  CoreFoundation  0x7fff89398b69 
___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
28  CoreFoundation  0x7fff89398ade ___CFRunLoopDoSource1 + 
478
29  CoreFoundation  0x7fff89389bd6 ___CFRunLoopRun + 1830
30  CoreFoundation  0x7fff89389275 _CFRunLoopRunSpecific + 
309
31  Foundation  0x7fff900d400e -[NSConnection 
sendInvocation:internal:] + 1965
32  CoreFoundation  0x7fff893c5384 forwarding___ + 452
33  CoreFoundation  0x7fff893c5138 __CF_forwarding_prep_0 + 
120
34  HIToolbox   0x7fff8d1a8b8d -[IMKInputSession 
handleEvent:] + 946
35  HIToolbox   0x7fff8d16c2e8 
_IMKInputSessionProcessEventRef + 45
36  HIToolbox   0x7fff8d16b8aa 
_InputMethodInstanceProcessEventRef + 100
37  HIToolbox   0x7fff8d160e6f _TSMEventToInputMethod + 
131
38  HIToolbox   0x7fff8cfa0452 _TSMProcessRawKeyEvent + 
3034
39  AppKit  0x7fff8bfb62b0 -[NSTextInputContext 
handleEvent:] + 731
40  AppKit  0x7fff8bf95b5d -[NSView 
interpretKeyEvents:] + 180
...
...
...


___

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


Re: autosavesInPlace and sandbox

2012-09-23 Thread Georg Seifert
Hi
Sorry for not answering earlier. I was to busy with other things.

Am 07.09.2012 um 15:36 schrieb Mike Abdullah:

 
 On 6 Sep 2012, at 23:27, Georg Seifert georg.seif...@gmx.de wrote:
 
 
 On 06.09.2012, at 15:32, Mike Abdullah wrote:
 
 On 6 Sep 2012, at 13:36, Georg Seifert georg.seif...@gmx.de wrote:
 
 Hi,
 
 I have a problem. My app (documents based) does not support Lions Version 
 (returns NO in autosavesInPlace). This worked fine until I had to sandbox 
 my app. The problem is, that now the NSDocument autosaving tries to create 
 a file called My Document Name (Autosaved).myExtension next to the 
 document. But this is blocked by the sandbox. 
 
 Is there any way to extend the permission to the autosave file or can I 
 force NSDocument to always store the autosave files in the container?
 
 What's stopping you adopting autosave-in-place?
 
 I actually used autosave in place but my users did not like it at all. If 
 you have to open a lot files all the time just to check something, you do 
 not like that any mouse click might change your document and you are not 
 asked if you what to keep it.
 
 So let's try to nail down some of the real problems here:
 
 NSDocument's old autosave support periodically saves a copy of the document 
 as the user works. For new, unsaved documents, that's not a problem with the 
 sandbox.
 
 For existing documents it is though, because gets saved alongside the 
 original. The logic is that should the program crash or similar, and the user 
 is unable to re-open it in a normal fashion, that autosaved copy of the doc 
 is still sitting there on the filesystem in plain sight. The user can just go 
 and open it up and play with it.
 
 If you're absolutely desperate to keep using the old autosave system, it 
 might be possible to use 10.8's extra entitlements to declare that you need 
 write access to a specific filename alongside an existing one. But it's 10.8 
 only and I don't know if it could quite meet your needs.
 
 Another alternative would be to ask the system to autosave to an alternative 
 location which you do have write access to. Your users lose the ability to 
 easily spot the autosaved copy of the doc, but otherwise it should perform 
 fine.

Can someone give me a hint on how to do that?

 That said, I would strongly encourage you to adopt autosave-in-place. You 
 describe the problem in two parts:
 
 you do not like that any mouse click might change your document
 
 
 Surely this applies to either saving system?

No, with the new style autosaving, the file changes on disk without asking the 
user.

 you are not asked if you want to keep it
 
 So here's the real problem it seems; you run into customers accidentally 
 modifying documents. Normally they would be warned as they quit or close the 
 doc, but with autosave-in-place, that doesn't happen.
 
 Some good news in 10.8: users can turn on a system preference so that they 
 get effectively get back the warning behaviour. Closing a document will warn 
 you if there are unsaved changes. However, the file on disk will already 
 have been updated. That might bother them; I don't know.
 
 But more importantly, isn't this exactly what 10.7's concept of locked 
 documents tried to solve? If the doc hadn't been edited in a while, it would 
 be marked as locked. So the first time any edit occurred, a sheet popped down 
 asking if the user wanted to go ahead with the edit, duplicate the doc or 
 cancel.
 
 Was that not kicking in for your typical customers? Perhaps because the 
 document was too recently edited? 10.8 does throw this out of the window. But 
 what you could do is override -checkAutosavingSafetyAndReturnError: so that 
 it always returns NO when a doc is first opened. If your app is primarily 
 used as a viewer, that could be a neat way for you to always ask if the first 
 edit is intended.
 
Thanks
Georg


___

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


autosavesInPlace and sandbox

2012-09-06 Thread Georg Seifert
Hi,

I have a problem. My app (documents based) does not support Lions Version 
(returns NO in autosavesInPlace). This worked fine until I had to sandbox my 
app. The problem is, that now the NSDocument autosaving tries to create a file 
called My Document Name (Autosaved).myExtension next to the document. But 
this is blocked by the sandbox. 

Is there any way to extend the permission to the autosave file or can I force 
NSDocument to always store the autosave files in the container?

Thanks
Georg
___

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: autosavesInPlace and sandbox

2012-09-06 Thread Georg Seifert

On 06.09.2012, at 15:32, Mike Abdullah wrote:

 On 6 Sep 2012, at 13:36, Georg Seifert georg.seif...@gmx.de wrote:
 
 Hi,
 
 I have a problem. My app (documents based) does not support Lions Version 
 (returns NO in autosavesInPlace). This worked fine until I had to sandbox my 
 app. The problem is, that now the NSDocument autosaving tries to create a 
 file called My Document Name (Autosaved).myExtension next to the document. 
 But this is blocked by the sandbox. 
 
 Is there any way to extend the permission to the autosave file or can I 
 force NSDocument to always store the autosave files in the container?
 
 What's stopping you adopting autosave-in-place?
 
I actually used autosave in place but my users did not like it at all. If you 
have to open a lot files all the time just to check something, you do not like 
that any mouse click might change your document and you are not asked if you 
what to keep it.

Best
Georg
___

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


Crash in Mountain Lion

2012-08-31 Thread Georg Seifert
Hi,

I get a lot crash reports that I can’t find anything about. It is completely in 
Apples code and only happens in MacOSX 10.8. A backtrace is attached. Can 
someone help me with this?

Best
Georg

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x, 0x

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '-[NSDocumentMoreIVars userInfo]: unrecognized selector sent to 
instance 0x106b18e20'
terminate called throwing an exception
abort() called

Application Specific Backtrace 1:
0   CoreFoundation  0x7fff8d8ea716 
__exceptionPreprocess + 198
1   libobjc.A.dylib 0x7fff8c46e470 objc_exception_throw 
+ 43
2   CoreFoundation  0x7fff8d980d5a -[NSObject(NSObject) 
doesNotRecognizeSelector:] + 186
3   CoreFoundation  0x7fff8d8d8c3e ___forwarding___ + 
414
4   CoreFoundation  0x7fff8d8d8a28 
_CF_forwarding_prep_0 + 232
5   AppKit  0x7fff9033094e -[NSDocument 
_updateLockedStateWithAutosavingSafetyError:] + 37
6   AppKit  0x7fff903303c9 -[NSDocument 
_checkAutosavingAndUpdateLockedState] + 65
7   AppKit  0x7fff9074c848 __block_global_238 + 
59
8   AppKit  0x7fff902e4b09 -[NSDocument 
continueFileAccessUsingBlock:] + 222
9   AppKit  0x7fff902e4702 -[NSDocument 
_performFileAccessOnMainThread:usingBlock:] + 589
10  AppKit  0x7fff902e95c7 -[NSDocument 
performAsynchronousFileAccessUsingBlock:] + 484
11  AppKit  0x7fff9074c806 __36-[NSDocument 
presentedItemDidChange]_block_invoke_0 + 116
12  Foundation  0x7fff85eb7cac -[NSBlockOperation 
main] + 124
13  Foundation  0x7fff85e8dbb6 
-[__NSOperationInternal start] + 684
14  Foundation  0x7fff85e953d1 __block_global_6 + 
129
15  libdispatch.dylib   0x7fff8d7eff3d 
_dispatch_call_block_and_release + 15
16  libdispatch.dylib   0x7fff8d7ec0fa 
_dispatch_client_callout + 8
17  libdispatch.dylib   0x7fff8d7f1104 
_dispatch_main_queue_callback_4CF + 275
18  CoreFoundation  0x7fff8d88c81e __CFRunLoopRun + 1614
19  CoreFoundation  0x7fff8d88bdd2 CFRunLoopRunSpecific 
+ 290
20  HIToolbox   0x7fff86db3774 
RunCurrentEventLoopInMode + 209
21  HIToolbox   0x7fff86db3512 
ReceiveNextEventCommon + 356
22  HIToolbox   0x7fff86db33a3 
BlockUntilNextEventMatchingListInMode + 62
23  AppKit  0x7fff90415fa3 _DPSNextEvent + 685
24  AppKit  0x7fff90415862 -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
25  AppKit  0x7fff9040cc03 -[NSApplication run] 
+ 517
26  AppKit  0x7fff903b1656 NSApplicationMain + 
869
27  Glyphs  0x00014c57 Glyphs + 19543
28  Glyphs  0x00011dd4 Glyphs + 7636

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib  0x7fff8fe87212 __pthread_kill + 10
1   libsystem_c.dylib   0x7fff888bab34 pthread_kill + 90
2   libsystem_c.dylib   0x7fff888fedfa abort + 143
3   libc++abi.dylib 0x7fff89b88f87 abort_message + 257
4   libc++abi.dylib 0x7fff89b86936 default_terminate() 
+ 28
5   libobjc.A.dylib 0x7fff8c46e8f3 _objc_terminate() + 
91
6   libc++.1.dylib  0x7fff8e68a8fe std::terminate() + 20
7   libobjc.A.dylib 0x7fff8c46e65e objc_terminate + 9
8   libdispatch.dylib   0x7fff8d7ec10e 
_dispatch_client_callout + 28
9   libdispatch.dylib   0x7fff8d7f1104 
_dispatch_main_queue_callback_4CF + 275
10  com.apple.CoreFoundation0x7fff8d88c81e __CFRunLoopRun + 1614
11  com.apple.CoreFoundation0x7fff8d88bdd2 CFRunLoopRunSpecific 
+ 290
12  com.apple.HIToolbox 0x7fff86db3774 
RunCurrentEventLoopInMode + 209
13  com.apple.HIToolbox 0x7fff86db3512 
ReceiveNextEventCommon + 356
14  com.apple.HIToolbox 0x7fff86db33a3 
BlockUntilNextEventMatchingListInMode + 62
15  com.apple.AppKit0x7fff90415fa3 _DPSNextEvent + 685
16  com.apple.AppKit0x7fff90415862 -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
17  

xCode crash on validation for App Store

2012-02-26 Thread Georg Seifert
Hi,

I’m using xCode 4.3. If I try to validate my app prior to uploading it to the 
Mac App Store, it constantly crashes. 

I get a crash report that says: 
UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[DVTFilePath compare:]: 
unrecognized selector sent to instance 0x409ab29c0

The same happens if i try to generate a installer package.

Is there anything I can do to circumvent this? Does anyone else has this 
problem?

Best
Georg
___

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

Lion: unlocking a document

2012-02-07 Thread Georg Seifert
Hi,

I still have problems with my document saving behavior in Lion. 

If I open a file that my app can only read (CFBundleRoleType = Viewer) the 
state is set to locked. If I unlock it and do some changes, the autosave 
replaces the document file with a native file.

This is really not exactable. Not all data is read from the original (binary) 
file and so I need to keep the original.

Is there any way to prevent this. I would prefer that if the user unlocks the 
document, it actually is duplicated. 

Best
Georg Seifert
___

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


Lion: Lock documents and custom undomanager

2012-02-07 Thread Georg Seifert
Hi,

I have several undomanagers in my app. (I know that is unusual. Think of it as 
if you had a page layout app and every page has its own undo.)

This all works well except if the document is locked. Then the documents 
undomanager knows about this and prevents the change and generates a error. But 
my undomanagers are not in sync with the document. I do not find anything about 
that in the docs. So, is there any way to get the locked state of the document 
or to connect the undomanagers with the document?

Thanks
Georg
___

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: ARC and 10.6

2012-02-06 Thread Georg Seifert
 I try to convert my app to use xCode 4.2 and ARC. My app uses several custom 
 frameworks and plugins. I used the migration tool to enable ARC for all of 
 them.
 
 As I still want to support Snow Leopard, I set the SDKROOT to 10.7 and the 
 Deployment Target to 10.6. But if I do that, on the startup of the app, I 
 get this in the console: 
 
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework2. One of the two will be used. Which one is undefined. // 
 removed the paths to frameworks...
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework3. One of the two will be used. Which one is undefined.
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework4. One of the two will be used. Which one is undefined.
 
 In the beginning I had only a few but now after converting all of my bundles 
 (around 20) I have 10 lines of those. The ARCLite stuff seems to be the 
 implementation to get ARC to work on Snow Leopard.
 
 That's right. The warning is annoying but otherwise harmless. The machinery 
 that makes ARC code work on older deployment targets was designed for apps, 
 and doesn't work well in frameworks. A future developer tools release should 
 fix this.

Is there a way to remove the code (for __ARCLite__) from the object files? Like 
you can remove the code for a certain architecture?

Georg



___

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: ARC and 10.6

2012-02-03 Thread Georg Seifert
On 03.02.2012, at 00:24, Greg Parker wrote:

 On Feb 2, 2012, at 2:51 PM, Georg Seifert georg.seif...@gmx.de wrote:
 I try to convert my app to use xCode 4.2 and ARC. My app uses several custom 
 frameworks and plugins. I used the migration tool to enable ARC for all of 
 them.
 
 As I still want to support Snow Leopard, I set the SDKROOT to 10.7 and the 
 Deployment Target to 10.6. But if I do that, on the startup of the app, I 
 get this in the console: 
 
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework2. One of the two will be used. Which one is undefined. // 
 removed the paths to frameworks...
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework3. One of the two will be used. Which one is undefined.
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework4. One of the two will be used. Which one is undefined.
 
 In the beginning I had only a few but now after converting all of my bundles 
 (around 20) I have 10 lines of those. The ARCLite stuff seems to be the 
 implementation to get ARC to work on Snow Leopard.
 
 That's right. The warning is annoying but otherwise harmless. The machinery 
 that makes ARC code work on older deployment targets was designed for apps, 
 and doesn't work well in frameworks. A future developer tools release should 
 fix this.
 

This is quite a lot text and would flood the log files of my users. Is there 
any way to silence this?

 
 That should not be a problem. BUT I also get this:
 
 2012-02-02 23:35:54.057 Glyphs[9438:1803] *** NSInvocation: warning: object 
 0x1006db648 of class '__ARCLite__' does not implement 
 methodSignatureForSelector: -- trouble ahead
 2012-02-02 23:35:54.057 Glyphs[9438:1803] *** NSInvocation: warning: object 
 0x1006db648 of class '__ARCLite__' does not implement 
 doesNotRecognizeSelector: -- abort
 
 And this just crashes the app. Does anyone has a clue what is going on here? 
 google is not very helpful.
 
 That's bad. What is the backtrace?
 

I had another look (and fixed the symbolic breakpoints that were lost) and it 
crashes when calling :

currBundle = [NSBundle bundleWithPath:currPath];
currPrincipalClass = [currBundle principalClass];

The bundle (one of my plugins) links agains Cocoa.framework in the 10.7 SDK and 
has ARC enabled.

Thanks
Georg


___

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: ARC and 10.6

2012-02-03 Thread Georg Seifert
Me again.

I fixed it. I forgot to specify a Principle class for some of my plugins. This 
was no problem before, not with gcc (xCode 3) and not with clang in xCode 4. 

Thanks
Georg

On 03.02.2012, at 00:24, Greg Parker wrote:

 On Feb 2, 2012, at 2:51 PM, Georg Seifert georg.seif...@gmx.de wrote:
 I try to convert my app to use xCode 4.2 and ARC. My app uses several custom 
 frameworks and plugins. I used the migration tool to enable ARC for all of 
 them.
 
 As I still want to support Snow Leopard, I set the SDKROOT to 10.7 and the 
 Deployment Target to 10.6. But if I do that, on the startup of the app, I 
 get this in the console: 
 
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework2. One of the two will be used. Which one is undefined. // 
 removed the paths to frameworks...
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework3. One of the two will be used. Which one is undefined.
 objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
 [..]framework4. One of the two will be used. Which one is undefined.
 
 In the beginning I had only a few but now after converting all of my bundles 
 (around 20) I have 10 lines of those. The ARCLite stuff seems to be the 
 implementation to get ARC to work on Snow Leopard.
 
 That's right. The warning is annoying but otherwise harmless. The machinery 
 that makes ARC code work on older deployment targets was designed for apps, 
 and doesn't work well in frameworks. A future developer tools release should 
 fix this.
 
 
 That should not be a problem. BUT I also get this:
 
 2012-02-02 23:35:54.057 Glyphs[9438:1803] *** NSInvocation: warning: object 
 0x1006db648 of class '__ARCLite__' does not implement 
 methodSignatureForSelector: -- trouble ahead
 2012-02-02 23:35:54.057 Glyphs[9438:1803] *** NSInvocation: warning: object 
 0x1006db648 of class '__ARCLite__' does not implement 
 doesNotRecognizeSelector: -- abort
 
 And this just crashes the app. Does anyone has a clue what is going on here? 
 google is not very helpful.
 
 That's bad. What is the backtrace?
 
 
 -- 
 Greg Parker gpar...@apple.com Runtime Wrangler
 
 


___

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


ARC and 10.6

2012-02-02 Thread Georg Seifert
Hi,

I try to convert my app to use xCode 4.2 and ARC. My app uses several custom 
frameworks and plugins. I used the migration tool to enable ARC for all of them.

As I still want to support Snow Leopard, I set the SDKROOT to 10.7 and the 
Deployment Target to 10.6. But if I do that, on the startup of the app, I get 
this in the console: 

objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
[..]framework2. One of the two will be used. Which one is undefined. // removed 
the paths to frameworks...
objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
[..]framework3. One of the two will be used. Which one is undefined.
objc[9438]: Class __ARCLite__ is implemented in both [..]framework1 and 
[..]framework4. One of the two will be used. Which one is undefined.

In the beginning I had only a few but now after converting all of my bundles 
(around 20) I have 10 lines of those. The ARCLite stuff seems to be the 
implementation to get ARC to work on Snow Leopard.

That should not be a problem. BUT I also get this:

2012-02-02 23:35:54.057 Glyphs[9438:1803] *** NSInvocation: warning: object 
0x1006db648 of class '__ARCLite__' does not implement 
methodSignatureForSelector: -- trouble ahead
2012-02-02 23:35:54.057 Glyphs[9438:1803] *** NSInvocation: warning: object 
0x1006db648 of class '__ARCLite__' does not implement doesNotRecognizeSelector: 
-- abort

And this just crashes the app. Does anyone has a clue what is going on here? 
google is not very helpful.

If I use 10.7 as the deployment target non of this happens and the app runs 
fine on Lion.

Thanks
Georg


___

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: My services in my own app

2012-01-16 Thread Georg Seifert
Yes, I’m on Snow Leopard.

I just had a another look at the specs. there is something about a .service 
bundle. Can I put one of this in my .app bundle? And how do I register it?

Thanks
Georg

 You didn't indicate what version of Mac OS X you were running under.
 
 If this is happening under Snow Leopard, then this is a known issue in
 Snow Leopard that Apple fixed in Lion.
 
 The only work around I know is to put the service code in a separate
 (background) application that then calls back into your app to do
 whatever task you need it to do.
 
 Mark
 
 Hi,
 
 My app registers some services and they work just fine. Only if I invoke 
 then from within the same application, the app hangs. I tried with other 
 apps and they had the same problem.
 
 I searched the web for it but could not find anything.
 
 Is there anything I can do about it?
 
 Thanks
 Georg

___

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


My services in my own app

2012-01-15 Thread Georg Seifert
Hi,

My app registers some services and they work just fine. Only if I invoke then 
from within the same application, the app hangs. I tried with other apps and 
they had the same problem. 

I searched the web for it but could not find anything.

Is there anything I can do about it?

Thanks
Georg___

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


document saveing in Lion

2012-01-12 Thread Georg Seifert
Hi,

I have a problem and can find the right terms to search for it to solve my 
problem.

I have a app, that can read several documents as but can’t save them, it has a 
native file format is can save to. If I open such a file, it shows a locked 
in the title bar. If I unlock it and make some changes and close the document, 
it just saves to the same url as the opened file. As it saves in another file 
type, the file is rendered useless as the extension is wrong now. 

I suppose it should bring up a save panel either when I unlock it or when I 
close it, much like it does when duplicating.

Can someone shed some light on this?

Best
Georg Seifert___

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: document saveing in Lion

2012-01-12 Thread Georg Seifert
Sorry for replying to my own post.

Just as I wrote this, I found the File Type Fixing in -[NSDocument 
saveToURL:ofType:forSaveOperation:completionHandler:] in the release notes. 
But this behavior is not acceptable. The read-only files should not be deleted 
but the user should be asked for an place to save the new file.

By the way, this worked well in Snow Leopard.

Georg

On 12.01.2012, at 21:04, Georg Seifert wrote:

 Hi,
 
 I have a problem and can find the right terms to search for it to solve my 
 problem.
 
 I have a app, that can read several documents as but can’t save them, it has 
 a native file format is can save to. If I open such a file, it shows a 
 locked in the title bar. If I unlock it and make some changes and close the 
 document, it just saves to the same url as the opened file. As it saves in 
 another file type, the file is rendered useless as the extension is wrong 
 now. 
 
 I suppose it should bring up a save panel either when I unlock it or when I 
 close it, much like it does when duplicating.
 
 Can someone shed some light on this?
 
 Best
 Georg Seifert
___

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: diable localization

2011-04-08 Thread Georg Seifert
Hi,

Many thanks. That worked perfectly. 

I need this to allow my users to disable localization.

I use this:

- (IBAction) setDisableLocalization:(id) sender {
if ([sender state] == NSOnState) {
[[NSUserDefaults standardUserDefaults] setObject:[NSArray 
arrayWithObject:@en] forKey:@AppleLanguages];
}
else {
[[NSUserDefaults standardUserDefaults] 
removeObjectForKey:@AppleLanguages];
}
}

After a restart all is fine.

Best
Georg

Am 07.04.2011 um 23:58 schrieb Sean McBride:

 On Wed, 6 Apr 2011 09:43:58 +0200, Felix Franz said:
 
 I what to give my users the possibility to disable the localization of
 my app. Is there a way to tell the system (NSBundle?) to always load the
 english nibs?
 
 Just read http://homepage.mac.com/mmalc/Stepwise/Internationalization/
 it mentions the command line switch:
 
 $ /Applications/TextEdit.app/Contents/MacOS/TextEdit -AppleLanguages
 (Spanish)
 
 this is a normal default, so
 
 $ defaults write com.apple.TextEdit AppleLanguages (Spanish)
 
 should work, or set the argument/default inside the main function before
 calling NSApplicationMain
 
 In Xcode, you can also pass -AppleLanguages as an argument to your
 executable.  This lets you debug in any language, regardless of your
 preferred languages in System Prefs.
 
 --
 
 Sean McBride, B. Eng s...@rogue-research.com
 Rogue Researchwww.rogue-research.com
 Mac Software Developer  Montréal, Québec, Canada
 
 

___

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

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

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

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


validate Mac App store recipe

2011-04-07 Thread Georg Seifert
Hi,

I will bring my app to the app store soon and want to implement some validation 
of the app store recipe. But how do I test this. Where to get a valid recipe?

Best
Georg___

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: validate Mac App store recipe

2011-04-07 Thread Georg Seifert
Hi,

Sorry for the noise. I found it.

Thanks
Georg

Am 07.04.2011 um 12:07 schrieb Georg Seifert:

 Hi,
 
 I will bring my app to the app store soon and want to implement some 
 validation of the app store recipe. But how do I test this. Where to get a 
 valid recipe?
 
 Best
 Georg___
 
 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/georg.seifert%40gmx.de
 
 This email sent to georg.seif...@gmx.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


diable localization

2011-04-05 Thread Georg Seifert
Hi,

I what to give my users the possibility to disable the localization of my app. 
Is there a way to tell the system (NSBundle?) to always load the english nibs?

Best
Georg___

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


Drawing custom group row in TableView

2011-04-05 Thread Georg Seifert
Hi,

I have a custom NSTableView want to draw my own group row background. What Is 
the best way to do that.

I subclassed NSTableView and use a subclass of NSTextfieldCell to draw the 
table. What I can’t figure out, what to overwrite to add my own drawing code. 
Any ideas?

Best
Georg___

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: Master Detail

2011-03-17 Thread Georg Seifert
No, I meant the detail view changes the value according to the switch. And in 
my case it is actually a array in the person class and the switch determines if 
it is the first, the second or the third value to display. 

in the TableView I can do that with the datasource methods.

Thanks
g

On 16.03.2011, at 18:50, Quincey Morris wrote:

 On Mar 16, 2011, at 09:57, Georg Seifert wrote:
 
 If I have a master detail interface bound to a array controller.
 
 To explain my problem (the actual structure is different but as an 
 explanation):
 The list shows a some persons. Then I have a switch that selects if the 
 detail view shows the private or the work address. Is there any easy way do 
 that. 
 
 Now I use another array controller. On every selection change I make an 
 array of addresses and set as the content array.
 
 Is there an easier solution?
 
 Or can I change the keypath if the address switch changes?
 
 You should be able to rebind the detail view table column according to the 
 property you want it to display:
 
   [tableColumn bind: @value toObject: arrayController withKeyPath: 
 @address property name 1 or 2 options: ...];
 
 Or, you could create one table column for each address, and reconfigure the 
 table to show the appropriate column:
 
   [table addTableColumn: tableColumn1];
   [table removeTableColumn: tableColumn2];
 
 Or, you could just hide/show columns:
 
   [tableColumn1 setHidden: NO];
   [tableColumn2 setHidden: YES];
 
 Or, you could have two separate tables, and hide/show the appropriate table:
 
   [table1 setHidden: NO];
   [table2 setHidden: YES];
 
 It's also possible to create a derived data model address1OrAddress2 
 property, but this is only useful if the address mode doesn't need to be set 
 in different ways for different views of the data.
 
 

___

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


Master Detail

2011-03-16 Thread Georg Seifert
Hi,

If I have a master detail interface bound to a array controller.

To explain my problem (the actual structure is different but as an explanation):
The list shows a some persons. Then I have a switch that selects if the detail 
view shows the private or the work address. Is there any easy way do that. 

Now I use another array controller. On every selection change I make an array 
of addresses and set as the content array.

Is there an easier solution?

Or can I change the keypath if the address switch changes?

Best
Georg___

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: data over USB to iPhone

2011-01-16 Thread Georg Seifert
Thanks for all the answers.
Only to clarify. I don’t want to communicate from the iPhone to some device but 
from the mac to the iPhone (as a divice).

I did find some mentions of usbmuxd, and that it allows communication over USB. 
Does anyone know how to use it?

Best
Georg

Am 14.01.2011 um 14:37 schrieb Thomas Engelmeier:

 
 On 13.01.2011, at 20:19, Kyle Sluder wrote:
 
 On Thu, Jan 13, 2011 at 11:12 AM, Reaves, Timothy
 trea...@silverfieldstech.com wrote:
 That's not correct.  There are Apple approved cables to allow you to do
 exactly that (there is a serial cable too).  But my understanding is the
 cable itself is not certified by Apple, but the actual usage of the cable.
 You you can get one of the existing cables and see if you can use it for
 your purpose, or contact the cable manufacturer, and see what they would
 charge to provide cables to you that are certified by Apple.
 
 Are these cables part of the Made for iPhone program?
 
 Aside from USB audio and keyboards, there's no out-of-the-box support
 for communicating over USB with the iOS SDK.
 
 iPad iOS is able to work as an USB host for:
 
 - MTP devices
 - Mass Storage Devices
 
 If you want to ship an app using that feature, filing an bug reports / 
 feature request to de-private ImageCapture.framework makes sense ;-)
 
 
 ___
 
 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/georg.seifert%40gmx.de
 
 This email sent to georg.seif...@gmx.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


data over USB to iPhone

2011-01-13 Thread Georg Seifert
Hi,

Do I have any chance to transmit data from a mac to iPhone over USB? I have it 
running over wifi but the app would be used for a longer time next to the mac, 
so you need to plug it in anyways.

thanks
Georg___

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


disable animation of default button

2010-10-13 Thread Georg Seifert
Hi,

I have a subclass of NSButton. The bezel style is set to Push. If the button 
has the return key equivalent and becoming the default button (drawn blue) the 
- (void) drawBezelWithFrame:(NSRect)cellFrame inView:(NSView *)controlView 
method gets called over end over again. In the standard implementation this 
makes the button pulse.

I want to disable this for my subclass but can’t find the case of the redraw.

Regards
Georg S


___

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: Creating a Big and Resizable Question Mark in the Middle of a View

2010-08-15 Thread Georg Seifert
Or draw an attributed string in drawRect: 
calculate the font size from to the view size...

Georg

Am 15.08.2010 um 06:55 schrieb Peter Zegelin:

 Yep that worked:
 
   NSString *file = [[NSBundle mainBundle]pathForResource:@Question Mark 
 ofType:@pdf];
   NSData  *data = [NSData dataWithContentsOfFile:file];
   NSImage *image = [[NSImage alloc] initWithData:(NSData *)data];
   [imageView setImage:image];
 
 (I'm using GC).
 
 thanks!
 
 
 
 On 15/08/2010, at 2:08 PM, Quincey Morris wrote:
 
 On Aug 14, 2010, at 20:28, Peter Zegelin wrote:
 
 I would like the view to just have a large and resizable question mark in 
 the middle but am not sure how to create one. None of the IB controls seem 
 to fit the bill and before I get into using an NSTextView - which I haven't 
 used before and it looks complicated and overkill - I was wondering if 
 there is a simpler way to do this.
 
 Sounds like a job for NSImageView (with the appropriate scaling option), 
 with content supplied by a PDF file.
 
 
 kind regards,
 
 Peter Zegelin
 www.fracturedsoftware.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/georg.seifert%40gmx.de
 
 This email sent to georg.seif...@gmx.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


NSCollectionView and selecting range

2010-07-12 Thread Georg Seifert
Hi,

I asked this in my last post, but this was under the wrong topic.

My question:

In a NSCollectionView: How do I allow the range selection with the shift key 
(like in a tableView)? 

Best Regards
Georg

___

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: Custom control and cells

2010-07-10 Thread Georg Seifert

Am 10.07.2010 um 03:42 schrieb Michael Ash:

 On Fri, Jul 9, 2010 at 6:22 PM, Georg Seifert georg.seif...@gmx.de wrote:
 Hi,
 The thing is, I want to replicate the NSCollectionView but using cells 
 instead of views. The NSCollectionView has a lot of problems like 
 performance  and I couldn’t find a way to get the rect of the view of an 
 item (both fixed in Snow Leopard but I have to support Leopard).
 
 If I were writing this today, I would use views. I would make it so
 that it only had enough subviews to occupy the currently visible area.
 The rest of the collection view would be empty. As the user scrolled,
 I would create new views for the newly exposed items and add them
 dynamically. If view creation is too slow for this, I would implement
 some sort of view reuse mechanism that could load new data into the
 views that have scrolled off screen. This is basically how UITableView
 works on the iPhone, and if it can get good performance on that
 platform, you ought to be able to do great on any Mac that can run OS
 X.
 
I understand.

Jumping through some more holes, I did manage to implement most things I needed.

On thing I can’t figure out, is how to implement extending the selection with 
the shift key. Only the command modifier works by default.

Georg

 Mike
 ___
 
 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/georg.seifert%40gmx.de
 
 This email sent to georg.seif...@gmx.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Custom control and cells

2010-07-09 Thread Georg Seifert
Hi,
The thing is, I want to replicate the NSCollectionView but using cells instead 
of views. The NSCollectionView has a lot of problems like performance  and I 
couldn’t find a way to get the rect of the view of an item (both fixed in Snow 
Leopard but I have to support Leopard).

It would be interesting anyway if I could implement my own controls.

Best
Georg
 
 On Jul 7, 2010, at 4:14 AM, Georg Seifert wrote:
 
 Hi,
 
 I try to find an example on how to implement the mouse tracking and editing 
 behavior of a NSCell from my own control (subclass of NSControl). I need a 
 control that can handle several kinds of cells like ImageAndTextCell (with 
 editing) or popup button cells.
 
 I read a lot about it but can’t fit it together.
 
 It is probably easiest to just use controls that contain the cells, and not 
 try to make your control directly use multiple cells. With today's hardware, 
 the performance gains are not worth the extra coding effort.
 
 corbin
 
 

___

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: Custom control and cells

2010-07-09 Thread Georg Seifert
Hi,

 In what way do you believe a custom NSCell-based replication of 
 NSCollectionView will perform better than NSCollectionView itself? What 
 performance issue have you seen? Are you sure the problem lies with 
 NSCollectionView and not your own code surrounding it? (I.e., have you 
 Sharked your application?)

I have Sharked it a lot.

I have bound the CollectionView to a array with several hundred to several 
thousand items. There is a sidebar which filters the content, displaying a 
small subset of the content. Every time I change the filter, all previously not 
visible views are recreated. This may take several seconds. I could mostly 
avoid this by caching the item and the view (jumping through holes to find out 
how to do so). One half of the initial loading of the document is taken from 
the NSCollectionView. 

So the main problem is the time the CollectionView needs to archive and 
deserialize the item view prototype (I even improved this by creating the view 
in code in newItemForRepresentedObject:).

I just Sharked it and stoped the time again (on Snow Leopard) and it turns out 
that my optimization does work very well, taking the time to initiate the 
collectionview from 1 second to 0.1 sec. But the optimization does only work 
on SL. So all my users with Leopard and PowerPCs (there are several still using 
them) have to wait.

Saving of the collectionViewItems in the data object (This was one of the holes 
I jumped through), albite not working to cache the items in Leopard, can be 
used to get the frame of the view for the item in Leopard. Or is there a (even 
private) method to get this directly from the collectionView? (I have to check 
for the systems version number anyway)

Georg

 
 
 --
 michael
 
 On 09 Jul, 2010, at 15:22, Georg Seifert wrote:
 
 Hi,
 The thing is, I want to replicate the NSCollectionView but using cells 
 instead of views. The NSCollectionView has a lot of problems like 
 performance  and I couldn’t find a way to get the rect of the view of an 
 item (both fixed in Snow Leopard but I have to support Leopard).
 
 It would be interesting anyway if I could implement my own controls.
 
 Best
 Georg
 
 On Jul 7, 2010, at 4:14 AM, Georg Seifert wrote:
 
 Hi,
 
 I try to find an example on how to implement the mouse tracking and 
 editing behavior of a NSCell from my own control (subclass of NSControl). 
 I need a control that can handle several kinds of cells like 
 ImageAndTextCell (with editing) or popup button cells.
 
 I read a lot about it but can’t fit it together.
 
 It is probably easiest to just use controls that contain the cells, and not 
 try to make your control directly use multiple cells. With today's 
 hardware, the performance gains are not worth the extra coding effort.
 
 corbin
 
 
 
 ___
 
 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/mikey-san%40bungie.org
 
 This email sent to mikey-...@bungie.org

___

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

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

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

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


Custom control and cells

2010-07-07 Thread Georg Seifert
Hi,

I try to find an example on how to implement the mouse tracking and editing 
behavior of a NSCell from my own control (subclass of NSControl). I need a 
control that can handle several kinds of cells like ImageAndTextCell (with 
editing) or popup button cells.

I read a lot about it but can’t fit it together.

Does anyone have some sample code or explanation.

Best
Georg___

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


Manually set value of a textfield

2010-07-02 Thread Georg Seifert
Hi,

If I bind a textfield to the selection of a ArrayController and have more than 
one item with different value selected, I get a grayed out Multiple Value 
string. Is there a way of doing this manually? I have a popup that displays the 
values from the selection, but need to have some manual control over what is 
displayed. Is there something like Set to multiple selection state?

Best Regards
Georg___

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: using UTF-32 in NSString.

2010-06-28 Thread Georg Seifert

 You can do something like this:
 UniChar characters[2];
 CFIndex length = (CFStringGetSurrogatePairForLongCharacter(0x1ABCD, 
 characters) ? 2 : 1);
 
 CFStringCreateWithCharacters(NULL, characters, length);
 
 Aki

Is there anything like this in Leopard. This functions are new in Snow Leopard.

Thanks for all the answers.

Georg___

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


using UTF-32 in NSString.

2010-06-27 Thread Georg Seifert
Hi,

Does anyone has information on how to use Unicode code points higher than 
0x.
I need to add some supplementary multilingual plane code points to a NSString.

I can use something like this: 
NSString *aString = @\\u0001ABCD; //this prints fine but the [aString 
length] is 2

But if I have the unicode value as a int (unichar is to small)
int Char = 0x1ABCD;
NSString *aString = [NSString stringWithFormat:@%C, Char]; //The 
resulting string contains one character with a unicode value of ABCD.

What is the recommended way to use/create UTF-32 strings in Cocoa.

Best Regards
Georg

___

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


filtered NSCollectionView

2009-11-05 Thread Georg Seifert

Hi,

I have a problem with my NSCollectionView.

The itemView contains a textfield bound to the name property of the  
represented object.


If I filter the content array on represented.name and then use the  
textfield to change the name of on of the items I get this (on end  
editing):


2009-11-05 21:26:29.192 Glyphs[6872:a0f] Document import time: 1.688923
2009-11-05 21:26:55.353 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.353 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.353 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.353 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.353 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.353 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.354 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.354 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.354 Glyphs[6872:a0f] unlockFocus called too many  
time.
2009-11-05 21:26:55.354 Glyphs[6872:a0f] Unlocking Focus on wrong view  
(NSTextField: 0x19300390), expected GlyphIconView: 0x19300320


I did wrapped the drawing code in [NSGraphicsContext saveGraphicsState/ 
restoreGraphicsState];


Simplified it looks like this:
[NSGraphicsContext saveGraphicsState];
[[NSColor grayColor] set];
NSRectFill([self bounds]);
[NSGraphicsContext restoreGraphicsState];

If I remove drawRect: from my class, everything works fine.

I tried to remove the focus of the textField prior to setting represented.name 
, but I cant get the send action of the textfield to work.


Can anybody pleas help me with this?

Regards
Georg

___

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


enable/disable/check file Sharing from code

2009-09-21 Thread Georg Seifert

Hi,

Is there a way to enable and disable file sharing from code.

I only found this:
/usr/sbin/AppleFileServer
It seems to work but if I use it, the Sharing prefPane does not show  
the enabled state.


And is there a way to check if file sharing is running?

Are there recommended approaches to switch the other sharing services  
(internet, printer, Screen sharing) from code.


Thanks
Georg
___

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: enable/disable/check file Sharing from code

2009-09-21 Thread Georg Seifert



Is there a way to enable and disable file sharing from code.


Almost all background services are universally controlled by  
launchd. See man launchctl, launchd, et al.


This is not exactly my problem. I can start file sharing with just  
calling /usr/sbin/AppleFileServer. My question was how to to it that  
would also check the checkbox and respect the settings in the sharing  
pane (enable afs, smb and ftp it is selected in Options...).


regards
Georg
___

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


no mouseDown on dismissing context menu

2009-09-17 Thread Georg Seifert

Hi,

If I show a context menu in my view and then click somewhere in the  
view, mouseDown for the view is not called. Subsequent mouseDragged  
are triggered.


The view returns YES in acceptsFirstMouse and acceptsFirstResponder.

What do I miss?

Georg 
___


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: pulldown in custom NSCell

2009-08-31 Thread Georg Seifert

Hi corbin and Andreas,

Both approaches look promising. I will play with them.

Thanks
Georg



What I found is that the Cell, in its drawwithFrame method, adds  
subview to the TableView and this subview handles all the drawing  
and handling. Is this appropriate or is there a better solution.


In case you don't need a fully fledged TableView, have a look at  
this and see if it fits your bill:


http://www.harmless.de/cocoa-code.php#collectionview


___

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


pulldown in custom NSCell

2009-08-21 Thread Georg Seifert

Hi,

I want to build a custom cell similar to the one in Transfer list in  
Cyberduck. I need several pulldowns and input fields. I did looked at  
the code of Cyberduck but as it is written in Java I did not  
understand it completely. What I found is that the Cell, in its  
drawwithFrame method, adds subview to the TableView and this subview  
handles all the drawing and handling. Is this appropriate or is there  
a better solution.


Thanks
Georg
___

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


Custom grid view

2009-08-17 Thread Georg Seifert

Hi,

I try to implement a control with several  NSTextCells in it.

I have problems starting the edit mode.

So fare I tried this (in the control’s mouseDown):
NSText * textObj = [[self window] fieldEditor:YES forObject:_editCell];
[textObj setEditable:YES];
[textObj setFieldEditor:YES];
[textObj setSelectable:YES];
	[_editCell selectWithFrame:Frame inView:self editor:textObj  
delegate:self start:0 length:32000];			

[_editCell setUpFieldEditorAttributes:textObj ];
	[_editCell editWithFrame:Frame inView:self editor:textObj  
delegate:self event:theEvent ];


What else should I implement. Is there any sample code (I did searched  
the web but found nothing)?


Thanks
Georg___

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


define UTI in QuickLook plugin

2009-05-25 Thread Georg Seifert

Hi,

I have a QuickLook Plugin for a file format without a defined UTI, but  
has a defined fileType – the program is very carbonish. The developer  
promised to export the UTI in the next version but this will take  
another year or so).


For now I use the dynamic UTI. This works so far. How save it is to  
use the dynamic UTIs.


But, is there any way to define the UTI from within my QuickLook plugin?

Thanks
Georg

___

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: define UTI in QuickLook plugin

2009-05-25 Thread Georg Seifert


Am 25.05.2009 um 16:58 schrieb Sean McBride:


On 5/25/09 4:21 PM, Georg Seifert said:

I have a QuickLook Plugin for a file format without a defined UTI,  
but

has a defined fileType - the program is very carbonish. The developer
promised to export the UTI in the next version but this will take
another year or so).

For now I use the dynamic UTI. This works so far. How save it is to
use the dynamic UTIs.

But, is there any way to define the UTI from within my QuickLook  
plugin?


Don't use a dynamic UTI.  You should add a proper UTI declaration to
your QL Plugin's Info.plist.  Declare it in  
UTImportedTypeDeclarations.

Make sure it matches what the other app will use.



I did tried this earlier and it didn’t worked – until now that I tried  
it again.


Thanks for your reply.

Georg___

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


Fwd: Memory management in QuickLook plugin

2009-05-21 Thread Georg Seifert

As alway I didn’t send it to the list...



Use Zombies and Instruments.



http://www.corbinstreehouse.com/blog/index.php/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/



I do this all the time, but can’t figure out how to use Instruments  
with quicklookd. I can run it but how do I supply the argument.  
If I use qlmanage everything works fine.




Unfortunately, I don't know -- sorry!

I would suspect that if it is a consistent memory issue, running  
with NSZombiesEnabled and glmanage should make it happen consistently.


corbin



___

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


Memory management in QuickLook plugin

2009-05-20 Thread Georg Seifert

Hi,

I’m developing a QuickLook plugin for a custom binary file format.

As long as I did not cared about memory leaks everything was fine.  
Then I fixed the leak with the help of Instruments. Everything runs  
fine from xCode and Instruments but now it crashes if I run the plugin  
from the finder.


I have set up a custom executable with /usr/bin/qlmanage and the  
argument -p path/to/my/file.


Any advice is very welcome.

Regards
Georg___

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: Memory management in QuickLook plugin

2009-05-20 Thread Georg Seifert

Hi,

I’m developing a QuickLook plugin for a custom binary file format.

As long as I did not cared about memory leaks everything was fine.  
Then I fixed the leak with the help of Instruments. Everything runs  
fine from xCode and Instruments but now it crashes if I run the  
plugin from the finder.




Do you mean quicklookd crashes but qlmanage does not?

Yes.



I have set up a custom executable with /usr/bin/qlmanage and the  
argument -p path/to/my/file.


Any advice is very welcome.


We lack information here. We'd need to know where it is crashing.


This is definitely a memory problem. Sometimes it is about memory  
being double released and sometimes things like:
20.05.09 13:42:00 quicklookd[38490] [QL ERROR] Preview request  
generator for QLPreviewRequest /Users/georg/... raised '*** - 
[NSCFString saveGraphicsState]: unrecognized selector sent to instance  
0x138880'


the only call to saveGraphicsState is: [NSGraphicsContext  
saveGraphicsState];


So this seem exactly what happends with wrong retain/releases. The  
Problem is, I cannot debug it because in the debugger everything is  
fine.


Thanks

Georg

___

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: find out where is a key equivalent assigned

2009-04-10 Thread Georg Seifert

I do not have spaces turned on. And if I open a fresh project is workes.
Georg
I have a old project with a big nib file and it seems that  
somewhere is a key equivalent defined for ctrl+left cursor key.  
If I press ctrl+left cursor key nothing happend (option+left and  
everything else works fine).


I even tried subclassing NSApplication to track the event handling  
but with no success. I get the keypress event in NSApplication  
sendEvent: and in NSWindow sendEvent: but nothing more.


How do I find out where the event goes after this?


Ctrl-left arrow is one of the default hot keys used by Spaces. Do  
you have Spaces turned on?




___

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


find out where is a key equivalent assigned

2009-04-09 Thread Georg Seifert

Hello,

I have a old project with a big nib file and it seems that somewhere  
is a key equivalent defined for ctrl+left cursor key. If I press  
ctrl+left cursor key nothing happend (option+left and everything  
else works fine).


I even tried subclassing NSApplication to track the event handling but  
with no success. I get the keypress event in NSApplication sendEvent:  
and in NSWindow sendEvent: but nothing more.


How do I find out where the event goes after this?

Many thanks
Georg




:::
Georg Seifert
type and graphic design

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

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


custom formating of NSAttributedString

2009-03-01 Thread Georg Seifert

hello,

I want to apply some custom styles to a attributed string with a  
format bar (like in iWorks).


How do I connect my controls (pulldown or checkboxes) with the  
attributes in the selected range of the string.


Can I use binding or do I need to do it all manually (react on every  
change of the selection ...)?


I did searched the web but found nothing as I didn’t found the right  
keywords.


Thanks
Georg___

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


open folders as documents

2009-01-13 Thread Georg Seifert

hello,

I want to be able to select folders (with a certain extension, but no  
registered file type) in the open dialog of a NSDocument app.


- Is there a possibility to register a filetype without loosing the  
ability to see the content in the finder (without selecting show  
content)?

- or can I tell the open dialog to accept folders?


Thanks
Georg
___

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


Dynamically register document types

2009-01-12 Thread Georg Seifert

hello,

I have a program that uses plugins for supporting a wide range of  
documents.


Is there a way to tell Launch Services to include new file types if I  
install a new plugin?


I only found a discussion on cocoadev (http://www.cocoadev.com/index.pl?DynamiclyRegisteringDocumentTypes 
) where it says I have to update the info.plist. Is there any other way?


Thanks
___

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

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

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

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


Re: Image from font file

2008-11-10 Thread Georg Seifert

Once again me,

I just did a bit more searching. I found a quicklook-sample with  
displays a QLPreviewPanel. It shows the same image then the finder.  
But I like to get this image as a NSImage inside my app.
I use: QLThumbnailImageCreate but only get a thumbmail-like image. Is  
there any way to get the alphabet like in the preview panel? (I may be  
a privat API, the program will not going public soon).


Thanks
Georg
___

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]


image in CoreData

2008-11-06 Thread Georg Seifert

hello

I have a NSCollectionView populated with bindings. I want to show  
images witch are generated dynamically. I do not want to store those  
images in CoreData (at least not written to disk).


should I use an extra dictionary? Or subclass my entity?

any suggestion is welcome

Georg
___

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]


sourceView subnodes from CoreDate

2008-11-06 Thread Georg Seifert

Hello,

I have a OurlineView/SourceView similar to iTunes. I want to implement  
playlists. I use CoreData and bidings for my Data.


Is it possible to only store the content of one (top)node of the  
SourceView (populated with a NSTreeController) in CoreData? Or what  
would be a good solution to store them?


I use a TreeController and generate the top nodes manually. Do I need  
to use the datasource methodes and register for KVO?


Georg
___

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: file references in CoreData

2008-10-30 Thread Georg Seifert

Many thanks for your replies. I will try out the aliases.

Georg
___

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]


coredata: building tree from Entities

2008-10-30 Thread Georg Seifert

hello,

once again a beginner question on coredata.

I want to display my data in a outlineview grouped one of the entities  
attributes.

my Data:

Elements (
{titel1, name1},
{titel1, name2},
{titel2, name3},
{titel2, name4},
{titel2, name5} )

the OutlineView should show:

titel1
name1
name2
titel2
name3
name4
name5


Can I build it using fetched properties?

Any help or hint is appreciated.
Georg
___

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]


Image from font file

2008-10-30 Thread Georg Seifert

hello,

I wonder what is the best way to render images from a font file with a  
given string. The font is not activated in the system.


I came up with:
- using Quicklook, but I could only get images with Ag (like the  
icon for font files), not the alphabetic overview I get in the finder.  
(is there a way to render a sting with it?)
- activating the font locally, render the image and deactivate it.  
(this is a bit overkill I suppose (and I didn’t tried it))

- using a framework (like freetype)

Any suggestions are appreciated
Georg___

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: Image from font file

2008-10-30 Thread Georg Seifert

Thanks for your answer. I found this with google, too.

The problem is, I want to build somthing like a font preview app. So  
it needs to be fast and may happen with 10 or even 50 fonts at once.  
And it may conflict with activated fonts.


Georg

Am 30.10.2008 um 20:22 schrieb Jason Coco:



On Oct 30, 2008, at 11:40 , Georg Seifert wrote:


hello,

I wonder what is the best way to render images from a font file  
with a given string. The font is not activated in the system.


I came up with:
- using Quicklook, but I could only get images with Ag (like the  
icon for font files), not the alphabetic overview I get in the  
finder. (is there a way to render a sting with it?)
- activating the font locally, render the image and deactivate it.  
(this is a bit overkill I suppose (and I didn’t tried it))

- using a framework (like freetype)

Any suggestions are appreciated


If it's a regular, supported (but not activated) font file, you can  
do something like this (this is what I do actually):


#import Cocoa/Cocoa.h
#import ApplicationServices/ApplicationServices.h

/* ... */

NSString* fontsFolder = [[[NSBundle mainBundle] resourcePath]  
stringByAppendingPathComponent:@/Fonts];

NSURL* fontsURL = [NSURL fileURLWithPath:fontsFolder];

OSStatus status;
FSRef fsRef;
CFURLGetFSRef((CFURLRef)fontsURL, fsRef);
status = ATSFontActivateFromFileReference(fsRef,  
kATSFontContextLocal, kATSFontFormatUnspecified, NULL,  
kATSOptionFlagsDefault, NULL);


NSFont* myFont = [NSFont fontWithName:@My Font size:12.0];
[mWelcomeLabel setFont:myFont];

/* ... */

In this example, it assumes that your font files are in the  
application bundled under the Resources directory in a directory  
named Fonts, so basically:


/Applications/MyApplication.app/Contents/Resources/Fonts/MyFont.dfont

BTW, this call doesn't require linking to the full Carobn framework,  
nor does it actually activate the font in the Font Book... just for  
this instance of your application.


HTH, Jason


___

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]


file references in CoreData

2008-10-29 Thread Georg Seifert

hello,

I’m very new to CoreData and can’t find anything on this:

I need to store references to local files in CoreData. What is the  
best solution for this. Just now I use plain paths but there has to be  
a better way.


Thanks
Georg___

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: menu with checkbox

2008-09-11 Thread Georg Seifert
That what exactly what I was looking after. I think it would be not to  
strange in the context where it occurs in my app.


The normal selection behavior is for selecting the active layer in my  
view. The additional checkbox should allow to blend in/out the other  
layers.


I couldn’t think of a better/more intuitive way to achieve this.

To implement this, I just thought about using a tableview in the popup  
menu. There we have very similar behavior. You have a selection and  
checkboxes. And clicking the checkboxes does not change the selection.



Am 10.09.2008 um 21:38 schrieb Andrew Farmer:


On 10 Sep 08, at 12:02, Igor Mozolevsky wrote:

2008/9/10 Andrew Farmer [EMAIL PROTECTED]:

On 10 Sep 08, at 08:20, Georg Seifert wrote:


I have a NSPopupButton. What I need is that each item has a  
checkbox in
front of its label. The menu needs to be selectable like with any  
normal
NSPupupButton but when I click the checkbox it should just check  
the box but

should not change the selection.


This sounds like a really nonintuitive UI. A lot of users  
manipulate menus
by clicking and dragging, so releasing the mouse to click a  
checkbox would

dismiss the menu.


FYI, Safari menu does exactly that with Block Pop-Up windows and
Private Browsing...


No, a checkbox would look rather different... here, let me mock up  
what I was thinking the OP was asking for.


http://i34.tinypic.com/zjfqyr.png

If what they're after is simply the check marks that Safari and  
other applications use in menus, you can get that with -[NSMenuItem  
setState:], like I mentioned earlier.


___

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

2008-09-11 Thread Georg Seifert


On 11 Sep 2008, at 1:13 am, Georg Seifert wrote:


hello,

is there a way to create EPS data from code? I need it to put in in  
pastboard. Does anyone can point my to some docs as I cant find any.


What I want to do, is to copy a NSBezierPath to Illustrator and back.



does [NSView dataWithEPSInsideRect:] point the way at all?

There are also some lower-level EPS methods - entering 'eps' into  
the documentation browser search field should show you them.


hth,

Graham


hi,

 [NSView dataWithEPSInsideRect:] does not seem to help, unless I  
build a dummy view, draw in it and then use this method. but this  
seems to be quite complicated.


And the documentation didn’t showed me something helpful. There are  
methods to get EPS data in and out of a NSEPSImageRep but no obvious  
way to generate it.


Thanks
Georg___

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: menu with checkbox

2008-09-11 Thread Georg Seifert


My unsolicited advice: Don't use a popup menu; embed the table view  
in a palette. Popup menus with multiple controls in them are not a  
standard UI component, and are likely to generate significant user  
confusion. (Doubly so when there's two levels of checked-ness  
involved.)



I just thought a bit about the usage of controls in menus.

apple gives a example of how to use it: 
http://developer.apple.com/samplecode/MenuItemView/index.html
this breaks the click-drag-release behavior

and another example is the color-label selection in Finder. And this  
is useable with click-drag-release.


So if I find a way (and I think I have) to allow click-drag-release  
usage, then I should not confuse my users to much.


Georg
___

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: Rounding very small numbers.

2008-09-11 Thread Georg Seifert

cant you just multiply with 1, round it and divide 1?

g
Am 11.09.2008 um 10:11 schrieb Ryan Ragona:


Hey all,

I've been scouring the archives, but coming up without any solution  
that

seems to work in my application. Here is the issue:

I have some tiny numbers, like -0.00116916, for example, that I  
want
rounded to the 5th decimal place or so. -0.0 is plenty precise  
for my

purposes.

I attempted to do that with the following code:

NSDecimalNumberHandler* roundingBehavior = [NSDecimalNumberHandler
decimalNumberHandlerWithRoundingMode:NSRoundPlain scale:5];

NSDecimalNumber *roundFloat = NSDecimalNumber alloc]
   initWithFloat:0.00023]
   decimalNumberByRaisingToPower:5]
   decimalNumberByRoundingAccordingToBehavior:
roundingBehavior];

... but I'm getting the following warning:

NSDecimalNumberHandler may not respond to decimalNumberHandler...

... and in addition, my code crashes when I attempt to run with this
warning. XCode seems comfortable suggesting the
decimalNumberHandlerWithRoundingMode method, but it does not seem to  
work.
All of the code examples I see seem to have something exactly like  
this, but

it isn't at all working with my project.

Do I need to implement a protocol? I'm pretty lost. Am I going about  
this
totally the wrong way? Is there a much easier way to round? I don't  
really

need it stored, should I be using C methods? (How do I do that?)

Thanks!

-Ryan
___

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/georg.seifert 
%40gmx.de


This email sent to [EMAIL PROTECTED]


___

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]


EPS

2008-09-10 Thread Georg Seifert

hello,

is there a way to create EPS data from code? I need it to put in in  
pastboard. Does anyone can point my to some docs as I cant find any.


What I want to do, is to copy a NSBezierPath to Illustrator and back.
Thanks
Georg
___

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]


menu with checkbox

2008-09-10 Thread Georg Seifert

hello,

I have a NSPopupButton. What I need is that each item has a checkbox  
in front of its label. The menu needs to be selectable like with any  
normal NSPupupButton but when I click the checkbox it should just  
check the box but should not change the selection.


Does anyone can help me with this. I cannot find anything about this  
on the net.


Thanks
Georg
___

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: call setContentBorderThickness:forEdge: in Tiger

2008-08-26 Thread Georg Seifert

Hello Johan,

this was the mystery: Why it crashes with NSMinXEdge when I only use  
NSMinYEdge. But the comment from Shawn helped me find the right  
answer.


I have to set the Base SDK to 10.5 and the deployment SDK to 10.4.  
This, at least, solved the crash on Leopard. I cannot test it on  
Tiger, but it shall work.


Many Thanks for all your help,
Georg


Hello,

I have a problem:

- (id)initWithContentRect:(NSRect)contentRect styleMask: (unsigned  
int)windowStyle backing:(NSBackingStoreType)bufferingType defer: 
(BOOL)deferCreation

{
BOOL useTextured = YES;
	if([self  
respondsToSelector:@selector(setContentBorderThickness:forEdge:)]) {

windowStyle ^= NSTexturedBackgroundWindowMask;
useTextured = NO;
}

	self = [super initWithContentRect:contentRect  
styleMask:windowStyle backing:bufferingType defer:deferCreation];

if(!useTextured)
{
[self setContentBorderThickness:27.0 forEdge: NSMinYEdge];
}
return self;
}   

if I compile against the 10.5 SDK everything work fine. But if I  
use the 10.4 SDK it crashes:
*** Terminating app due to uncaught exception  
'NSInvalidArgumentException', reason:  
'setContentBorderThickness:forEdge: may not be called with  
NSMinXEdge'


Your error message says NSMinXEdge, but your code says  
NSMinYEdge Is that just a transcription error in mail? I think  
fixing that will lead you to your answer. Also, are you sure xoring  
is what you want to do? With XOR, you're unconditionally toggling  
the NSTexturedBackgroundWindowMask bit. Perhaps you mean to do that  
though.


Good Luck -
Jon Hess




(build and tested on Leopard, on Powerbook, latest OS and xCode)

Can someone help with this?

Thanks in advance.
Georg
___

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/jhess%40apple.com

This email sent to [EMAIL PROTECTED]




___

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]


call setContentBorderThickness:forEdge: in Tiger

2008-08-25 Thread Georg Seifert

Hello,

 I have a problem:

- (id)initWithContentRect:(NSRect)contentRect styleMask: (unsigned  
int)windowStyle backing:(NSBackingStoreType)bufferingType defer: 
(BOOL)deferCreation

{
BOOL useTextured = YES;
	if([self  
respondsToSelector:@selector(setContentBorderThickness:forEdge:)]) {

windowStyle ^= NSTexturedBackgroundWindowMask;
useTextured = NO;
}

	self = [super initWithContentRect:contentRect styleMask:windowStyle  
backing:bufferingType defer:deferCreation];

if(!useTextured)
{
[self setContentBorderThickness:27.0 forEdge: NSMinYEdge];
}
return self;
}   

if I compile against the 10.5 SDK everything work fine. But if I use  
the 10.4 SDK it crashes:
*** Terminating app due to uncaught exception  
'NSInvalidArgumentException', reason:  
'setContentBorderThickness:forEdge: may not be called with NSMinXEdge'


(build and tested on Leopard, on Powerbook, latest OS and xCode)

Can someone help with this?

Thanks in advance.
Georg
___

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: call setContentBorderThickness:forEdge: in Tiger

2008-08-25 Thread Georg Seifert

Hi Matt,

Your code does the same than mine. The code in question is called only  
on Leopard. But the problem occurs only there. Is seem that if you  
have compiled against 10.4 you cannot call functions from the 10.5  
SDK


Is there some compatibility build setting or something else?
Georg


Hi Georg,

How about doing something like this? (typed in Mail, so check for
typos). Using the preprocessor macros should also be a *bit* more
efficient, since it won't be doing any checks at runtime.

{
#if MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_5
windowStyle ^= NSTexturedBackgroundWindowMask;
#endif

self = [super initWithContentRect:contentRect styleMask:windowStyle
backing:bufferingType defer:deferCreation];

#if MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_5
[self setContentBorderThickness:27.0 forEdge: NSMinYEdge];
#endif

return self;
}

On Mon, Aug 25, 2008 at 12:22 PM, Georg Seifert  
[EMAIL PROTECTED] wrote:


Hello,

I have a problem:

- (id)initWithContentRect:(NSRect)contentRect styleMask: (unsigned  
int)windowStyle backing:(NSBackingStoreType)bufferingType defer: 
(BOOL)deferCreation

{
  BOOL useTextured = YES;
  if([self  
respondsToSelector:@selector(setContentBorderThickness:forEdge:)]) {

  windowStyle ^= NSTexturedBackgroundWindowMask;
  useTextured = NO;
  }

  self = [super initWithContentRect:contentRect  
styleMask:windowStyle backing:bufferingType defer:deferCreation];

  if(!useTextured)
  {
  [self setContentBorderThickness:27.0 forEdge:  
NSMinYEdge];

  }
  return self;
}

if I compile against the 10.5 SDK everything work fine. But if I  
use the 10.4 SDK it crashes:
*** Terminating app due to uncaught exception  
'NSInvalidArgumentException', reason:  
'setContentBorderThickness:forEdge: may not be called with  
NSMinXEdge'


(build and tested on Leopard, on Powerbook, latest OS and xCode)

Can someone help with this?

Thanks in advance.
Georg
___

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


This email sent to [EMAIL PROTECTED]


___

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]


@try @catch

2008-08-14 Thread Georg Seifert

hello,

is it recommended to use @try .. @catch blocks as flow control like it  
is used in Python. They say explicitly to use it rather than do a lot  
of test before just try if it works to look after it only if it fails.


I could imagine something:
- (id) layerInstance {
if ([[layerInstancesController selectedObjects] count]  0) {
return [[layerInstancesController selectedObjects] 
objectAtIndex:0];
}
return nil;
}
to look like:

- (id) layerInstance {
@try {
return [[layerInstancesController selectedObjects] 
objectAtIndex:0];
}
@catch {
return nil;
}
}

it should run faster if I do not have the if clause? Or are there any  
drawbacks?


Regards
Georg
___

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   >