Re: Launching and application in 32-bit in Leopard

2009-10-06 Thread Ken Ferry
You could also use posix_spawn for this. See man posix_spawn, the spawn.h header, and in particular man posix_spawnattr_setbinpref_np. posix_spawn is a replacement for the fork/exec method of launching a process. -Ken On Tue, Oct 6, 2009 at 10:48 AM, Sean McBride wrote: > On 10/6/09 10:36 AM, J

Re: Triggering a Method when a Core Data Property is Altered.

2009-10-06 Thread Kyle Sluder
On Tue, Oct 6, 2009 at 11:32 PM, Joshua Garnham wrote: > - awakeFromNib { Okay, step 1: what the heck object is this? NSManagedObjects aren't going to have -awakeFromNib called on them (and you mustn't override their initializers) so it can't be one of those. Yet you're talking about Core Data

Re: Issues with NSWindowDelegate on multiple Mac OS X platforms

2009-10-06 Thread Kyle Sluder
On Tue, Oct 6, 2009 at 11:23 PM, Jean-Daniel Dupas wrote: > That's the way to go, but MAC_OS_X_VERSION_10_6 is not defined on 10.5 SDK. Grr, yes, you are of course correct. > So you have to add another couple of line at the top of the file (or in a > prefix header): I always thought it was kind

Re: Triggering a Method when a Core Data Property is Altered.

2009-10-06 Thread Joshua Garnham
Volker, I have tried using the below code to add my self as an observer then trigger an action but it doesn't work. - awakeFromNib { [self addObserver: self forKeyPath: @"name" options: NSKeyValueObservingOptionNew context: NULL]; } -(id)init {

Re: app delegate +initialize

2009-10-06 Thread John Baldwin
I tried your suggestions. Unfortunately, I kept getting the same behavior. I found out that if I create the preference file (in /Library/ Preferences/), then the application will launch from other locations. But I'm still baffled. Launch from Drop Box location, no preferences file: Success

Re: Issues with NSWindowDelegate on multiple Mac OS X platforms

2009-10-06 Thread Jean-Daniel Dupas
Le 7 oct. 2009 à 06:42, Kyle Sluder a écrit : Please read the 10.6 Foundation release notes, particularly the section entitled "Formal protocol adoption": http://developer.apple.com/mac/library/releasenotes/Cocoa/Foundation.html We compile dual-mode code using the following: @interface Subcla

Re: Suggest reasons for this crash?

2009-10-06 Thread Graham Cox
On 07/10/2009, at 3:37 PM, Kyle Sluder wrote: I can't imagine the usefulness of replacing the contents of the text storage instead of just swapping in the new one. I do this because previously I was replacing the text storage and that was causing a huge amount of upset for Undo, producing

Re: Issues with NSWindowDelegate on multiple Mac OS X platforms

2009-10-06 Thread Kyle Sluder
Please read the 10.6 Foundation release notes, particularly the section entitled "Formal protocol adoption": http://developer.apple.com/mac/library/releasenotes/Cocoa/Foundation.html We compile dual-mode code using the following: @interface Subclass : Superclass #if MAC_OS_X_VERSION_MIN_REQUIRED

Re: Suggest reasons for this crash?

2009-10-06 Thread Kyle Sluder
On Tue, Oct 6, 2009 at 8:46 PM, Adam R. Maxwell wrote: > That's a fair question; I don't have a good definition :).  However, if I > have a master-detail view with a non-editable textview, or am updating a text > view with live output from an NSTask, I don't care if the delegate gets > notified

Issues with NSWindowDelegate on multiple Mac OS X platforms

2009-10-06 Thread Tron Thomas
I recently got a MacBook Pro running Mac OS X 10.6.1 and Xcode 3.2 When I tried to build a project I was working on, I would get an error like this: warning: class 'MyClass' does not implement the 'NSWindowDelegate' protocol I was able to eliminate the warning by doing this: @interface M

Re: CoreData async fetch request

2009-10-06 Thread Karl Hsu
On Oct 6, 2009, at 1:08 AM, Ben Trumbull wrote: Core Data is just passing the query off to the database. I'm not sure why you think going to the database directly will do anything for the 179.9 / 180.0 seconds it takes to evaluate the query in the database. I suspect that he wants a back

Re: Suggest reasons for this crash?

2009-10-06 Thread Adam R. Maxwell
On Oct 6, 2009, at 8:46 PM, Adam R. Maxwell wrote: > However, if I have a master-detail view with a non-editable textview, or am > updating a text view with live output from an NSTask, I don't care if the > delegate gets notified of changes (so have never seen a reason to call > shouldChangeTe

Re: Suggest reasons for this crash?

2009-10-06 Thread Adam R. Maxwell
On Oct 6, 2009, at 8:21 PM, Kyle Sluder wrote: > On Tue, Oct 6, 2009 at 7:54 PM, Adam R. Maxwell wrote: >> If this is really necessary, hopefully it'll be documented, or one of the >> text system guys can step in and clarify...I'd really like to know since >> I've been doing this for years wit

[Solved] Re: "remote" binding problem

2009-10-06 Thread David Hirsch
Okay, I'm an idiot. I did have accessors, but the getter returned the wrong type. (An early version of the quizResults ivar was an NSArray, and I neglected to fix the return type of the getter). Sorry for wasting your time! Hopefully somebody will read this in the archives and find the

Re: CoreData async fetch request

2009-10-06 Thread David Melgar
Hello, Thanks for the response. Seems that its straying somewhat from my original question. Searching based on prefix matching is fine. The predicate I'm using really is of the form "SELF like foo", no wildcard, so it doesn't seem that it should be that expensive. You say its possible to

Re: "remote" binding problem

2009-10-06 Thread Graham Cox
On 07/10/2009, at 2:12 PM, David Hirsch wrote: I would strongly recommend a property accessor for it instead of relying on accessing the ivar directly. But I can't bind through an accessor, can I? I'm supposed to be able to bind to the ivar, I think. You bind to properties, not to ivar

Re: Suggest reasons for this crash?

2009-10-06 Thread Kyle Sluder
On Tue, Oct 6, 2009 at 7:54 PM, Adam R. Maxwell wrote: > If this is really necessary, hopefully it'll be documented, or one of the > text system guys can step in and clarify...I'd really like to know since I've > been doing this for years without calling > shouldChangeTextInRange:replacementStr

Checking whether a file is a genuine PDF file

2009-10-06 Thread Michele (Mike) Hjorleifsson
what about using a digital signature ? the current PDF standards and even ODF standards support a digital signature that would ensure the file hasnt been tampered with since it was signed. Though i guess you could create a garbage PDF and sign it if you wanted. Best Regards, Michele (M

Re: Suggest reasons for this crash?

2009-10-06 Thread Graham Cox
On 07/10/2009, at 1:54 PM, Adam R. Maxwell wrote: I think it's worth noting that Apple's code examples don't do this: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/TextArchitecture/Tasks/SimpleTasks.html The way I read the page Kyle linked to andhttp://developer.apple.

Re: "remote" binding problem

2009-10-06 Thread David Hirsch
On Oct 6, 2009, at 7:56 PM, Graham Cox wrote: In Interface Builder, I would like to bind a text field to the current score. When I set up the text field value's binding to File's Owner.quizResults.currentScore, the app crashes inside loadNib (inside NSPopAutoreleasePool). Is that expect

Re: "remote" binding problem

2009-10-06 Thread Graham Cox
On 07/10/2009, at 1:29 PM, David Hirsch wrote: @interface ModeQuizDoc : NSDocument { QuizResults *quizResults; } @implementation ModeQuizDoc - (id)init { self = [super init]; if (self) { quizResults = [[[QuizResults alloc] init] retain]; You don't need to retain here. I

Re: Suggest reasons for this crash?

2009-10-06 Thread Adam R. Maxwell
On Oct 6, 2009, at 6:14 PM, Graham Cox wrote: > Thanks Kyle - that's really helpful. > > I hadn't read the subclassing notes because I'm not subclassing. My model > stores attributed strings (pity there's not a -setAttributedString: method on > NSTextView that would deal with all the kinks nec

"remote" binding problem

2009-10-06 Thread David Hirsch
Hello list- Here is part of my app: @interface ModeQuizDoc : NSDocument { QuizResults *quizResults; } @implementation ModeQuizDoc - (id)init { self = [super init]; if (self) { quizResults = [[[QuizResults alloc] init] retain]; } } @interface QuizResults : NS

Re: Suggest reasons for this crash?

2009-10-06 Thread Graham Cox
Thanks Kyle - that's really helpful. I hadn't read the subclassing notes because I'm not subclassing. My model stores attributed strings (pity there's not a - setAttributedString: method on NSTextView that would deal with all the kinks necessary). I'd also missed the discussion on this metho

Re: Suggest reasons for this crash?

2009-10-06 Thread Kyle Sluder
On Tue, Oct 6, 2009 at 5:53 PM, Graham Cox wrote: > Aha! Thanks - can you point me to the relevant documentation on that? I was > working on the principle that methods like this were high level and were > managing that before-and-after notification/setup stuff for me. First Google result for "sho

Re: Suggest reasons for this crash?

2009-10-06 Thread Graham Cox
On 07/10/2009, at 11:49 AM, Kyle Sluder wrote: You haven't wrapped this in -[NSTextView shouldChangeTextInRange:replacementString:] and -[NSTextView didChangeText]. Aha! Thanks - can you point me to the relevant documentation on that? I was working on the principle that methods like this w

Re: Suggest reasons for this crash?

2009-10-06 Thread Kyle Sluder
On Tue, Oct 6, 2009 at 5:37 PM, Graham Cox wrote: > 6   com.apple.AppKit                    0x94b6bd62 -[NSLayoutManager > textStorage:edited:range:changeInLength:invalidatedRange:] + 445 This is a hint. >        [[m_textEditViewRef textStorage] replaceCharactersInRange:textRange > withAttribute

Re: Problem using filewrappers under snow leopard

2009-10-06 Thread Graham Cox
On 07/10/2009, at 11:23 AM, Eagle Offshore wrote: where fileWrappers is an NSMutableDictionary of filename->NSData's. But that's not what the documentation says you should pass. The dictionary should contain other NSFileWrappers keyed by their preferred filenames, not NSData. That you go

Suggest reasons for this crash?

2009-10-06 Thread Graham Cox
Hi all, I'm getting a crash report from one user who has experienced the following crash more than once. No other user is reporting this so far. The crash is down in the text editing engine and I'm not sure what I should be looking at in my usage of this code that could be causing it. Sug

Problem using filewrappers under snow leopard

2009-10-06 Thread Eagle Offshore
And it is maddening because the error occurs outside my code. My document class implements - (NSFileWrapper *)fileWrapperOfType:(NSString *)aType error: (NSError**)errPtr and this gets called fine. It returns a new NSFileWrapper. It has been working perfectly since Tiger (this app targe

Re: class variables

2009-10-06 Thread Colin Howarth
On 7 Oct, 2009, at 01:53, Bill Bumgarner wrote: On Oct 6, 2009, at 4:48 PM, Colin Howarth wrote: I'm coming across the odd instance where the use of a class variable would seem to make sense. I can do this with a static definition in the class implementation file, I suppose. Question is:

Re: class variables

2009-10-06 Thread Bill Bumgarner
On Oct 6, 2009, at 4:48 PM, Colin Howarth wrote: > I'm coming across the odd instance where the use of a class variable would > seem to make sense. > > I can do this with a static definition in the class implementation file, I > suppose. > > Question is: is this particularly frowned upon in th

Re: class variables

2009-10-06 Thread Luke the Hiesterman
The canonical implementation of a singleton class uses a static to hold the singleton instance. There are other examples in Apple sample code of using class statics. So, I would say that it's not frowned upon as long as there's a good reason to do it. Luke On Oct 6, 2009, at 4:48 PM, Colin

class variables

2009-10-06 Thread Colin Howarth
Hi, I'm coming across the odd instance where the use of a class variable would seem to make sense. I can do this with a static definition in the class implementation file, I suppose. Question is: is this particularly frowned upon in the Cocoa world? If so, why? Thanks, --colin __

Re: [Performance issue] Resizing an alert sheet => blinks

2009-10-06 Thread Jens Alfke
On Oct 6, 2009, at 3:29 PM, Iceberg-Dev wrote: The contents. It's a bit as if there was a patchwork of rectangles and a random set of these rectangles would not be redrawn when the window size increases by 1 pixel and then another set for the following pixel. That sounds like a graphics

disabling "Open Recent" menu items

2009-10-06 Thread kvic...@pobox.com
i need to disable opening any files via the "Open Recent" menu items until the user has specified some information that i save in my app's prefs. this situation can occur if the user has deliberately or accidentally deleted the prefs. now, i can (and do) override -[NSDocumentController openDocu

Re: [Performance issue] Resizing an alert sheet => blinks

2009-10-06 Thread Iceberg-Dev
On Oct 6, 2009, at 1:29 AM, Jens Alfke wrote: On Oct 5, 2009, at 3:12 PM, Iceberg-Dev wrote: Is it the intended behavior that resizing an Alert Sheet in Mac OS X 10.5.8 on a MacBook Pro produces a lot of blinking? I have a custom alert sheet that can be resized and when I resize it on a M

Re: Constructive Criticism

2009-10-06 Thread Kyle Sluder
On Tue, Oct 6, 2009 at 3:08 PM, Mick Walker wrote: > One question: If I was to create an initializer such as the one you > suggested. Would I still need the if(self =([super init]))... in the > initializer? You *always* need to call super's initializer, check its return value, and assign it to se

Re: Constructive Criticism

2009-10-06 Thread Bill Bumgarner
On Oct 6, 2009, at 3:08 PM, Mick Walker wrote: > One question: If I was to create an initializer such as the one you > suggested. Would I still need the if(self =([super init]))... in the > initializer? Yes. ___ Cocoa-dev mailing list (Cocoa-dev@li

Re: Constructive Criticism

2009-10-06 Thread Mick Walker
Hi Dave, Thank you for you're reply. One question: If I was to create an initializer such as the one you suggested. Would I still need the if(self =([super init]))... in the initializer? Regards. On 6 Oct 2009, at 22:43, Dave Carrigan wrote: On Oct 6, 2009, at 2:26 PM, Mick Walker wrot

Re: NSSecureTextField - changing the default bullets to ****

2009-10-06 Thread Alastair Houghton
On 6 Oct 2009, at 19:24, Arun wrote: I am using NSSecureTextField for entering the password. Is there any way by which i can make the SecureTextCell to display instead of default solid circle bullets? And thereby make your application inconsistent with the platform? Why would you want to

Re: Constructive Criticism

2009-10-06 Thread Alastair Houghton
In addition to Bill's comments, which covered most things I think... On 6 Oct 2009, at 22:26, Mick Walker wrote: int g = Year % 19; int c = Year / 100; int h = h = (c - (int)(c / 4) - (int)((8 * c + 13) / 25) + 19 * g + 15) % 30; int i = h - (int)(h / 28) * (1 - (int)(h / 28) * (i

Re: Constructive Criticism

2009-10-06 Thread Dave Carrigan
On Oct 6, 2009, at 2:26 PM, Mick Walker wrote: Hi everyone, I am currently reading through Learn Objective-C on the Mac (M Dalrymple & S Knaster). While working through the provided examples, I want to back up what I am learning by attempting to put into practice what is being demonstrat

Re: Constructive Criticism

2009-10-06 Thread Bill Bumgarner
On Oct 6, 2009, at 2:26 PM, Mick Walker wrote: > #import > @interface Easter : NSObject { > int Year; int year; > } > - (id) init; > > - (void) setYear: (int) year; @property int year; > > - (void) CalculateYear; - (void) calculateYear; > > @end > > > --- Easter.m --- > #import "Easter

Constructive Criticism

2009-10-06 Thread Mick Walker
Hi everyone, I am currently reading through Learn Objective-C on the Mac (M Dalrymple & S Knaster). While working through the provided examples, I want to back up what I am learning by attempting to put into practice what is being demonstrated to me. To this end, I would like to post some

NSSecureTextField - changing the default bullets to ****

2009-10-06 Thread Arun
Hi All, I am using NSSecureTextField for entering the password. Is there any way by which i can make the SecureTextCell to display instead of default solid circle bullets? Thanks Arun ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: self release

2009-10-06 Thread Andy Lee
On Oct 6, 2009, at 10:52 AM, Michael Grant wrote: You're aware, I hope, that self release is illegal in several southern states? See #8: . --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.a

Re: Triggering a Method when a Core Data Property is Altered.

2009-10-06 Thread Volker in Lists
Josh, depending on where you need to get a notification: a) within the same NSManagedObject or a relationship: http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueObserving_Protocol/Reference/Reference.html#//apple_ref/occ/clm/NSObject/keyPathsFor

Re: Launching and application in 32-bit in Leopard

2009-10-06 Thread Sean McBride
On 10/6/09 10:36 AM, John Horigan said: >Does Leopard provide a means for controlling whether an application >launches in 32-bit or 64-bit? Snow Leopard has the new NSWorkspace >method launchApplicationAtURL:options:configuration:error: See 'man arch' for one way. --

Launching and application in 32-bit in Leopard

2009-10-06 Thread John Horigan
Does Leopard provide a means for controlling whether an application launches in 32-bit or 64-bit? Snow Leopard has the new NSWorkspace method launchApplicationAtURL:options:configuration:error: But I can't find an equivalent method that works for OS X 10.5. How did XCode do it? -- john ho

Re: Xcode 3.2 and NSTextField exceptions

2009-10-06 Thread albert jordan Mobility
Thanks a lot Jens, Appologies, I thought I did post it on a different list. regards, Albert On Oct 6, 2009, at 7:46 AM, Jens Alfke wrote: On Oct 6, 2009, at 7:39 AM, albert jordan Mobility wrote: I just upgraded to Snow Leopard and Xcode 3.2, and I'm having a number of problems. You sho

Triggering a Method when a Core Data Property is Altered.

2009-10-06 Thread Joshua Garnham
Hi. I am trying to trigger a method when A Core Data property is changed, e.g A Text Fields Text in a Table (connected to Core Data) is changed. I have looked into Key Value Observing but haven't had much luck. Cheers. ___ Cocoa-dev mailing list

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-06 Thread Mario Kušnjer
Again me ! Just a little update ! I packed previous code in combined message calls. Here's how it looks now: if ([lsOutlineView selectedRow] < 0) { Parent *parent = [Parent new]; <--- create new Parent object [sourceListLevelZero addObject:parent]; <--- add ne

Re: NSLayoutManager and best override point for temporary attributes

2009-10-06 Thread Ross Carter
On Oct 5, 2009, at 3:12 PM, Keith Blount wrote: I tried saving the edited range of text in the text storage and then having my layout manager check this from: -textStorage:edited:range:changeInLength:invalidatedRange: Then my layout manager adds temp attribs in this method. Turns out that

Applying temporaryAttributes from processEditing (_fillGlyphHoleForCharacterRange: crash)

2009-10-06 Thread Keith Blount
Hello, I’m attempting to add temporary attributes (all of which do not require layout) to text as soon as it has been edited if it has a custom attribute applied (much how the text system automatically applies linkTextAttributes to any text with an NSLinkAttributeName attribute - although from

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-06 Thread Mario Kušnjer
Hi all ! Thanks for your replies everybody ! I have reviewed my code according to yours inputs and I found where the problem was. Here's the reviewed code: if ([lsOutlineView selectedRow] < 0) { Parent *parent = [Parent new]; <--- create new Parent object

Re: grouping undo across method calls in CoreData [with possible solutions]

2009-10-06 Thread Jim Thomason
Figured I'd address all the comments inline in one batch, and then point out what I came up with. An almost viable solution is up top for reference purposes, and a seemingly better one is towards the bottom. >Hm, do operations using primitive accessors also get registered on the undo >stack? If n

Re: self release

2009-10-06 Thread Michael Grant
You're aware, I hope, that self release is illegal in several southern states? M ___ 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)l

Re: NSOutlineView - Automatically select newly added item - Help needed

2009-10-06 Thread Corbin Dunn
Mario, On Oct 5, 2009, at 4:44 PM, Mario Kušnjer wrote: > Hello to the list ! > > Request for help regarding a little problem. > So I have this piece of code: > > - (IBAction)addNewItem:(id)sender > { > if ([lsOutlineView selectedRow] < 0) > { > [sourceListLevelZero ad

Re: self release

2009-10-06 Thread Jeremy Pereira
On 6 Oct 2009, at 05:00, Dragos Ionel wrote: I have the following scenario: A UIViewController, called BookViewController represents a book. Another UIViewController, ChapterViewController, represents a chapter in the book. BookViewController initializes and displays one ChapterViewContr

[iPhone] WebView and problem with rotation

2009-10-06 Thread Bartosz Białecki
Hi, I have a problem with rotation. I have one root controller which switch between two views. In one of these views I have a webview control. In webview I show a tif or pdf file which size is bigger than window, so webview added scroll. The problem is when I rotate a device to landscape, I cha

Re: CoreData async fetch request

2009-10-06 Thread Ben Trumbull
On Oct 5, 2009, at 7:00 PM, enki1...@gmail.com wrote: I am doing a simple query search for a text string pattern (ie 'SELF like foo') on ~10 million small records stored persistently using sqlite. This is a performance test to make sure I get reasonable performance from my database engine