Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
On Tue, Oct 20, 2015 at 2:48 AM, Richard Charles wrote: > >> On Oct 19, 2015, at 1:08 AM, Jacek Oleksy wrote: >> >> I double checked it (I use the screenshot mechanism, it displays the >> size of selection rectangle), and it is 24 on my toolbar (and also >> e.g. on the toolbar in Finder). > > I measured the height of the View segmented control in the Finder toolbar. It > is 22 points high not including the shadow at the bottom. This measurement > was done using the Pixie application which is part of the Xcode Graphics > Tools supplied by Apple. > > If you are examining the points or pixels of a control you should use the > Pixie application. It is like using a surgical knife with a microscope. It > has preferences for magnification factor, development mode, grid, mouse > hot-spot, mouse coordinates, and colors. > > Doing something similar with a screen shot would be like using a butter knife > with poor eye sight. You can do it but it is not the best tool in the toolbox. > I know that the tool is not the most precise one, but it is enough in this case (we are talking about 10% difference here!). The height discrepancy can be easily seen even without any tool, and I am talking here only about the bright part inside the button, not taking into account borders & shadows. BTW - are you on El Capitan? I think it was ok on Yosemite. /Jacek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post 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: Best Advice for accessing App Delegate's Managed Object Context
> On 2015 Oct 18, at 13:07, Michael de Haan wrote: > > I got rid of all the notification code, and substituted this in each > controller that needed access to the managedObjectContect > >> Just show me how to do that in Swift :) > > lazy var managedObjectContext:NSManagedObjectContext! … Very good, thank you. > Would you make the child view controllers of the splitViewController a > subclass of the splitViewController, or just of an NSViewController? The question almost answers itself: Your “child view controller” are view controllers. They each control a single view. Conclusion: They should inherit from NSViewController. NSSplitViewController is a thing that controls the splitting of multiple split views, but not the views themselves. > mySplitViewController : NSSplitViewController > || > || > Child1 :??Child2:?? It is confusing, with the parallel universes of views, view controllers and split views. You might want to fill out your diagram with the other objects on a piece of paper. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post 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: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
Or use the UI debugger in newer Xcodes. On Oct 19, 2015, at 5:58 PM, Richard Charles wrote: > >> On Oct 19, 2015, at 1:08 AM, Jacek Oleksy wrote: >> >> I double checked it (I use the screenshot mechanism, it displays the >> size of selection rectangle), and it is 24 on my toolbar (and also >> e.g. on the toolbar in Finder). > > Another option for this measurement would be to use the Pixie application in > conjunction with a diagonal drag screen shot. Use Pixie with any application > for precision cursor placement and measurement. > > --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/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
Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
> On Oct 19, 2015, at 1:08 AM, Jacek Oleksy wrote: > > I double checked it (I use the screenshot mechanism, it displays the > size of selection rectangle), and it is 24 on my toolbar (and also > e.g. on the toolbar in Finder). Another option for this measurement would be to use the Pixie application in conjunction with a diagonal drag screen shot. Use Pixie with any application for precision cursor placement and measurement. --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/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
> On Oct 19, 2015, at 1:08 AM, Jacek Oleksy wrote: > > I double checked it (I use the screenshot mechanism, it displays the > size of selection rectangle), and it is 24 on my toolbar (and also > e.g. on the toolbar in Finder). I measured the height of the View segmented control in the Finder toolbar. It is 22 points high not including the shadow at the bottom. This measurement was done using the Pixie application which is part of the Xcode Graphics Tools supplied by Apple. If you are examining the points or pixels of a control you should use the Pixie application. It is like using a surgical knife with a microscope. It has preferences for magnification factor, development mode, grid, mouse hot-spot, mouse coordinates, and colors. Doing something similar with a screen shot would be like using a butter knife with poor eye sight. You can do it but it is not the best tool in the toolbox. --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/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Swift: Trying to use ViewController(). to access object
> On Oct 19, 2015, at 1:53 PM, Eric E. Dolecki wrote: > > I am asking if there is a way to call a method or set a property on an > ViewController object from another class. Sure, you just need a reference to it. > let foo = ViewController() > foo.object.hidden = true > Something like that, but which works. It sounds like the actual question is “how do I get a reference to my ViewController?” The answer depends on the context. What’s the method that needs to do this? Show us the entire method (and what class it’s in.) Is it Cocoa programming in general that’s giving you problems, or is this something you know how to do in Objective-C but just aren’t sure in Swift? —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Debugging Faux Delegate calls
On Oct 19, 2015, at 4:11 PM, livinginlosange...@mac.com wrote: > > I have 4 NSComboBoxes in a view. I have a controller class which acts as the > delegate for these ComboBoxes. For some reason, after a period of time, and I > am trying to figure out why this is happening, when I enter ComboBoxA, my > delegate is invoked, but when I query the ComboBox making the call, it is > different from the box I am in. Show the code of the delegate methods and how you "query the ComboBox making the call" and determine which it is. At a guess, I suspect you have an assignment where you meant to have an equality comparison. Regards, Ken ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: titleForHeaderInSection wrong section count.
On Mon, Oct 19, 2015, at 01:26 PM, James Cicenia wrote: > I have a fetch > > let aFetchedResultsController = NSFetchedResultsController(fetchRequest: > fetchRequest, managedObjectContext: getManagedObjectContext(), > sectionNameKeyPath:"product.sectionKey", cacheName:nil) > > In the following function: > > func tableView(tableView: UITableView, titleForHeaderInSection section: > Int) -> String? { > print(section) > print (searchFetchedResultsController.sectionIndexTitles) > > I see: > > 30 > ["1", "2", "4", "8", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", > "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", > "Y", "Z"] > > Yes there are 30 elements but the array is zero based. > > What is happening here? Can you reproduce this in a sample app and attach it to a Radar? --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
Debugging Faux Delegate calls
I have 4 NSComboBoxes in a view. I have a controller class which acts as the delegate for these ComboBoxes. For some reason, after a period of time, and I am trying to figure out why this is happening, when I enter ComboBoxA, my delegate is invoked, but when I query the ComboBox making the call, it is different from the box I am in. These ComboBoxes are IBOutlets to ComboBox’s in my nib/xib. Any ideas on how best to debug this? I have no setters for ComboBoxes so I am not inadvertently changing them in the background. Thanks, Patrick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post 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: Swift: Trying to use ViewController(). to access object
By effect I meant it works as expected. Even when I set a variable to that ViewController, I get the error. I am asking if there is a way to call a method or set a property on an ViewController object from another class. let foo = ViewController() foo.object.hidden = true Something like that, but which works. On Mon, Oct 19, 2015 at 3:38 PM Jens Alfke wrote: > > On Oct 19, 2015, at 11:12 AM, Eric E. Dolecki wrote: > > I have been using NSNotificationCenter to affect objects in other classes > to good effect. > > > I don’t understand … that class is used to register notification observers > and to post notifications. What do you mean by “affect”? > > *ViewController().someObject.hidden = true* > > > > When I compile and run, I get a EXC_BAD_INSTRUCTION at that line. > > > That line doesn’t make sense to me. `ViewController()` will create a new > ViewController instance, but you’re never assigning it to a variable or > property, so it’s probably going to be dealloced after this line returns. > So this doesn’t really do anything. > > I know it exists in the ViewController scope before my line is called. > > > Again, I’m not sure what that means. Especially since the ViewController > object doesn’t exist before that line is called. > > —Jens > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Swift: Trying to use ViewController(). to access object
> On Oct 19, 2015, at 11:12 AM, Eric E. Dolecki wrote: > > I have been using NSNotificationCenter to affect objects in other classes > to good effect. I don’t understand … that class is used to register notification observers and to post notifications. What do you mean by “affect”? > *ViewController().someObject.hidden = true* > > When I compile and run, I get a EXC_BAD_INSTRUCTION at that line. That line doesn’t make sense to me. `ViewController()` will create a new ViewController instance, but you’re never assigning it to a variable or property, so it’s probably going to be dealloced after this line returns. So this doesn’t really do anything. > I know it exists in the ViewController scope before my line is called. Again, I’m not sure what that means. Especially since the ViewController object doesn’t exist before that line is called. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
UIActivityItemSource and Facebook?
Working with the UIActivityItemSource, I'm finding that Facebook won't take anything except an image or URL - is there any way to supply it with text? My code works fine with Mail, Twitter, etc. The Facebook and Messenger apps will display a supplied image, will extract an image from a URL in preference to using the image, but don't take text. Is it me or them? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: App keeps being told to open nonexistent doc on launch
Arghh! I found the problem, and it’s my fault. At some point I added command-line args to the scheme, intending for them to set user defaults, but forgot the “-” before the names, so they got interpreted as file paths to open. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
titleForHeaderInSection wrong section count.
I have a fetch let aFetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: getManagedObjectContext(), sectionNameKeyPath:"product.sectionKey", cacheName:nil) In the following function: func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { print(section) print (searchFetchedResultsController.sectionIndexTitles) I see: 30 ["1", "2", "4", "8", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] Yes there are 30 elements but the array is zero based. What is happening here? Thanks James ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post 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
Swift: Trying to use ViewController(). to access object
I have been using NSNotificationCenter to affect objects in other classes to good effect. However, is it possible to do something like this: *ViewController().someObject.hidden = true* When I compile and run, I get a EXC_BAD_INSTRUCTION at that line. *fatal error: unexpectedly found nil while unwrapping an Optional value. * I know it exists in the ViewController scope before my line is called. I get autocomplete in Xcode for the object too. I can't import the ViewController in Swift. Is there a simple trick to get this to work to avoid using NSNotificationCenter in many places? I can still do that but the ViewController(). 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/archive%40mail-archive.com This email sent to arch...@mail-archive.com
App keeps being told to open nonexistent doc on launch
I’ve got a weird problem in an OS X app project I’m dusting off after a long hiatus. Every time the app launches, it pops up error alerts saying it can’t open two documents. The underlying problem is that the files for those documents don’t exist (and they have weird paths that are down inside the project’s build directory.) Apparently somehow NSDocumentController is remembering those ancient files as part of the app’s state and is telling my NSDocument class to reopen them on launch. I can’t find any way to stop this from happening. My NSDocument subclass correctly returns NO and a file-not-found error from its -readFromURL:ofType:error method, but this doesn’t cause the nonexistent file to be removed from the app’s state. - I’ve used ‘defaults delete’ to delete the app’s defaults - I’ve deleted the app’s Application Support directory - I’ve deleted ~/Library/Saved Application State/my-bundle-id.savedState - I’ve deleted ~/Library/Preferences/my-bundle-id.LSSharedFileList.plist - I’ve searched ~/Library for any other filename containing the app’s bundle ID but didn’t find any - I’ve tried checking the “Launch app without persistent state restoration” checkbox in the scheme’s Options panel Where the @&%$ is this stale state being saved? And why won’t it go away even though the file clearly doesn’t exist? —Jens PS: I’m on OS X 10.11. But I saw this same problem briefly the last time I tried running this project back on 10.10. PPS: Here’s the backtrace of my NSDocument class being told to open the file: * frame #0: 0x00018b1f Viewer`-[DBDocument readFromURL:ofType:error:](self=0x60c421c0, _cmd="readFromURL:ofType:error:", absoluteURL=@"Test_AppList -- file:///Work/Viewer/build/Viewer/Build/Products/Debug/", typeName=@“generic", outError=domain: nil - code: 105827994372816) + 1919 at DBDocument.m:36 frame #1: 0x7fff9e2d341a AppKit`-[NSDocument _initWithContentsOfURL:ofType:error:] + 171 frame #2: 0x7fff9e2d3306 AppKit`-[NSDocument initWithContentsOfURL:ofType:error:] + 230 frame #3: 0x7fff9e3bf406 AppKit`-[NSDocumentController makeDocumentWithContentsOfURL:ofType:error:] + 627 frame #4: 0x7fff9e5ed96a AppKit`__97-[NSDocumentController makeDocumentWithContentsOfURL:alternateContents:ofType:completionHandler:]_block_invoke + 85 frame #5: 0x7fff9e5ed908 AppKit`-[NSDocumentController makeDocumentWithContentsOfURL:alternateContents:ofType:completionHandler:] + 225 frame #6: 0x7fff9e3be2cf AppKit`__80-[NSDocumentController openDocumentWithContentsOfURL:display:completionHandler:]_block_invoke + 635 frame #7: 0x7fff9e5ec8d9 AppKit`__144-[NSDocumentController _coordinateReadingAndGetAlternateContentsForOpeningDocumentAtURL:resolvingSymlinks:thenContinueOnMainThreadWithAccessor:]_block_invoke_2952 + 182 frame #8: 0x7fff9e5ec7eb AppKit`__144-[NSDocumentController _coordinateReadingAndGetAlternateContentsForOpeningDocumentAtURL:resolvingSymlinks:thenContinueOnMainThreadWithAccessor:]_block_invoke951 + 221 frame #9: 0x7fff9e5ec652 AppKit`__144-[NSDocumentController _coordinateReadingAndGetAlternateContentsForOpeningDocumentAtURL:resolvingSymlinks:thenContinueOnMainThreadWithAccessor:]_block_invoke_4 + 346 frame #10: 0x7fff8dbcf4dc CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 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: Safe time to add accessory view to NSSavePanel in sandboxed app?
That looks familiar back when I dealt with adding an accessory view under sand boxing. I don't have the code base available to me to know what I did differently or remind me further, but I know I did something different in the sandboxed version than the non-sandboxed. There's a number of web pages you should find related to the save panel UI hierarchy under sand boxing that should help, though. Search on things like NSSavePanel, sandbox, NSRemoteView, etc. -- Gary L. Wade (Sent from my iPhone) http://www.garywade.com/ > On Oct 19, 2015, at 8:22 AM, Marek Hrušovský wrote: > > I just went through my crashes and this thread popped up in google. > > I have additional information (one helpful method in the stack). Even if I > dig deep I still can't figure out what can cause the issue. Is anyone able > to get from "_hierarchyDidChangeInView" the line where it crashes? > > > Anyway I created rdar://23165196 > > > Marek. > > > Date/Time: 2015-10-14T19:16:34Z > > OS Version: Mac OS X 10.11.0 (15A278b) > > Report Version: 104 > > > Exception Type: SIGSEGV > > Exception Codes: SEGV_MAPERR at 0x7fc7a764438 > > Crashed Thread: 0 > > > Thread 0 Crashed: > > 0 libobjc.A.dylib 0x7fff84dcbe5d objc_msgSend + > 29 > > 1 ViewBridge 0x7fff9519ea42 > -[NSVBAccessoryWindow _hierarchyDidChangeInView:] + 69 > > 2 AppKit 0x7fff86593aea -[NSView > _setSuperview:] + 2602 > > 3 AppKit 0x7fff86592c28 -[NSView > addSubview:] + 448 > > 4 AppKit 0x7fff865fa754 -[NSWindow > setContentView:] + 638 > > 5 ViewBridge 0x7fff951d1253 > setWindowContentView + 75 > > 6 ViewBridge 0x7fff951b5d8b > -[NSRemoteViewBase setAccessoryView:] + 208 > > 7 AppKit 0x7fff86df9ed8 > -[NSVBSavePanel(NSSavePanelSPI) _sendAccessoryView:] + 49 > > 80x00010b56e3b0 0x10b4bf000 + 717744 > >> On Sat, Jul 18, 2015 at 12:14 AM, Martin Wierschin wrote: >> >> I just had a beta tester contact me about a very similar error/crash. It's >> slightly different than I've seen before, but it certainly seems related. >> >> The tester was closing a window backed by NSDocument. In response the >> AppKit document machinery was attempting to create an NSSavePanel, to allow >> the user to save or discard the file, but NSRemoteView threw an >> exception[1]. >> >> As I mentioned earlier in this thread, I've come to anticipate this. I now >> wrap the relevant NSDocument method to catch any exceptions and display a >> warning alert that the system save panel is (apparently) temporarily >> unavailable. This time the app crashed while trying to generate that alert; >> -[NSAlert init] was loading some localized string and crashed[2]. >> >> I doubt this is going to be reproducible, but it's reported as >> rdar://21881669. >> >> ~Martin Wierschin >> >> >> [1] INITIAL EXCEPTION: >> >> MyApp[807]: *** Assertion failure in -[NSRemoteView >> setServiceObject:forKey:], >> /SourceCache/ViewBridge/ViewBridge-105/NSRemoteView.m:3142 >>failed: invalid >>in: NSInternalInconsistencyException line 0 >>STACK TRACE: >> ... >> libobjc.A.dylib objc_exception_throw >> CoreFoundation+[NSException raise:format:arguments:] >> Foundation-[NSAssertionHandler >> handleFailureInMethod:object:file:lineNumber:description:] >> ViewBridge-[NSRemoteViewBase setServiceObject:forKey:] >> FoundationNSKeyValueNotifyObserver >> FoundationNSKeyValueDidChange >> Foundation-[NSObject(NSKeyValueObserverNotification) >> didChangeValueForKey:] >> AppKit-[NSDocument _preparedSavePanelForOperation:] >> ... >> AppKit-[NSDocument >> canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:] >> AppKit-[NSWindow __close] >> AppKit-[NSControl sendAction:to:] >> ... >> AppKitNSApplicationMain >> MyApp MyAppMain >> MyApp start >> >> >> >> [2] SUBSEQUENT CRASH: >> >> Exception Type:EXC_BAD_ACCESS (SIGSEGV) >> Exception Codes: KERN_INVALID_ADDRESS atVM Regions Near: >> ... >> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread >> 0 com.apple.CoreServices.CarbonCore _CSGetNamedData >> 1 com.apple.CoreFoundation _CFPropertyListCopyShared >> 2 com.apple.CoreFoundation >> CFBundleCopyLocalizedStringForLocalization >> 3 com.apple.Foundation -[NSBundle >> localizedStringForKey:value:table:] >> 4 com.apple.AppKit -[NSAlert init] >> 5 com.apple.AppKit +[NSAlert >> alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithForm
Re: Safe time to add accessory view to NSSavePanel in sandboxed app?
I just went through my crashes and this thread popped up in google. I have additional information (one helpful method in the stack). Even if I dig deep I still can't figure out what can cause the issue. Is anyone able to get from "_hierarchyDidChangeInView" the line where it crashes? Anyway I created rdar://23165196 Marek. Date/Time: 2015-10-14T19:16:34Z OS Version: Mac OS X 10.11.0 (15A278b) Report Version: 104 Exception Type: SIGSEGV Exception Codes: SEGV_MAPERR at 0x7fc7a764438 Crashed Thread: 0 Thread 0 Crashed: 0 libobjc.A.dylib 0x7fff84dcbe5d objc_msgSend + 29 1 ViewBridge 0x7fff9519ea42 -[NSVBAccessoryWindow _hierarchyDidChangeInView:] + 69 2 AppKit 0x7fff86593aea -[NSView _setSuperview:] + 2602 3 AppKit 0x7fff86592c28 -[NSView addSubview:] + 448 4 AppKit 0x7fff865fa754 -[NSWindow setContentView:] + 638 5 ViewBridge 0x7fff951d1253 setWindowContentView + 75 6 ViewBridge 0x7fff951b5d8b -[NSRemoteViewBase setAccessoryView:] + 208 7 AppKit 0x7fff86df9ed8 -[NSVBSavePanel(NSSavePanelSPI) _sendAccessoryView:] + 49 80x00010b56e3b0 0x10b4bf000 + 717744 On Sat, Jul 18, 2015 at 12:14 AM, Martin Wierschin wrote: > I just had a beta tester contact me about a very similar error/crash. It's > slightly different than I've seen before, but it certainly seems related. > > The tester was closing a window backed by NSDocument. In response the > AppKit document machinery was attempting to create an NSSavePanel, to allow > the user to save or discard the file, but NSRemoteView threw an > exception[1]. > > As I mentioned earlier in this thread, I've come to anticipate this. I now > wrap the relevant NSDocument method to catch any exceptions and display a > warning alert that the system save panel is (apparently) temporarily > unavailable. This time the app crashed while trying to generate that alert; > -[NSAlert init] was loading some localized string and crashed[2]. > > I doubt this is going to be reproducible, but it's reported as > rdar://21881669. > > ~Martin Wierschin > > > [1] INITIAL EXCEPTION: > > MyApp[807]: *** Assertion failure in -[NSRemoteView > setServiceObject:forKey:], > /SourceCache/ViewBridge/ViewBridge-105/NSRemoteView.m:3142 > failed: invalid > in: NSInternalInconsistencyException line 0 > STACK TRACE: > ... > libobjc.A.dylib objc_exception_throw > CoreFoundation+[NSException raise:format:arguments:] > Foundation-[NSAssertionHandler > handleFailureInMethod:object:file:lineNumber:description:] > ViewBridge-[NSRemoteViewBase setServiceObject:forKey:] > FoundationNSKeyValueNotifyObserver > FoundationNSKeyValueDidChange > Foundation-[NSObject(NSKeyValueObserverNotification) > didChangeValueForKey:] > AppKit-[NSDocument _preparedSavePanelForOperation:] > ... > AppKit-[NSDocument > canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:] > AppKit-[NSWindow __close] > AppKit-[NSControl sendAction:to:] > ... > AppKitNSApplicationMain > MyApp MyAppMain > MyApp start > > > > [2] SUBSEQUENT CRASH: > > Exception Type:EXC_BAD_ACCESS (SIGSEGV) > Exception Codes: KERN_INVALID_ADDRESS atVM Regions Near: > ... > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread > 0 com.apple.CoreServices.CarbonCore _CSGetNamedData > 1 com.apple.CoreFoundation _CFPropertyListCopyShared > 2 com.apple.CoreFoundation > CFBundleCopyLocalizedStringForLocalization > 3 com.apple.Foundation -[NSBundle > localizedStringForKey:value:table:] > 4 com.apple.AppKit -[NSAlert init] > 5 com.apple.AppKit +[NSAlert > alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:] > 6 com.company.myapp __84-[MyApp > delayedWarnAboutUnavailableSavePanel:]_block_invoke > 7 libdispatch.dylib _dispatch_call_block_and_release > 8 libdispatch.dylib _dispatch_client_callout > ... > 17 com.apple.AppKit -[NSApplication > nextEventMatchingMask:untilDate:inMode:dequeue:] > 18 com.apple.AppKit -[NSApplication run] > 19 com.apple.AppKit NSApplicationMain > 20 com.company.myapp MyMain > 21 com.company.myapp start > > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-a
Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
On Fri, Oct 16, 2015 at 10:57 PM, Richard Charles wrote: > >> On Oct 16, 2015, at 1:24 AM, Jacek Oleksy wrote: > >> Still, I have no idea why the 22 vs 24px :/ > > It’s points not pixels. User interface elements are resolution independent. > Right, I meant logical pixels (or points). /Jacek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post 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: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
I double checked it (I use the screenshot mechanism, it displays the size of selection rectangle), and it is 24 on my toolbar (and also e.g. on the toolbar in Finder). /Jacek On Fri, Oct 16, 2015 at 11:31 PM, Richard Charles wrote: > >> On Oct 16, 2015, at 1:24 AM, Jacek Oleksy wrote: >> >> Still, I have no idea why the 22 vs 24px :/ > > Just made a new project in Xcode. Put a Rounded Textured Button in a view. > Put a Rounded Textured Button in a toolbar. > > Launched the app and measured button height with Pixie. Both buttons measured > 22 points high not including the shadow at the bottom. > > --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/archive%40mail-archive.com This email sent to arch...@mail-archive.com