|
Sizing NSCollectionViewItems to fit
Did you call -reloadData after resizing the itemPrototype? You have to get the collection view to regenerate all the views with the newly resized prototype. - Jon
Did you call -reloadData after resizing the itemPrototype? You have to get the collection view to regenerate all the views with the newly resized prototype. - Jon
|
By
Jon Gotow
· #3
·
|
|
Sizing NSCollectionViewItems to fit
Oh right - well, there's the manual 'reloadData' method - set content to an empty array, then back to your content array :-/ - Jon
Oh right - well, there's the manual 'reloadData' method - set content to an empty array, then back to your content array :-/ - Jon
|
By
Jon Gotow
· #5
·
|
|
WindowController
Is the 'window' outlet of the XIB file's owner set to point to the window in the XIB? It doesn't sound like it. - Jon
Is the 'window' outlet of the XIB file's owner set to point to the window in the XIB? It doesn't sound like it. - Jon
|
By
Jon Gotow
· #83
·
|
|
WindowController
Glad that fixed it! When you create a new source file for a class that's derived from NSWindowController, Xcode will offer to make the class files as well as a XIB file (all wired up) for you. Unfortu
Glad that fixed it! When you create a new source file for a class that's derived from NSWindowController, Xcode will offer to make the class files as well as a XIB file (all wired up) for you. Unfortu
|
By
Jon Gotow
· #87
·
|
|
Getting class when instantiating a singleton
Couldn't you just make it: static id instance; instead? - Jon
Couldn't you just make it: static id instance; instead? - Jon
|
By
Jon Gotow
· #275
·
|
|
Getting class when instantiating a singleton
No no - not: static id *instance; but static id instance; The id type is itself a pointer to an object. - Jon
No no - not: static id *instance; but static id instance; The id type is itself a pointer to an object. - Jon
|
By
Jon Gotow
· #277
·
|
|
sleep wake without runloop
Note that the IORegisterForSystemPower callback doesn't get called for wake/sleep cycles in Power Nap mode. That doesn't make sense to me, but when I filed a bug about it, Apple closed it with "behave
Note that the IORegisterForSystemPower callback doesn't get called for wake/sleep cycles in Power Nap mode. That doesn't make sense to me, but when I filed a bug about it, Apple closed it with "behave
|
By
Jon Gotow
· #447
·
|
|
Replace object at key path in NS[Mutable]Dictionary
I've always just converted the entire dictionary and its contents to mutable objects. I've included some code below for the necessary categories to implement "mutableCopyDeep" methods. It does a deep
I've always just converted the entire dictionary and its contents to mutable objects. I've included some code below for the necessary categories to implement "mutableCopyDeep" methods. It does a deep
|
By
Jon Gotow
· #483
·
|
|
Repeating timer firing way to fast
Not knowing how your code is structured, this may be a dumb question, but just to check: Are you certain that you're not creating multiple timers somehow? I've mistakenly done this when creating timer
Not knowing how your code is structured, this may be a dumb question, but just to check: Are you certain that you're not creating multiple timers somehow? I've mistakenly done this when creating timer
|
By
Jon Gotow
· #579
·
|
|
Crash with "illegal opcode" - how to debug this issue?
And that the block isn't being deallocated prematurely somehow. - Jon
And that the block isn't being deallocated prematurely somehow. - Jon
|
By
Jon Gotow
· #583
·
|
|
Replacement for Launch Services API
You can use the Service Management framework to add items to open at login (though they don't appear in System Preferences > Users & Groups > Login Items, which is a pet peeve of mine). See this answe
You can use the Service Management framework to add items to open at login (though they don't appear in System Preferences > Users & Groups > Login Items, which is a pet peeve of mine). See this answe
|
By
Jon Gotow
· #587
·
|
|
How to get App Icon
I think you may be trying too hard. NSAlert should show a badged copy of your application icon if you just leave it set to its defaults (don't set an icon at all). - Jon
I think you may be trying too hard. NSAlert should show a badged copy of your application icon if you just leave it set to its defaults (don't set an icon at all). - Jon
|
By
Jon Gotow
· #667
·
|
|
Show splash screen before finished launching?
Try putting this after your orderFront call: [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; The runloop basically has to do at least one iteration before the new
Try putting this after your orderFront call: [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; The runloop basically has to do at least one iteration before the new
|
By
Jon Gotow
· #682
·
|
|
Show splash screen before finished launching?
Hmph - now that you mention it, there's no current runloop at that point - the app is still launching. So [NSRunloop currentRunLoop] is probably returning nil. You could grabbing mainRunLoop and runni
Hmph - now that you mention it, there's no current runloop at that point - the app is still launching. So [NSRunloop currentRunLoop] is probably returning nil. You could grabbing mainRunLoop and runni
|
By
Jon Gotow
· #684
·
|
|
Window Position and Size Restored
See NSWindow.frameAutosaveName. That should take care of it for you. - Jon
See NSWindow.frameAutosaveName. That should take care of it for you. - Jon
|
By
Jon Gotow
· #697
·
|
|
Rendering control images in Dark Mode
[NSImage drawInRect:...] won't do it. NSImageView will render template images correctly, if you can somehow add one to your control, or you can use one of the methods discussed here: https://stackover
[NSImage drawInRect:...] won't do it. NSImageView will render template images correctly, if you can somehow add one to your control, or you can use one of the methods discussed here: https://stackover
|
By
Jon Gotow
· #841
·
|
|
unrecognized selector retainedCGImage
As Quincey said, it looks like you've got a zombie pointer that's now pointing to an NSWindowGraphicsContext instead of the original, now-deallocated NSSnapshotBitmapGraphicsContext. Turn on zombie ob
As Quincey said, it looks like you've got a zombie pointer that's now pointing to an NSWindowGraphicsContext instead of the original, now-deallocated NSSnapshotBitmapGraphicsContext. Turn on zombie ob
|
By
Jon Gotow
· #871
·
|
|
unrecognized selector retainedCGImage
Oh - here you go. It's in the scheme's Run > Diagnostics tab even back in Xcode 6: https://code.tutsplus.com/tutorials/what-is-exc_bad_access-and-how-to-debug-it--cms-24544 - Jon
Oh - here you go. It's in the scheme's Run > Diagnostics tab even back in Xcode 6: https://code.tutsplus.com/tutorials/what-is-exc_bad_access-and-how-to-debug-it--cms-24544 - Jon
|
By
Jon Gotow
· #872
·
|
|
find standard about panel
Well, its class is NSPanel rather than NSWindow - is it sufficient to just hide / show all NSPanels in the app's window list when you're deactivated / activated? Alternately, you can look at all NSPan
Well, its class is NSPanel rather than NSWindow - is it sufficient to just hide / show all NSPanels in the app's window list when you're deactivated / activated? Alternately, you can look at all NSPan
|
By
Jon Gotow
· #885
·
|
|
How to get Extended File Info
In Obj-C (getting width and height of an image in pixels): NSMetadataItem *mdItem = [[NSMetadataItem alloc] initWithURL:url]; NSDictionary *dict = [mdItem valuesForAttributes:@[NSMetadataItemPixelWidt
In Obj-C (getting width and height of an image in pixels): NSMetadataItem *mdItem = [[NSMetadataItem alloc] initWithURL:url]; NSDictionary *dict = [mdItem valuesForAttributes:@[NSMetadataItemPixelWidt
|
By
Jon Gotow
· #983
·
|