Re: File UTI on 10.6.8

2012-01-03 Thread Quincey Morris
On Jan 2, 2012, at 23:57 , Martin Hewitson wrote: > I want to check if a file extension is registered as a text file. So I made a > little category method on NSString like this: > > - (BOOL)isText > { > BOOL fileIsText = NO; > > CFStringRef fileExtension = (CFStringRef) self; > CFStringRef

RE: Setting ApplePressAndHoldEnabled key for specific application.

2012-01-03 Thread Vaibhao Mahore
Hi Jens, I have used Boolean value while setting ApplePressAndHoldEnabled key using [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"ApplePressAndHoldEnabled"] . Even I tried with setting it using defaults tool. 1. defaults write < my application bundle-identifier >

RE: Modal Window for NSTextField

2012-01-03 Thread Dany Golubitsky
Hello again. I am sorry, I am new to Cocoa and some things that looks completely obvious to you are completely unknown to me. (controlTextDidEndEditing: notification) - What is this function, where should it be implemented, who should call it? How need I start the TextField? For my code I need

Re: File UTI on 10.6.8

2012-01-03 Thread Martin Hewitson
On 3, Jan, 2012, at 09:42 AM, Quincey Morris wrote: > On Jan 2, 2012, at 23:57 , Martin Hewitson wrote: > >> I want to check if a file extension is registered as a text file. So I made >> a little category method on NSString like this: >> >> - (BOOL)isText >> { >> BOOL fileIsText = NO; >>

Re: File UTI on 10.6.8

2012-01-03 Thread Martin Hewitson
Actually, it seems that the NSWorkspace method behaves differently, (assuming I'm using it correctly): [[NSWorkspace sharedWorkspace] filenameExtension:@"pdf" isValidForType:(NSString *)kUTTypeText] returns YES whereas the UTTypeConformsTo() solution returns NO. So am I passing the wrong valu

Strategies for dynamic modification of search results in NSTextViews

2012-01-03 Thread Martin Hewitson
Dear list, I have an app which managed a bunch of files and presents these text files for viewing and editing in NSTextViews. I have implemented a project-wide search functionality which works fine, but with one problem. If the user changes the text in one file after making a search, then the s

Re: CGDisplayHideCursor and -[NSWindow toggleFullScreen] don't get along on Lion

2012-01-03 Thread Michael Crawford
I'm curious. I swapped out my calls to CGDisplayHideCursor and CGDisplayShowCursor with +[NSCursor hide] and +[NSCursor unhide], respectively. Same behavior. I wanted to know if one called the other so I set a breakpoint on the CGDisplay methods and called the NSCursor methods. They don't ap

Re: Modal Window for NSTextField

2012-01-03 Thread Fritz Anderson
On 3 Jan 2012, at 3:29 AM, Dany Golubitsky wrote: > I am sorry, I am new to Cocoa and some things that looks completely obvious > to you are completely unknown to me. > (controlTextDidEndEditing: notification) - What is this function, where > should it be implemented, who should call it? It is

Versions, -windowWillClose:

2012-01-03 Thread Martin Hewitson
Dear list, I'm investigating getting the new 10.7 Versions stuff working on my NSPersistentDocument app. In doing that, I've seen a couple of strange things which I wanted to check on. Firstly, all I've done to make it work is to return YES from +autosavesInPlace. Now, what I notice is the fo

cannot form weak reference to ..

2012-01-03 Thread Roland King
I have this line of code, just before a block is enqueued onto a dispatch queue. weakSelf is used in that block. RKHIPCard __weak *weakSelf= self; which is generating the following error objc[15245]: cannot form weak reference to instance (0x89b4100) of class RKHIPCard i

Re: Static variables reset inside CFPlugin code

2012-01-03 Thread Jens Alfke
On Jan 2, 2012, at 6:27 PM, Grandinetti Philip wrote: > But I'm troubled by this solution. If I set debugger break points in the > "Units" library the debugger no longer stops at those breakpoints when called > by the plugin, but it does stop at those breakpoints when called by the main > ap

Re: File UTI on 10.6.8

2012-01-03 Thread Quincey Morris
On Jan 3, 2012, at 02:11 , Martin Hewitson wrote: > Actually, it seems that the NSWorkspace method behaves differently, (assuming > I'm using it correctly): > > [[NSWorkspace sharedWorkspace] filenameExtension:@"pdf" > isValidForType:(NSString *)kUTTypeText] > > returns YES > > whereas the UT

Re: File UTI on 10.6.8

2012-01-03 Thread Martin Hewitson
On 3, Jan, 2012, at 07:14 PM, Quincey Morris wrote: > On Jan 3, 2012, at 02:11 , Martin Hewitson wrote: > >> Actually, it seems that the NSWorkspace method behaves differently, >> (assuming I'm using it correctly): >> >> [[NSWorkspace sharedWorkspace] filenameExtension:@"pdf" >> isValidForTyp

Re: Mouse up events ignored when sandboxing is turned on?

2012-01-03 Thread Nick Zitzmann
On Dec 30, 2011, at 12:49 PM, Nick Zitzmann wrote: > The really strange thing is, this works as expected when sandboxing is turned > off. It also works as expected if the window was active. But I can't ship the > application with sandboxing on unless I can figure out how to fix or work > aroun

Re: File UTI on 10.6.8

2012-01-03 Thread Quincey Morris
On Jan 3, 2012, at 10:29 , Martin Hewitson wrote: > I don't know how to check that. In any case, I'm left wondering which one to > use. I want that .pdf is not a text file, so I guess I'll stick with the > UTTypeConformsTo() solution, though this all feels a little fragile. I may > make hard-co

Re: What are the best macros to use to know when compiling is for Mac OS X v.s. iOS?

2012-01-03 Thread Greg Parker
On Dec 30, 2011, at 10:34 AM, lbland wrote: > On Dec 30, 2011, at 1:16 PM, Conrad Shultz wrote: > >> http://developer.apple.com/library/mac/#documentation/developertools/conceptual/cross_development/Using/using.html > > So... > > __MAC_OS_X_VERSION_MAX_ALLOWED > > is better than: > > TARGET_OS

Re: ALLOC/FREE problems with a NIB..

2012-01-03 Thread Martin Wierschin
Hi Robert, > I seem to be crashing with the following message: > malloc: *** error for object 0x104839c08: incorrect checksum for freed object > - object was probably modified after being freed. > *** set a breakpoint in malloc_error_break to debug > > However, malloc_error_break never gets call

Re: ALLOC/FREE problems with a NIB..

2012-01-03 Thread Robert Monaghan
Hi Martin, Thanks for the suggestion! Believe it or not, it ended up being a for loop overwriting memory under a very specific condition. This would cause a malloc to be corrupted, (for instance.) Nothing like a wild goose chase. I looked everywhere for this one. Best Regards, bob. On Jan 3,

Re: Modal Window for NSTextField

2012-01-03 Thread Graham Cox
On 03/01/2012, at 8:29 PM, Dany Golubitsky wrote: > Calling for TextField and waiting for return value. > Getting return value in some other place is not an option. It simply doesn't work that way. In fact there's almost no code in Cocoa that does work that way, with the possible exception o

Re: Why is +[NSFileVersion(NSTemporaryCompatibility) unresolvedConflictsExistForItemAtURL:] hanging/

2012-01-03 Thread John Chang
On Thu, 29 Dec 2011 11:41:22 -0700 James Bucanek wrote: > I recently upgraded my primary development system to Lion and I'm > encountering a phenomenon with a lot of different applications (not just my > own) where the app will hang for 20 seconds or more when it's first launched > or a document

Custom NSDocument class will not save to file

2012-01-03 Thread Erik Stainsby
I'm certain this is a trivial error on my part, but my custom document class will not write the file to the local filesystem. I have several other files which I can write, and I can write the content when I use an NSString to encode the text first. But once I init my own document, setup the at

[Moderator] Re: 360MacDev Conference Room Split?

2012-01-03 Thread Scott Anguish
On Dec 27, 2011, at 11:45 AM, Mac QA wrote: > Hi, > > I'm going to the 360MacDev conference in Denver on Feb 3-4. I'm > writing to see if anyone going to the 360MacDev conference might be > interested in splitting a 2-bed room at the conference hotel to help > reduce costs. I'll be flying in on

Copying objects between CoreData stores

2012-01-03 Thread Rick Mann
I'm working on a Core Data-based CAD app. The schema includes Parts and PartInstances. There is a to-many relationship from Part to PartInstance. The Library contains Parts, but a CAD file contains Parts and PartInstances. When the user creates a new PartInstance in a document, I need to copy th