Re: realizeClass crash

2013-07-13 Thread Folami Nguyen
Hi Gideon,
Which platform is that user using.
I see in the report you are using Omni framework. It is using
initilaize/load method.
If your application is using ARC. It will be crash in 10.6.8.
Best regards,
Folami

2013/7/13 Gideon King 

> Hi, my application is crashing consistently for one user. The application
> is in use successfully by thousands of people, and this user has it
> installed on 3 machines but it only crashes on one of them.
>
> Any ideas what would cause this kind of crash?
>
> Crashed Thread:  0  Dispatch queue: com.apple.main-thread
>
> Exception Type:  EXC_BAD_INSTRUCTION (SIGILL)
> Exception Codes: 0x0001, 0x
>
> Application Specific Information:
> objc[423]: layout bitmap too short
>
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0   libobjc.A.dylib 0x7fff93813d4d _objc_trap() + 0
> 1   libobjc.A.dylib 0x7fff93813e8e _objc_fatal +
> 195
> 2   libobjc.A.dylib 0x7fff93814cfd
> set_bits(layout_bitmap, unsigned long, unsigned long) + 83
> 3   libobjc.A.dylib 0x7fff9380859d
> layout_bitmap_create + 277
> 4   libobjc.A.dylib 0x7fff93816a67
> realizeClass(class_t*) + 1460
> 5   libobjc.A.dylib 0x7fff9381754d
> realizeAllClasses() + 81
> 6   libobjc.A.dylib 0x7fff93818ca6
> objc_getClassList + 67
> 7   com.omnigroup.framework.OmniBase0x0001007954b7 +[OBPostLoader
> processSelector:initialize:] + 215
> 8   com.omnigroup.framework.OmniBase0x000100795394 +[OBPostLoader
> processClasses] + 36
> 9   com.omnigroup.framework.OmniBase0x00010079522c +[OBObject
> initialize] + 76
> 10  libobjc.A.dylib 0x7fff9380b236
> _class_initialize + 310
> 11  libobjc.A.dylib 0x7fff9380b138
> _class_initialize + 56
> 12  libobjc.A.dylib 0x7fff9380b138
> _class_initialize + 56
> 13  libobjc.A.dylib 0x7fff9380b0f3
> prepareForMethodLookup + 164
> 14  libobjc.A.dylib 0x7fff9380aeef lookUpMethod +
> 71
> 15  libobjc.A.dylib 0x7fff938092fc objc_msgSend +
> 188
> 16  com.novamind.NovaMind5  0x00010025cd6a
> +[OAPreferenceController(NM) load] + 95
> 17  libobjc.A.dylib 0x7fff93808d90
> call_load_methods + 389
> 18  libobjc.A.dylib 0x7fff9380898f load_images +
> 130
> 19  dyld0x7fff66e58e02
> dyld::notifySingle(dyld_image_states, ImageLoader const*) + 230
> 20  dyld0x7fff66e67057
> ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&,
> unsigned int, ImageLoader::InitializerTimingList&) + 357
> 21  dyld0x7fff66e66eba
> ImageLoader::runInitializers(ImageLoader::LinkContext const&,
> ImageLoader::InitializerTimingList&) + 54
> 22  dyld0x7fff66e58fc0
> dyld::initializeMainExecutable() + 207
> 23  dyld0x7fff66e5cb04
> dyld::_main(macho_header const*, unsigned long, int, char const**, char
> const**, char const**, unsigned long*) + 3060
> 24  dyld0x7fff66e58397
> dyldbootstrap::start(macho_header const*, int, char const**, long,
> macho_header const*, unsigned long*) + 761
> 25  dyld0x7fff66e5805e _dyld_start + 54
>
>
>
>
> Thanks
>
> Gideon
>
>
>
>
>
>
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post 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/nhphuoc%40oesf.jp
>
> This email sent to nhph...@oesf.jp
___

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

Please do not post 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: Problem saving document with my doc icon

2013-07-13 Thread Peter Teeson
On 2013-07-12, at 5:13 PM, Jens Alfke wrote:
> On Jul 12, 2013, at 12:29 PM, Peter Teeson  wrote:
>> In my Document based app I am having trouble saving a document with my 
>> document icon.
>> The Finder still shows the file with the folder icon.
> 
> You don't need any code to accomplish this. Just make sure your Info.plist 
> has a documentTypes entry
> for the filename extension you’re using for your bundle, and that the entry 
> notes that it’s a bundle, and points to a valid icon file.
> 
> —Jens
Thanks for your reply but I must still be doing something wrong.
The built app has the desired app icon. But the documents I save do not.
Here is the Info.plist from the app in the Build folder:

 NOTE: Will open in Xcode
This is what I used before adding the code shown in my original post.
Can you see what is missing or wrong?
Because with or without my added code I still get the Folder icon for the saved 
document file.

Peter



___

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

Please do not post 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: Problem saving document with my doc icon

2013-07-13 Thread Kyle Sluder
On Jul 13, 2013, at 8:23 AM, Peter Teeson  wrote:

> The built app has the desired app icon. But the documents I save do not.
> Here is the Info.plist from the app in the Build folder:

There is no plist attached to your message.

> 
> Because with or without my added code I still get the Folder icon for the 
> saved document file.

Did you remember to make your document's UTI conform to com.apple.package?

--Kyle Sluder

___

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

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

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

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

Re: Problem saving document with my doc icon

2013-07-13 Thread Peter Teeson

On 2013-07-13, at 12:57 PM, Kyle Sluder wrote:

> On Jul 13, 2013, at 8:23 AM, Peter Teeson  wrote:
> 
>> The built app has the desired app icon. But the documents I save do not.
>> Here is the Info.plist from the app in the Build folder:
> 
> There is no plist attached to your message.
Well I just checked my Sent copy and it was there with a note that it will open 
in Xcode.
Is there some moderator who has edited it and deleted without advising me?
Previously I did a Grab but it was rejected as being too large.
>> 
>> Because with or without my added code I still get the Folder icon for the 
>> saved document file.
> 
> Did you remember to make your document's UTI conform to com.apple.package?
I'm not sure. Where do I set that? in my fileWrappersOfType method? Or the 
Info.plist?

Peter
___

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

Please do not post 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-dev Digest, Vol 10, Issue 425

2013-07-13 Thread Pamela Grandt
I will be out of the office Fri. July 12

___

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

Please do not post 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: Problem saving document with my doc icon

2013-07-13 Thread Kyle Sluder
On Jul 13, 2013, at 10:15 AM, Peter Teeson  wrote:

> 
> On 2013-07-13, at 12:57 PM, Kyle Sluder wrote:
> 
>> On Jul 13, 2013, at 8:23 AM, Peter Teeson  wrote:
>> 
>>> The built app has the desired app icon. But the documents I save do not.
>>> Here is the Info.plist from the app in the Build folder:
>> 
>> There is no plist attached to your message.
> Well I just checked my Sent copy and it was there with a note that it will 
> open in Xcode.
> Is there some moderator who has edited it and deleted without advising me?

I believe the list software will  silently remove attachments under certain 
circumstances.

>>> 
>>> Because with or without my added code I still get the Folder icon for the 
>>> saved document file.
>> 
>> Did you remember to make your document's UTI conform to com.apple.package?
> I'm not sure. Where do I set that? in my fileWrappersOfType method? Or the 
> Info.plist?

In the exported types section of your Info.plist.

This is explained a bit more in the framework documentation, but to be honest 
there's so much out-of-date documentation about document types that it can be a 
little confusing.

--Kyle Sluder
___

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

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

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

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

Re: Problem saving document with my doc icon

2013-07-13 Thread Peter Teeson

On 2013-07-13, at 1:36 PM, Kyle Sluder wrote:
> 
>> On Jul 13, 2013, at 10:15 AM, Peter Teeson  wrote:
>>> 
>>> On 2013-07-13, at 12:57 PM, Kyle Sluder wrote:
>>> 
 On Jul 13, 2013, at 8:23 AM, Peter Teeson  wrote:
> The built app has the desired app icon. But the documents I save do not.
> Here is the Info.plist from the app in the Build folder:
 
 
>>> 
>>> There is no plist attached to your message.
>> Well I just checked my Sent copy and it was there with a note that it will 
>> open in Xcode.
>> Is there some moderator who has edited it and deleted without advising me?
> I believe the list software will  silently remove attachments under certain 
> circumstances.
> 
> Because with or without my added code I still get the Folder icon for the 
> saved document file.
 
 Did you remember to make your document's UTI conform to com.apple.package?
>>> I'm not sure. Where do I set that? in my fileWrappersOfType method? Or the 
>>> Info.plist?
> 
> In the exported types section of your Info.plist.
> 
> This is explained a bit more in the framework documentation,
> but to be honest there's so much out-of-date documentation about document 
> types that it can be a little confusing.
> --Kyle Sluder
Well here is my Info.plist from the Build directory app Package Contents in XML 
form

http://www.apple.com/DTDs/PropertyList-1.0.dtd";>


BuildMachineOSBuild
11G63b
CFBundleDevelopmentRegion
en
CFBundleDocumentTypes


CFBundleTypeExtensions

gmg

CFBundleTypeIconFile
DocIcons.icns
CFBundleTypeMIMETypes



CFBundleTypeName
DocumentType
CFBundleTypeOSTypes

GIMG

CFBundleTypeRole
Editor
NSDocumentClass
Document


CFBundleExecutable
Gimage
CFBundleIconFile
GIMG.icns
CFBundleIdentifier
com.pht.Gimage
CFBundleInfoDictionaryVersion
6.0
CFBundleName
Gimage
CFBundlePackageType
APPL
CFBundleShortVersionString
1.0
CFBundleSignature
GIMG
CFBundleVersion
1
DTCompiler
com.apple.compilers.llvm.clang.1_0
DTPlatformBuild
4H1503
DTPlatformVersion
GM
DTSDKBuild
11E52
DTSDKName
macosx10.7
DTXcode
0463
DTXcodeBuild
4H1503
LSApplicationCategoryType
public.app-category.word-games
LSMinimumSystemVersion
10.7
NSHumanReadableCopyright
Copyright © 2012 PHT Software. All rights reserved.
NSMainNibFile
MainMenu
NSPrincipalClass
NSApplication



Peter
___

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

Please do not post 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: Problem saving document with my doc icon

2013-07-13 Thread Kyle Sluder
On Jul 13, 2013, at 11:38 AM, Peter Teeson  wrote:

> Well here is my Info.plist from the Build directory app Package Contents in 
> XML form

Your Info.plist is lacking UTI declarations entirely. You need to declare an 
UTI for your document type, then specify that the CFBundleDocumentType maps to 
that UTI by adding the LSItemContentTypes key. The UTI you declare needs to 
confirm to com.apple.package in order for Launch Services to treat the folders 
your app writes as documents.

More information can be found:

- In the Uniform Type Identifiers Overview document

- In the Registering the File Types Your App Supports chapter of the Document 
Interaction Programming Topics (it applies to OS X as well)

- In the AppKit release notes for 10.4 and 10.5

--Kyle Sluder
___

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

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

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

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

Re: Problem saving document with my doc icon

2013-07-13 Thread Peter Teeson
Thanks for helping me. I dug out the docs you recommended and will learn.
Don't know how I missed this before. Maybe because I only do OS X stuff for the 
desktop.
No reason to deal with iOS things at this time.

Thanks again. Much appreciate your patience and kindness.

respect…

Peter

On 2013-07-13, at 2:48 PM, Kyle Sluder wrote:

> On Jul 13, 2013, at 11:38 AM, Peter Teeson  wrote:
> 
>> Well here is my Info.plist from the Build directory app Package Contents in 
>> XML form
> 
> Your Info.plist is lacking UTI declarations entirely. You need to declare an 
> UTI for your document type, then specify that the CFBundleDocumentType maps 
> to that UTI by adding the LSItemContentTypes key. The UTI you declare needs 
> to confirm to com.apple.package in order for Launch Services to treat the 
> folders your app writes as documents.
> 
> More information can be found:
> 
> - In the Uniform Type Identifiers Overview document
> 
> - In the Registering the File Types Your App Supports chapter of the Document 
> Interaction Programming Topics (it applies to OS X as well)
> 
> - In the AppKit release notes for 10.4 and 10.5
> 
> --Kyle Sluder


___

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

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

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

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

Zoom to actual size

2013-07-13 Thread Antonio Nunes
Hi,

I'm trying to ensure that when a user elects to zoom the view (in this case a 
PDFView) to actual size, that it shows the actual size on-screen as best it 
can. I'm really close, but not quite all the way there. I tested the same 
function in the Preview app, and there it works perfectly. When I zoom to 
actual size, and hold a sheet of paper (of the same size as the PDF page) to 
the screen, then they match perfectly. When I do the same in my app (which uses 
the system provided PDFView), the on-screen page is ever so slightly smaller 
than the physical page (say roughly 2mm).

This is the code in its current state:

#define MILLIMETERS_TO_POINTS_FACTOR2.834645669

- (IBAction)zoomToActualSize:(id)sender
{
NSDictionary *screenDescription = [self.previewCanvas.window.screen 
deviceDescription];
NSInteger screenID = [[screenDescription objectForKey:@"NSScreenNumber"] 
integerValue];
NSSize pixelSize = [[screenDescription objectForKey:@"NSDeviceSize"] 
sizeValue];
CGSize displaySize = CGDisplayScreenSize((CGDirectDisplayID)screenID); // 
Returns size in mm
displaySize.width *= MILLIMETERS_TO_POINTS_FACTOR; // So convert into points
CGFloat factor = pixelSize.width / displaySize.width; // (Shouldn't matter 
whether you calculate the factor by width or by height)
[self.previewCanvas setScaleFactor:factor];
}

Is there a way to improve on this? Apple must be doing something at least 
slightly different to achieve virtually perfect results. 

-António

-
Forgiveness is not an occasional act;
it is a permanent attitude.

--Martin Luther King, Jr
-

___

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

Please do not post 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

Advanced Techniques

2013-07-13 Thread Arved von Brasch
Hello list,

I'm hoping the list might have some recommendations on books or other sources.  
My web searches aren't turning up too much that is helpful, as so much is 
geared towards iOS these days.

I have a MacOS X app that was written quite naively some time ago (small, 
non-public release, for MacOS 10.5).  Data sets have grown considerably since 
it was written, and the problem of responsive interface is now quite glaring.  
It is a Core Data based app that makes heavy use of stored images and large 
amounts of text.  The images, at least, aren't stored in the Core Data 
database, rather a file system link is saved to them.  This is also true for 
the larger text stores.

The troubles are particularly with the length of time it takes to open the 
views that show the images.  This is an NSTableView and NSCollectionView that 
are loaded from the nib at the same time.  Saving changes to the text files 
also takes a lot longer than it should, given the speed that TextEdit can save.

The way I understand it, the NSTableView is probably not the problem, as 
NSTableViews already loads lazily.  NSCollectionView, however, loads everything 
up front.  Looking at other class options, I think what's going to be required 
is writing a modified NSCollectionView that does lazy loading.  I haven't had 
to do something like that before, and I'm not sure how to approach it.

The other optimisation steps that are required is otherwise mostly going to 
fall in the "taking advantage of multiple threads" variety.  At the moment 
everything is done on the main thread.  Saving and disk heavy access should 
definitely be done on background threads.  I don't have much experience with 
GCD, and it isn't clear to me how to retrofit this into the existing code.  
Some architectural changes may be necessary, in order to better take advantage 
of threads, and the improvements to the OS since Leopard.

So, I'm looking for resources that can help guide from the naive approach to 
more advanced techniques.  I'd appreciate any suggestions.

Thank you,
Arved
___

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

Please do not post 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

How to tell if file wrapper represents package

2013-07-13 Thread Shane Stanley
I'm populating an outline view from an array of file wrappers. Is there some 
way I can tell that a wrapper represents a bundle rather than a plain 
directory? I'm assuming there's some way I can check via the wrapper's 
preferredFilename's file extension, but I can't see how.

-- 
Shane Stanley 
'AppleScriptObjC Explored' 


___

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

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

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

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

Re: How to tell if file wrapper represents package

2013-07-13 Thread Lee Ann Rucker
Haven't tried it, but [NSWorkspace isFilePackageAtPath:] looks like what you 
want. If that's not sufficient, there are other things in NSWorkspace that test 
files.

- Original Message -
From: "Shane Stanley" 
To: "Cocoa-dev" 
Sent: Saturday, July 13, 2013 7:53:38 PM
Subject: How to tell if file wrapper represents package

I'm populating an outline view from an array of file wrappers. Is there some 
way I can tell that a wrapper represents a bundle rather than a plain 
directory? I'm assuming there's some way I can check via the wrapper's 
preferredFilename's file extension, but I can't see how.

-- 
Shane Stanley 
'AppleScriptObjC Explored' 


___

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

Please do not post 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/lrucker%40vmware.com

This email sent to lruc...@vmware.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