Re: Intercept Save when closing NSDocument

2017-02-10 Thread Trygve Inda
On 2/10/17, 9:19 AM, "Keary Suska" <cocoa-dev-bounces+cocoadev=xericdesign@lists.apple.com on behalf of cocoa-...@esoteritech.com> wrote: > >> On Feb 10, 2017, at 9:12 AM, Trygve Inda <cocoa...@xericdesign.com> >>wrote: >> >> When I close

Intercept Save when closing NSDocument

2017-02-10 Thread Trygve Inda
When I close an NSDocument, it puts up a sheet offering (Don¹t Save, Cancel, Save). Is there a way to intercept this? I would like to disable the Save button for a demo version of our app. I could mark the document as having no changes, but then it would just close directly and not allow a cancel

Re: Class is implemented in both

2016-08-15 Thread Trygve Inda
> >> On Aug 15, 2016, at 3:41 AM, Stephane Sudre wrote: >> >> . you could redefine the class name in the .pch of one project. > > +1 — I’ve had to do this before, and it works fine. Just add > #define MyDisplayManager MyDisplayManager_PP > or whatever. > > The caveat is

Class is implemented in both

2016-08-14 Thread Trygve Inda
I have a Pref Pane and a Screen Saver module. They both share a common helper class (MyDisplayManager). When the pref pane has been loaded and I go into the screen saver (or vis versa), because the host app is System preferences, I get: Class MyDisplayManager is implemented in both One of

Re: Core Data or not

2016-08-06 Thread Trygve Inda
> To do it as one fetch you can set your predicate (or a sub predicate) > as: [NSPredicate predicateWithFormat:@"%K in %@", primaryKey, keys] where > primaryKey is the name of your ID property, and keys is an array of ID > values which are "interesting" (as defined by the rest of your code). >

Re: Core Data or not

2016-08-06 Thread Trygve Inda
> On Aug 6, 2016, at 1:46 AM, Trygve Inda <cocoa...@xericdesign.com> wrote: >> For example, I would need to add items with ID# 204, 765, 983, 124, and 458 >> to the array. This seems like with Core Data it would be 5 different >> fetches. Or is there some efficient

Re: Core Data or not

2016-08-05 Thread Trygve Inda
> Little different perspective, Core Data tends to work drop dead easy for > simple stuff. Small data set with simple functionality should work straight > out of the box easy. > > And there is nothing wrong with creating a manual array of managed objects > from a Core Data result set. Currently

Core Data or not

2016-08-05 Thread Trygve Inda
I am considering moving an app to Core Data. Currently it manages an array of InterestingObjects. I use NSArrayControllers and TableViews. Everything works. I have two cases: 1. I have one array of all InterestingObjects and I set different predicates on the array controller to show only those

Method name starts with "set"

2016-08-01 Thread Trygve Inda
I have a class where I would like to have a method name like: -(void)setMaximumOperations:(NSInteger)operations { [[self operationQueue] setMaxConcurrentOperationCount:operations]; ... Do other stuff ... } Is this a bad idea? There is no property called "maximumOperations" in my class but

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Trygve Inda
>> >> I would think that even with a retain it could get weird... >> >> The main thread wants to use the imageRef property so it calls: >> >> myRef = [window.imageRef]; >> [myref retain]; >> >> If right between these calls, the worker thread calls setImageRef (on a >> property with atomic,

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Trygve Inda
> >> On 27 Jul 2016, at 12:05 PM, Trygve Inda <cocoa...@xericdesign.com> wrote: >> >> How is it retained by the main thread without an explicit retain call? >> >> I would be no different than a main thread calling: >> >> someVar [[MyObj alloc]

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Trygve Inda
> >> On 27 Jul 2016, at 10:05, Trygve Inda <cocoa...@xericdesign.com> wrote: >> >>> >> >> How is it retained by the main thread without an explicit retain call? > > are you not using ARC? If you are then all such references, both variable and

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Trygve Inda
> >> On 27 Jul 2016, at 09:33, Trygve Inda <cocoa...@xericdesign.com> wrote: >> >> >> >> If the worker thread calls window.imageRep = myResult; it is possible that >> the main thread is in the mi

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Trygve Inda
> e.g. > > worker thread: > > while( self.running ) > { > // do work > > window.imageRep = myResult; // window.imageRep is (atomic, copy) > > [performOnMainThread: window.setNeedsDisplay]; // this is obviously > pseudocode! > } > > > main thread, when it needs to terminate worker

Re: NSImage from bitmap - then delete bitmap

2016-07-23 Thread Trygve Inda
> On Jul 22, 2016, at 19:29 , Graham Cox wrote: >> >> If the worker thread is waiting for -performOnMainThread to complete, it >> *cannot* possibly get a call from the main thread to terminate > > I nodded agreement when I first read this, then “but wait!” … > > Your

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Trygve Inda
>> Currently it blocks at this point, but I need to avoid that. > > It’s not really clear why this needs to be avoided. The time to draw the > pixels should be a few milliseconds, a small fraction of the time your thread > needs to run, even at its fastest. Because the main thread sometimes

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Trygve Inda
> >> On 22 Jul 2016, at 4:08 PM, Trygve Inda <cocoa...@xericdesign.com> wrote: >> >> I don't think the second part will work because of my workflow: >> >> At Launch: Create pixel buffer that is 1000 x 1000 pixels >> >> Looping thread >>

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Trygve Inda
>> This is how it works now, but we are running into a rare deadlock situation >> where the main thread asks the worker thread to end (and waits until it does >> so) while the worker thread is waiting for the image to be displayed. > > If the window has a imageRep property that is (atomic,

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Trygve Inda
> >> On 22 Jul 2016, at 4:40 PM, Trygve Inda <cocoa...@xericdesign.com> wrote: >> >> >>> With half an eye on performance, if you *do* strictly need a copy of the >>> bitmap, note that NSBitmapImageRep conforms to NSCopying. You don’t have to >>

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Trygve Inda
> With half an eye on performance, if you *do* strictly need a copy of the > bitmap, note that NSBitmapImageRep conforms to NSCopying. You don’t have to > turn it into a TIFF and back again. > > Also, you don’t even need an NSImage - the NSImageRep can be drawn directly. A little deeper

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Trygve Inda
> >> On 22 Jul 2016, at 3:37 PM, Trygve Inda <cocoa...@xericdesign.com> wrote: >> >> I create an NSBitmapImageRep: >> >> [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL >> pixelsWide:pixelSize.width >> pixelsHigh:pixelSize.height >

NSImage from bitmap - then delete bitmap

2016-07-21 Thread Trygve Inda
I create an NSBitmapImageRep: [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:pixelSize.width pixelsHigh:pixelSize.height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bitmapFormat:NSAlphaFirstBitmapFormat

Custom window disappears dragging to second display

2016-05-02 Thread Trygve Inda
I have a custom window that basically eliminates the large title area. When you drag a normal window to a second screen, as the drag is in progress, the window appears semi-transparent on the second screen until enough of the window covers the second screen, whereupon it becomes opaque on the

Core Data user-defined fields

2016-05-02 Thread Trygve Inda
I have a core data document-based app at the document level is a Core Data type called Library, with a one to many relationship to type Element. Element has a few properties but I want to allow the user to add others (of type string only at this point). So I have Element: String name String

Xcode Source Compiling Order Issue

2016-04-25 Thread Trygve Inda
My product is a System Preferences Pane. Its principal class is MyPrefPane and is defined correctly in the Info.plist file under NSPrincipalClass. The bug I am seeing happens when trying to install a new version over the top of an older one if (and only if) System Preferences is closed or System

Re: Codesign broken in 10.11.4

2016-04-07 Thread Trygve Inda
> This may be relevant, though it does talk about issues with pref panes as > well. > > http://mjtsai.com/blog/2016/03/31/gatekeeper-bug-in-mac-os-x-10-11-4/ Yup. That sums it up. The short story: tested with a default Xcode command line tool that says "Hello World". 1) Build a command line

Codesign broken in 10.11.4

2016-04-07 Thread Trygve Inda
My app is built on 10.11.3. It is a prefPane with one command line tool and three app bundles (four helper tools) in it's bundle. I am getting GateKeeper warnings on 10.11.4 systems, but not on anything else. It is manually codesigned with my Developer ID... first the helper tool frameworks, then

NSThread to NSOperation and blockUntil

2016-03-21 Thread Trygve Inda
I have a thread that is invoked with: [NSThread detachNewThreadSelector:@selector(threadMethod:) toTarget:self withObject:self]; It uses NSConditionLock and works well. This thread performs a complex process but does it slowly so as to not use much processor time. I specify how long I want it

Re: NSTableView edit line, prevent dialog close with return key

2016-03-19 Thread Trygve Inda
> Ahh, the case of ambiguous ui > > Perhaps Disable OK while editing a cell; enable when edit ends, so > Return Return accepts then closes? > > Gary So how do I tell when editing begins since the control delegate is not called when editing actually begins, but rather when the first key is

NSTableView edit line, prevent dialog close with return key

2016-03-19 Thread Trygve Inda
I have an NSTableView in a sheet. The sheet has an OK button which closes the sheet (and is the default blue button). If I am editing a line of text in the NSTableView and press return, I want the editing to stop and be accepted, but I don't want the sheet to close due to the OK button accepting

Can't generate receipt OS X after 173 exit

2016-03-09 Thread Trygve Inda
I am no longer able to generate a receipt after exiting with code 173. When I launch, I get a box saying that the app was purchased on another computer and that I need to validate it. I enter my Apple ID and password, but I get "An unexpected error occurred while signing in" The Apple ID could

Apple Bug no response

2016-03-09 Thread Trygve Inda
I have an open bug report rdar://24316348 Apple asked for an example to reproduce which I sent on January 27, but I have heard nothing since. This is a fairly simple bug (NSTextFields can't fully justify on 10.11). How long should I expect to wait for a response? Thanks, Trygve

Re: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-09 Thread Trygve Inda
> If your hosting provider still charges an arm and a leg for SSL, switch. I need SSL for multiple subdomains. My host (Pair Networks) charges $449/yr for such a certificate. That seems really expensive. What are others paying for this? I have been very happy with Pair as we run a complex server

mmap quiet failure - all reads are 0x00

2016-02-05 Thread Trygve Inda
I have image data that is stored in a 150mb file which I use mmap to read. The image data is pulled into a NSBitmapImageRep pixel by pixel and eventually shows on the screen. Only a subset of the pixel in the mmap file are pulled into a single NSBitmapImageRep. A few customers (and I have seen

[NSThread callStackSymbols] weirdness

2016-02-03 Thread Trygve Inda
I am trying to track down a difficult bug on a customer's machine. I have inserted [NSThread callStackSymbols] at a critical place in the app where I want to see how it got there. When running a debug version, either in the debugger or not, I see: 2/3/16 10:53:51.070 PM MyApp Core[22398]: (

Re: App Transport Security exceptions App Store signed app

2016-01-27 Thread Trygve Inda
> Also, have you looked into setting up HTTPS on those servers instead of > working around its absence? Part of the reason Apple added ATS was to nudge > app developers to make their network connections more secure, which will > benefit users. It is basically a cost issue. It is expensive to set

Re: App Transport Security exceptions App Store signed app

2016-01-27 Thread Trygve Inda
> On 26 Jan 2016, at 9:55 pm, Trygve Inda <cocoa...@xericdesign.com> wrote: > >> connection failed: (null) The resource could not be loaded because the App >> Transport Security policy requires the use of a secure connection. >> http://www.earthdeskcloudhost02.c

Re: App Transport Security exceptions App Store signed app

2016-01-27 Thread Trygve Inda
> >> On Jan 27, 2016, at 7:32 AM, Trygve Inda <cocoa...@xericdesign.com> wrote: >> >> It is basically a cost issue. It is expensive to set up SSL certificates on >> 8 different servers... It would cost us about $700/yr > > Sounds like you’re being

App Transport Security exceptions App Store signed app

2016-01-26 Thread Trygve Inda
I am still getting an error despite my Info.plist beign configured correctly (as far as I can tell). Calls to http on my domain (xericdesign.com) work. Calls via http to my other domain (earthdeskcloudhost02.com) do not work. connection failed: (null) The resource could not be loaded because the

Re: NSTextFields will not fully justify in 10.11

2016-01-24 Thread Trygve Inda
> If it's autolayout, double-check it, especially the priorities; it might be > hugging more than you expect. What does the UI layout debugger show? I've > found some layout surprises that way. > It is not using Auto-Layout. I tried creating one with

Re: NSTextFields will not fully justify in 10.11

2016-01-24 Thread Trygve Inda
> On Jan 24, 2016, at 07:24 , Trygve Inda <cocoa...@xericdesign.com> wrote: >> >> It is not using Auto-Layout. I tried creating one with Auto-Layout and it >> doesn't work either. > > For interest’s sake: > > a. If you specify the text field as being left

NSTextFields will not fully justify in 10.11

2016-01-23 Thread Trygve Inda
When running in 10.11, my fully justified text fields are no longer so... They are left justified only. Is there a fix for this? Trygve ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: NSTextFields will not fully justify in 10.11

2016-01-23 Thread Trygve Inda
> >> On Jan 23, 2016, at 7:44 PM, Trygve Inda <cocoa...@xericdesign.com> wrote: >> >> When running in 10.11, my fully justified text fields are no longer so... >> They are left justified only. >> >> Is there a fix for this? > > Use an NSTextVi

Debug Pref Pane with System Integrity Protection

2015-09-29 Thread Trygve Inda
One of my projects is a System Preference Pane. With 10.11, Xcode's debugger can't debug it as I get a "can't attach to System Preferences because of System Integrity Protection". How can I debug my prefpane under 10.11, as I have done in every OS back to 10.3?

Thread-safe atomic property for array

2015-08-14 Thread Trygve Inda
My main thread periodically downloads some data from a website. This is extracted into an NSArray (non-mutable) and placed in a property: @property (atomic, retain) NSArray* myArray; [self setMyArray:webArray]; Ok so far... The atomic ensures that the property can be set correctly even if other

Re: Thread-safe atomic property for array

2015-08-14 Thread Trygve Inda
On Aug 14, 2015, at 6:59 PM, Trygve Inda cocoa...@xericdesign.com wrote: My main thread periodically downloads some data from a website. This is extracted into an NSArray (non-mutable) and placed in a property: @property (atomic, retain) NSArray* myArray; NSString* someString

Mavericks vs Yosemite line spacing

2015-08-12 Thread Trygve Inda
I have an NSTextField that is static and has multiple lines. Because of the different font used in Yosemite, the line spacing is thicker and when running on Yosemite, it requires more vertical space. Is there a way to align the text to the bottom of the content box, rather than the top?

NSManagedObject, NSString property retain vs copy

2015-07-30 Thread Trygve Inda
It seems Apple is using retain rather than copy for NSString properties in an NSManagedObject subclass. I was always under the impression that copy should be used for NSString, so why the retain?? Trygve ___ Cocoa-dev mailing list

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-29 Thread Trygve Inda
“Setter methods on queue-based managed object contexts are thread-safe. You can invoke these methods directly on any thread” https://developer.apple.com/library/mac/documentation/Cocoa/Reference/CoreData Framework/Classes/NSManagedObjectContext_Class/index.html In Apple's example, they

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Trygve Inda
On Jul 28, 2015, at 10:14 AM, Trygve Inda cocoa...@xericdesign.com wrote: On 28 Jul 2015, at 9:12 pm, Trygve Inda cocoa...@xericdesign.com wrote: I gather that when using NSPrivateQueueConcurrencyType, all operations (a fetch for example) have to be done within a performBlock call

NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Trygve Inda
I gather that when using NSPrivateQueueConcurrencyType, all operations (a fetch for example) have to be done within a performBlock call. Apple has sample code here: https://developer.apple.com/library/mac/samplecode/Earthquakes/History/Histo

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Trygve Inda
On 28 Jul 2015, at 9:12 pm, Trygve Inda cocoa...@xericdesign.com wrote: I gather that when using NSPrivateQueueConcurrencyType, all operations (a fetch for example) have to be done within a performBlock call. ... Then later, this context is used outside a performBlock: NSArray

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Trygve Inda
On 28 Jul 2015, at 9:12 pm, Trygve Inda cocoa...@xericdesign.com wrote: I gather that when using NSPrivateQueueConcurrencyType, all operations (a fetch for example) have to be done within a performBlock call. ... Then later, this context is used outside a performBlock: NSArray

Custom UTI in Preference Pane

2015-06-10 Thread Trygve Inda
My Preference Pane is able to import/export data in a custom format and I'd like to put this into a document with a specific filename extension. This obviosuly works for apps, but is ther ea way to do it with a Pref Pane? If the user double clicked a document, I'd want System preferences to open

SKPaymentTransaction, and Receipt on OS X

2015-06-07 Thread Trygve Inda
In my delegate: -(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions I call: (to make sure we are on the main thread): case SKPaymentTransactionStatePurchased: [self performSelectorOnMainThread:@selector(completeTransaction:)

Re: copyWithZone archive/unarchive

2015-01-30 Thread Trygve Inda
On Jan 29, 2015, at 9:44 PM, Trygve Inda cocoa...@xericdesign.com wrote: However, naming conventions expect copy to not be autoreleased so should the above really be: return ([copy retain]); Yes, if you're really still not using ARC ;-) —Jens I am not using ARC - this is a large

Re: copyWithZone archive/unarchive

2015-01-30 Thread Trygve Inda
On Jan 30, 2015, at 7:26 AM, Trygve Inda cocoa...@xericdesign.com wrote: On Jan 29, 2015, at 9:44 PM, Trygve Inda cocoa...@xericdesign.com wrote: However, naming conventions expect copy to not be autoreleased so should the above really be: return ([copy retain]); Yes, if you're

copyWithZone archive/unarchive

2015-01-29 Thread Trygve Inda
I have a custom class (MyCustomClass) and within another class I need to have MyCustomClass be a property whereby I make a copy (vs retaining). MyCustomClass is quite complex and so I was considering using: -(id)copyWithZone:(NSZone *)zone { MyCustomClass* copy = [NSKeyedUnarchiver

Re: Any way to force a window under the menu bar?

2015-01-26 Thread Trygve Inda
On 2015/01/26, at 14:54, Eric Schlegel eri...@apple.com wrote: Even if you force it under the menubar, you won’t see its content show up in the menubar; the menubar window pulls its blurred content exclusively from the desktop image. -eric But you could then create some excessive

Re: Any way to force a window under the menu bar?

2015-01-26 Thread Trygve Inda
On 26 Jan 2015, at 05:39, Trygve Inda cocoa...@xericdesign.com wrote: I have created a borderless NSWindow. Is there a way to force it to appear under the menu bar so that the content of the window shows through the translucent menu bar? The OS seems to be resizing or repositioning my

Re: Crash in libsystem_kernel.dylib`__workq_kernreturn:

2015-01-25 Thread Trygve Inda
On Jan 25, 2015, at 12:33 , Trygve Inda cocoa...@xericdesign.com wrote: It does seem like if I remove a call to NSData* imageData = [[self myImageRep] representationUsingType:NSJPEGFileType properties:imageProperties]; It no longer crashes, but the crash happens 3-5 seconds after

Any way to force a window under the menu bar?

2015-01-25 Thread Trygve Inda
I have created a borderless NSWindow. Is there a way to force it to appear under the menu bar so that the content of the window shows through the translucent menu bar? The OS seems to be resizing or repositioning my window to prevent it from sliding under the menu bar even when positioned

Re: Crash in libsystem_kernel.dylib`__workq_kernreturn:

2015-01-25 Thread Trygve Inda
What are you using for memory management then? Manual, GC? Sent from my iPad On 25 Jan 2015, at 22:57, Trygve Inda cocoa...@xericdesign.com wrote: On Jan 25, 2015, at 12:33 , Trygve Inda cocoa...@xericdesign.com wrote: It does seem like if I remove a call to NSData* imageData

Crash in libsystem_kernel.dylib`__workq_kernreturn:

2015-01-25 Thread Trygve Inda
I am getting a very weird, random crash in: libsystem_kernel.dylib`__workq_kernreturn: 0x7fff8381de60: movl $0x2000170, %eax 0x7fff8381de65: movq %rcx, %r10 0x7fff8381de68: syscall 0x7fff8381de6a: jae0x7fff8381de74; __workq_kernreturn + 20 0x7fff8381de6c: movq %rax,

Fast Enumeration and remove elements

2015-01-18 Thread Trygve Inda
Apple says: It is not safe to remove, replace, or add to a mutable collection’s elements while enumerating through it. If you need to modify a collection during enumeration, you can either make a copy of the collection and enumerate using the copy or collect the information you require during

FSEventStreamCreate: BUG in libdispatch client: kevent[EVFILT_WRITE]

2015-01-17 Thread Trygve Inda
I am getting an error in the Console when shutting down a FSEvent monitor I have verified that [self prefBundlePath] points to a valid directory (a prefpane bundle). BUG in libdispatch client: kevent[EVFILT_WRITE] delete: No such file or directory - 0x2 -(void)addFileEventCallback {

Re: FSEventStreamCreate: BUG in libdispatch client: kevent[EVFILT_WRITE]

2015-01-17 Thread Trygve Inda
On Jan 17, 2015, at 2:27 PM, Trygve Inda cocoa...@xericdesign.com wrote: I am getting an error in the Console when shutting down a FSEvent monitor I have verified that [self prefBundlePath] points to a valid directory (a prefpane bundle). BUG in libdispatch client: kevent[EVFILT_WRITE

NSURL resourceValuesForKeys NSURLPathKey

2015-01-08 Thread Trygve Inda
I call: NSData* bookmarkData = [url bookmarkDataWithOptions:NSURLBookmarkCreationMinimalBookmark includingResourceValuesForKeys:nil relativeToURL:nil error:inError]; And later: NSDictionary* dict = [NSURL resourceValuesForKeys:[NSArray arrayWithObject:NSURLPathKey] fromBookmarkData:[self

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Trygve Inda
On 6 Jan 2015, at 16:25, Trygve Inda cocoa...@xericdesign.com wrote: What then is the best way to do what I need? I am saving a bookmark to a file and later on I need to display the filename associated with that Bookmark. Currently I am getting the path and taking the last component

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Trygve Inda
On Jan 6, 2015, at 8:43 PM, Trygve Inda cocoa...@xericdesign.com wrote: Ultimately what I need to able to do is compare a bookmark to a path. Why? Or rather, what is the reason underlying that one? I am keeping a database of files that the user adds to a database. Internally I keep

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Trygve Inda
On Jan 6, 2015, at 7:40 PM, Kyle Sluder k...@ksluder.com wrote: On Jan 6, 2015, at 5:05 PM, Trygve Inda cocoa...@xericdesign.com wrote: If I bookmark a file and the case of any folders or the file itself changes, then later when I extract the path from the bookmark I want it to reflect

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Trygve Inda
On 5 Jan 2015, at 10:11 AM, Trygve Inda cocoa...@xericdesign.com wrote: I am using URLByResolvingBookmarkData . If I make a Bookmark to a file: /Volumes/Macintosh HD/Documents/MyFile.txt and later resolve it with URLByResolvingBookmarkData, I get the original path as expected

URLByResolvingBookmarkData not case sensitive

2015-01-05 Thread Trygve Inda
I am using URLByResolvingBookmarkData . If I make a Bookmark to a file: /Volumes/Macintosh HD/Documents/MyFile.txt and later resolve it with URLByResolvingBookmarkData, I get the original path as expected. Then if I change the filename to MYFILE.txt in the Finder and resolve the bookmark

Bug in removeStatusItem

2014-12-31 Thread Trygve Inda
I am running 10.9.5 with two displays. I call: // Prepare status item [self setStatusItem:[[NSStatusBar systemStatusBar] statusItemWithLength:24]]; [statusItem setEnabled:YES]; [statusItem setHighlightMode:YES]; [statusItem setMenu:statusMenu]; [statusItem setImage:[NSImage

Predicate Row Template array within array

2014-11-30 Thread Trygve Inda
I have an array of objects that looks like: { NSString* name; NSDate*date; NSArray* words; } The words array looks like: { NSString* id; NSString* word; } I need to build a Predicate Row template to result in a way to search for names, dates, and words. The first two

Re: Predicate Row Template array within array

2014-11-30 Thread Trygve Inda
{ NSString* name; NSDate*date; NSArray* words; } Objects; The words array looks like: { NSString* id; NSString* word; } Words; As a follow up: When I use a left expression of: @words.word And a modifier of: NSAnyPredicateModifier My predicate ends up as: ANY words.word

Re: Xcode fonts blurry

2014-11-15 Thread Trygve Inda
FYI, I use my 17 with my 27 Thunderbolt display and it works fine under all Mac operating systems from the past few years. Using it with a 15 retina MBP also works fine. It's more readable than the 15. This is just for reference. Is there a Thunderbolt adaptor for your 30? It is

Xcode fonts blurry

2014-11-14 Thread Trygve Inda
I have a 30 Apple Cinema Display that used to be hooked up to a 17 MBP. I just upgraded to a 15 MBP with Retina display and have the 30 Cinema display hooked up to it via a Dual Link Adapter. So I have the built-in retina display and a 30 non retina display. I am running 10.9.5. On my old

Singleton or class methods?

2014-09-13 Thread Trygve Inda
I have a project that involves several different targets. Included in all this is a set of related utility methods that need to be used by different sections of the code. I am wondering how is the best way to do this so that I don't have the same utility methods written in different places. 1. I

Crash on wake from sleep - mmap issue?

2014-08-06 Thread Trygve Inda
This crash is when trying to read from a file (130mb) that has been mmap'd. It only happens rarely, and only when waking from sleep, but happens on both 10.8 and 10.9. It is almost like the mmap memory is not available right when the system is woken up Any ideas? Exception Type:

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Trygve Inda
On 12 Jul 2014, at 10:05 pm, Trygve Inda cocoa...@xericdesign.com wrote: ---someProperty (Custom NSObject) --propertyA (NSNumber) --propertyB (NSNumber) --propertyC (NSNumber) Properties A, B and C use a binding to connect them to a user interface item with something like

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Trygve Inda
On 12 Jul 2014, at 10:05 pm, Trygve Inda cocoa...@xericdesign.com wrote: ---someProperty (Custom NSObject) --propertyA (NSNumber) --propertyB (NSNumber) --propertyC (NSNumber) Properties A, B and C use a binding to connect them to a user interface item with something like

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Trygve Inda
On 14 Jul 2014, at 7:29 am, Trygve Inda cocoa...@xericdesign.com wrote: Is NSInteger treated the same way? This page does not mention it: NSInteger is a typedef for 'long', which size depends on the platform (32/64 bit), so valueForKey: will wrap it as a NSNumber using type 'long

Re: KVC, binding multiple properties, top level object

2014-07-13 Thread Trygve Inda
On 14 Jul 2014, at 7:29 am, Trygve Inda cocoa...@xericdesign.com wrote: Is NSInteger treated the same way? This page does not mention it: NSInteger is a typedef for 'long', which size depends on the platform (32/64 bit), so valueForKey: will wrap it as a NSNumber using type 'long

KVC, binding multiple properties, top level object

2014-07-12 Thread Trygve Inda
My object layout looks like: -MyObject (custom NSObject) ---someProperty (Custom NSObject) --propertyA (NSNumber) --propertyB (NSNumber) --propertyC (NSNumber) Properties A, B and C use a binding to connect them to a user interface item with something like: Bind to MyObject with key

awakeFromNib multiple objects - all connected?

2014-07-04 Thread Trygve Inda
I have a nib that has several custom objects instantiated in it: NIB -ObjectA // contains outlets ABC -ObjectB // contains outlets DEF When object A receives awakeFromNib, I know that outlets A, B and C are hooked up, but it is also safe to call a method in ObjectB that requires ObjectB to have

Re: awakeFromNib multiple objects - all connected?

2014-07-04 Thread Trygve Inda
The nib is only ‘awake’ after all connections in the graph have been made. On Jul 4, 2014, at 11:18 PM, Trygve Inda cocoa...@xericdesign.com wrote: So the bottom line is: When an object in a nib receives awakeFromNib are all the outlets throughout the entire nib hooked up, or only those

Re: awakeFromNib multiple objects - all connected?

2014-07-04 Thread Trygve Inda
On Jul 4, 2014, at 8:18 PM, Trygve Inda cocoa...@xericdesign.com wrote: When an object in a nib receives awakeFromNib are all the outlets throughout the entire nib hooked up, or only those outlets in the object that is receiving awakeFromNib? All the outlets are hooked up. But not all

Re: awakeFromNib multiple objects - all connected?

2014-07-04 Thread Trygve Inda
On 5 Jul 2014, at 1:56 pm, Trygve Inda cocoa...@xericdesign.com wrote: As long as A can call into B C and know that B C have their outlets hooked up, that's fine. You can rely on all outlets being connected. What you can't rely on is the order in which each object's -awakeFromNib

App Store, Sandbox and loadable code bundle

2014-06-23 Thread Trygve Inda
I have an app that normally exists as a System Preference Pane. To get it to work in an app, and share the same code as the prefPane, I built a small host app that simply loads the prefPane (a Mach-O bundle) with: [self setPaneObject:[[[paneClass alloc] initWithBundle:paneBundle] autorelease]];

Re: FSPathMakeRef deprecated - replacement for LSSetItemAttribute?

2014-06-22 Thread Trygve Inda
On 22 Jun 2014, at 00:20, Trygve Inda cocoa...@xericdesign.com wrote: FSPathMakeRef is deprecated in 10.8, but LSSetItemAttribute requires an FSRef. Is there a correct way to create an FSRef or perhaps there is a replacement for LSSetItemAttribute to modernize: LSSetItemAttribute(fsRef

Sandboxing, AppleEvents (or other IAC method)

2014-06-22 Thread Trygve Inda
I have an app that was easy to get into the pre-sandbox App Store and am trying to find a way to get it back in there. There are actually two apps.. A GUI and a Renderer. The GUI controls all the settings, starts and stops the renderer and, while the renderer is running, sends messages to the

FSPathMakeRef deprecated - replacement for LSSetItemAttribute?

2014-06-21 Thread Trygve Inda
FSPathMakeRef is deprecated in 10.8, but LSSetItemAttribute requires an FSRef. Is there a correct way to create an FSRef or perhaps there is a replacement for LSSetItemAttribute to modernize: LSSetItemAttribute(fsRef, kLSRolesAll, kLSItemQuarantineProperties, NULL); Thoughts?

Re: Send msg to object by nameed NSString;

2014-06-20 Thread Trygve Inda
I would think 'copy' would still be ok with this (for example in the case of NSStrings) since that should still be released. For 'assign' I can see the advantage. It’s not just an advantage, it’s avoiding a crasher, most likely, and where it’s not, it’s avoiding silently corrupting an

Re: Send msg to object by nameed NSString;

2014-06-19 Thread Trygve Inda
On 19 Jun 2014, at 3:30 pm, Trygve Inda cocoa...@xericdesign.com wrote: Should I be doing: self.myProperty = [coder decodeObjectForKey:kMyProperty]; (isn't that effectively the same as a getter/setter)? Yep, it's the same, so you will gain nothing there. Guessing it would

Send msg to object by nameed NSString;

2014-06-18 Thread Trygve Inda
If I have a class: @interface MyClass : NSObject { NSNumber*myNumber; } @property (nonatomic, retain) NSNumber* myNumber; And in the class implementation I have: -(void)doSomething { // it could get this string from anywhere, not always a constant NSString* myString =

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Trygve Inda
On 19 Jun 2014, at 4:53 am, Daniel DeCovnick danhd...@mac.com wrote: Yes. You can either use key-value coding: [[self valueForKey:myString] release]; [value release]; These invocations of -release appear to be erroneous. Why do you have them there? If you think they should be

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Trygve Inda
On 19 Jun 2014, at 10:57 am, Trygve Inda cocoa...@xericdesign.com wrote: The method propertyKeys (below) is used to simplify and shorten the code in these classes since I want to encode/decode and (upon dealloc), release all the properties. -(void)dealloc { for (NSString* key

Re: Send msg to object by nameed NSString;

2014-06-18 Thread Trygve Inda
A performance related argument: using property getters and setters in -initWithCoder: and -encodeWithCoder: can bring with them serious performance issues. Might not matter in your case, or in most cases, but it really adds up if you have a large and complex object graph. A recent exercise

Dictionaries or custom class containing no methods?

2014-06-17 Thread Trygve Inda
I need to store a large collection of settings (not application preferences, but parameters describing how complex data is to be displayed) and am looking for pros/cons as to the best way. At the top I have a class called MySettings. Within this I need to have groups of related settings. They can

  1   2   3   4   5   >