Re: Get specified window from nib

2008-08-11 Thread Negm-Awad Amin
Am Di,12.08.2008 um 05:08 schrieb Fosse: In fact, in my another application, there are more than one hundred windows.. H split them into one hundred nib? Yes, but: … and create one hundred Outlet? No, only one. Typically a window has a window controller. The relationship between win

Re: Tidying NSURLs Containing XML

2008-08-11 Thread Mike
That's sort of what I was asking, except I need the reverse - not removing escape chars and replacing them with "real" equivalents - I need to remove single real characters that are invalid in URLs and replace them with the equivalent escapes. For example, the equivalent escape character for "

Re: NSTextField Bug? Can't be!

2008-08-11 Thread Graham Cox
I suspect it's because of the Field Editor. The text isn't really "in the field", it's in the shared field editor. If the field is disabled, it won't be updated from the field editor because disabled means "refuse input". Also, it may be that when a control that is using the field editor is

Re: Delayed termination to allow release

2008-08-11 Thread Negm-Awad Amin
Am Mo,11.08.2008 um 20:57 schrieb Negm-Awad Amin: Am Mo,11.08.2008 um 20:33 schrieb Trygve Inda: My main thread creates a few other objects which have NSThreads and/ or timers. I have found that when I quit the app, and the threads are ended, something in the OS is retaining my objects for

NSTextField Bug? Can't be!

2008-08-11 Thread Seth Willits
If a text field has focus, you type "blah blah blah" into it, and then click a button which asks for its string value and disables the text field, you get "blah blah blah" back. If a text field has focus, you type "blah blah blah" into it, and then click a button which disables the text

Re: Copying id

2008-08-11 Thread Ken Ferry
On Mon, Aug 11, 2008 at 8:22 PM, Ken Ferry <[EMAIL PROTECTED]> wrote: > On Mon, Aug 11, 2008 at 7:15 PM, Mike <[EMAIL PROTECTED]> wrote: >> Ken Thomases wrote: >>> >>> On Aug 10, 2008, at 2:05 AM, Mike wrote: >>> How does one go about copying an object specified by id when one doesn't kno

Re: applicationShouldOpenUntitledFile question

2008-08-11 Thread Seth Willits
On Aug 11, 2008, at 8:57 PM, vince wrote: I'm using the following to allow the user to run my NSPersistentDoc application with or without opening an empty document at launch (set with a check box preference setting). I want to add a second optional preference that runs the previously opened

applicationShouldOpenUntitledFile question

2008-08-11 Thread vince
I'm using the following to allow the user to run my NSPersistentDoc application with or without opening an empty document at launch (set with a check box preference setting). I want to add a second optional preference that runs the previously opened (saved) document. I think I need to use the sane

Re: Get specified window from nib

2008-08-11 Thread Graham Cox
On 12 Aug 2008, at 1:08 pm, Fosse wrote: In fact, in my another application, there are more than one hundred windows.. split them into one hundred nib? and create one hundred Outlet? Seems a little too crazy! Well, it depends. If all those 100 windows are completely separate and have n

Re: Get specified window from nib

2008-08-11 Thread j o a r
On Aug 11, 2008, at 8:08 PM, Fosse wrote: In fact, in my another application, there are more than one hundred windows.. split them into one hundred nib? and create one hundred Outlet? Seems a little too crazy! Over a hundred different windows seems a little crazy too ;-) If you de

Re: Copying id

2008-08-11 Thread Ken Ferry
On Mon, Aug 11, 2008 at 7:15 PM, Mike <[EMAIL PROTECTED]> wrote: > Ken Thomases wrote: >> >> On Aug 10, 2008, at 2:05 AM, Mike wrote: >> >>> How does one go about copying an object specified by id when one doesn't >>> know the object type and the object does not implement NSCopying protocol? >> >>

Re: best graphics API for 2D game

2008-08-11 Thread Seth Willits
On Aug 11, 2008, at 6:23 PM, steph thirion wrote: I'm new to cocoa, and I'd need a pointer to get started learning and experimenting. What would be the most adequate graphics cocoa API to render a 2D game? core graphics or opengl? The requirements would be a relatively smooth frame rate r

Re: Tidying NSURLs Containing XML

2008-08-11 Thread Ken Ferry
Hi Mike, I'm not totally sure what you're asking, but you may want to look in the documentation for -[NSString stringByAddingPercentEscapesUsingEncoding:]. "Returns a representation of the receiver using a given encoding to determine the percent escapes necessary to convert the receiver into a le

Re: Get specified window from nib

2008-08-11 Thread Fosse
In fact, in my another application, there are more than one hundred windows.. split them into one hundred nib? and create one hundred Outlet? Seems a little too crazy! On Tue, Aug 12, 2008 at 12:59 AM, Michael Ash <[EMAIL PROTECTED]> wrote: > On Sun, Aug 10, 2008 at 10:01 PM, Fosse <[EMAIL PROT

Re: Should I retain a variable returned from this accessor?

2008-08-11 Thread Peter N Lewis
At 4:48 PM -0400 11/8/08, Kyle Sluder wrote: On Mon, Aug 11, 2008 at 3:12 PM, Sean DeNigris <[EMAIL PROTECTED]> wrote: Hi, how do I handle memory management for todoUid below? Do I have to retain or autorelease it? [...snip...] // Get uid to return NSString* todoUid = [newT

Re: Copying id

2008-08-11 Thread Graham Cox
On 12 Aug 2008, at 12:15 pm, Mike wrote: Both the key and value for each key in the items in my array can be of any object type (id). The sorted key/value paid array class has to be able to make copies of the items in the arrays when it goes to sort them. Since the array class has to be ge

Re: Copying id

2008-08-11 Thread Charles Srstka
On Aug 11, 2008, at 9:15 PM, Mike wrote: Because, I have a case where I need to create my own object for storing key/value pairs in a sorted array. Since NSDictionary, etc. doesn't allow sorted elements in the dictionary, I have to define my own - but in an array instead of a dictionary.

Tidying NSURLs Containing XML

2008-08-11 Thread Mike
Is there a way to scan an entire XML doucment and NSURL to make sure it contains only valid characters? I am thinking of the case of web services apps where large chunks of XML data get appended to the end of the URL before it is sent to the server. Spaces for example don't conform to RFC 180

Re: Copying id

2008-08-11 Thread Mike
Ken Thomases wrote: On Aug 10, 2008, at 2:05 AM, Mike wrote: How does one go about copying an object specified by id when one doesn't know the object type and the object does not implement NSCopying protocol? The short answer is: you don't. If an object's class doesn't implement NSCopying,

best graphics API for 2D game

2008-08-11 Thread steph thirion
I'm new to cocoa, and I'd need a pointer to get started learning and experimenting. What would be the most adequate graphics cocoa API to render a 2D game? core graphics or opengl? The requirements would be a relatively smooth frame rate rendering, and the possibility to draw and render s

Re: Monospaced Simulated Braille

2008-08-11 Thread Deborah Goldsmith
The Braille characters should probably be monospace. Please write a bug. Deborah Goldsmith Apple Inc. [EMAIL PROTECTED] On Aug 8, 2008, at 2:11 PM, James Jennings wrote: I want to display and edit simulated Braille. OS X has had Braille fonts since Tiger, so all I need to do is pass the c

Re: How to get array of characters from NSString

2008-08-11 Thread Deborah Goldsmith
This is not a good approach for a number of reasons. First, Unicode distinguishes between a "code point" (an encoded character), a "code unit" (one 16-bit unichar), and a "grapheme cluster" (what the user thinks of as a character). They're all different. A grapheme cluster may consist of on

[MEET] Philadelphia Area CocoaHeads: Thur Aug 14th

2008-08-11 Thread Andy Mroczkowski
We are having our very first Philly-area CocoaHeads meeting: THURSDAY August 14th - 7 PM @ IndyHall - 32 Strawberry Street in Old City Philadelphia. http://upcoming.yahoo.com/event/983969/?ps=8 Be there for our maiden voyage! -- Andy Mroczkowski: [EMAIL PROTECTED] Philly CocoaHeads: http://co

Re: Sort Descriptor problem in NSTableView [SOLVED]

2008-08-11 Thread Graham Cox
On 12 Aug 2008, at 10:39 am, Adam R. Maxwell wrote: I just want to sort a simple mutable array of strings. So what should the key be? There is no property I want to sort on, the string itself *is* the property. But if I leave the key field blank the table just keeps accumulating broken sort desc

Re: Sort Descriptor problem in NSTableView

2008-08-11 Thread Adam R. Maxwell
On Monday, August 11, 2008, at 05:32PM, "Graham Cox" <[EMAIL PROTECTED]> wrote: >I just want to sort a simple mutable array of strings. So what should >the key be? There is no property I want to sort on, the string itself >*is* the property. But if I leave the key field blank the table just

Re: Sort Descriptor problem in NSTableView

2008-08-11 Thread Graham Cox
On 12 Aug 2008, at 12:26 am, Keary Suska wrote: OTOH, implement a custom sort method, setting it as the method to use in the table column properties. OK, that helps a little - I've made some progress in that I'm now getting the sort change notification in my delegate and the arrow appea

Re: Should I retain a variable returned from this accessor?

2008-08-11 Thread Sean DeNigris
On Mon, Aug 11, 2008 at 3:12 PM, Sean DeNigris <[EMAIL PROTECTED]> wrote: Hi, how do I handle memory management for todoUid below? Do I have to retain or autorelease it? [...snip...] // Get uid to return NSString* todoUid = [newTodo uid]; [...snip...] [newTodo release];

Re: Problem with friend function and gcc 4.2 with

2008-08-11 Thread Jonathan Prescott
Operator signatures are already know by the compiler since they are defined in the standard, and are really global in scope. Thus, you don't have to declare them prior to defining them. Jonathan On Aug 10, 2008, at 11:09 PM, Ken Worley wrote: First, I appreciate the response and discussion

Re: List box like in Mail app

2008-08-11 Thread I. Savant
On Aug 11, 2008, at 7:30 PM, Kyle Sluder wrote: 3. Icons for each list item Column with NSImageCell. Well ... this will require another custom cell if you're planning on using an outline view because of the disclosure triangle and indentation. Search your local example code for "ImageA

Re: Thread deadlock?

2008-08-11 Thread Michael Ash
On Mon, Aug 11, 2008 at 5:15 PM, Trygve Inda <[EMAIL PROTECTED]> wrote: >>> Which part is correct? The original code? >> >> The original code was what I meant. However I was thinking of traditional >> conditions & locks; NSConditionLock does operate at a higher level, and you >> are right that the

Re: Thread deadlock?

2008-08-11 Thread Peter Duniho
Date: Mon, 11 Aug 2008 21:15:27 + From: Trygve Inda <[EMAIL PROTECTED]> The real issue here is that I need to use [self performSelectorOnMainThread:@selector(doUnsafeStuff) withObject:nil waitUntilDone:YES]; Which blocks until the method completes, so I need a way to end the thr

Re: List box like in Mail app

2008-08-11 Thread Kyle Sluder
On Mon, Aug 11, 2008 at 7:23 PM, Devraj Mukherjee <[EMAIL PROTECTED]> wrote: > 1. Grouped like in Mail -outlineView:isGroupItem: NSOutlineView delegate method. > 2. Has a number associated to the list Custom NSCell subclass for column. > 3. Icons for each list item Column with NSImageCell. >

List box like in Mail app

2008-08-11 Thread Devraj Mukherjee
Hi all, I want to create a user interface that kind of looks like the Mail application (so a left hand toolbar with options and the right hand pane has different views presented depending on the selection). My question is how do I go about creating a list item that is 1. Grouped like in Mail 2.

Re: Thread deadlock?

2008-08-11 Thread Trygve Inda
>> There is a chance that my calls to performSelectorOnMainThread can have >> waitUntilDone:NO >> >> I use [myNSData writeToFile:path atomically:YES] >> >> NSFileHandle and NSFileManager are shown as not thread safe, but NSData >> is... Perhaps it is ok, but I would think NSData uses one or both

Re: including a cocoa bundle in a carbon app

2008-08-11 Thread Bob Sabiston
On Aug 10, 2008, at 6:39 PM, Uli Kusterer wrote: On 10.08.2008, at 19:38, Bob Sabiston wrote: I got my Cocoa bundle to compile on the Intel machine. It still doesn't load within my app, though. Is there something special I need to do to include it in my project? I just dragged it in on th

Re: Thread deadlock?

2008-08-11 Thread Scott Ribe
> There is a chance that my calls to performSelectorOnMainThread can have > waitUntilDone:NO > > I use [myNSData writeToFile:path atomically:YES] > > NSFileHandle and NSFileManager are shown as not thread safe, but NSData > is... Perhaps it is ok, but I would think NSData uses one or both of the

Re: Thread deadlock?

2008-08-11 Thread Trygve Inda
There is a chance that my calls to performSelectorOnMainThread can have waitUntilDone:NO I use [myNSData writeToFile:path atomically:YES] NSFileHandle and NSFileManager are shown as not thread safe, but NSData is... Perhaps it is ok, but I would think NSData uses one or both of the above. One of

Re: Thread deadlock?

2008-08-11 Thread Scott Ribe
> Which blocks until the method completes, so I need a way to end the thread, > but in the original code the killThread method blocks waiting for the thread > to finish. > > I probably need to launch a timer or other notification system when the > thread finishes. Why? -- Scott Ribe [EMAIL PROT

Re: Thread deadlock?

2008-08-11 Thread Trygve Inda
>> Which part is correct? The original code? > > The original code was what I meant. However I was thinking of traditional > conditions & locks; NSConditionLock does operate at a higher level, and you > are right that there is no need for an unconditional lock. But really, I > don't see a need fo

Re: Should I retain a variable returned from this accessor?

2008-08-11 Thread Nathan Kinsinger
On Aug 11, 2008, at 1:12 PM, Sean DeNigris wrote: Hi, how do I handle memory management for todoUid below? Do I have to retain or autorelease it? I'm using Scripting Bridge to communicate with iCal. Also, this is a sub-routine and todoUid will only be used in the method that calls it.

Re: Use of AppKit in command-line app on headless node

2008-08-11 Thread Michael Ash
On Mon, Aug 11, 2008 at 2:58 PM, Rick Hoge <[EMAIL PROTECTED]> wrote: > > >> I am trying to factor some frameworks so that code used in a >> document-based Cocoa app can be shared with command-line tools that might >> run on a headless node (no window server). >> >> I've seen some discussion in the

Re: Should I retain a variable returned from this accessor?

2008-08-11 Thread Kyle Sluder
On Mon, Aug 11, 2008 at 3:12 PM, Sean DeNigris <[EMAIL PROTECTED]> wrote: > Hi, how do I handle memory management for todoUid below? Do I have to > retain or autorelease it? > > [...snip...] > >// Get uid to return >NSString* todoUid = [newTodo uid]; > > [...snip...] > >ret

Re: Use of AppKit in command-line app on headless node

2008-08-11 Thread Jean-Daniel Dupas
Le 11 août 08 à 22:26, Ken Ferry a écrit : Hi Rick, I think you might be misreading that technote.. what it says is that trying to guess which methods are and are not safe doesn't work, because a method that does not happen to require the windowserver in one release may require it in another.

Re: Objective-C and Cocoa Training in the MD/DC/VA Area?

2008-08-11 Thread Kyle Sluder
On Mon, Aug 11, 2008 at 3:13 PM, Lyndsey Ferguson <[EMAIL PROTECTED]> wrote: > Is anyone aware of training in the Maryland, DC, Virginia area? I'm already > aware of AboutObjects.com, but I'm looking at all the options. Though it's not really training so much as an informal meetup, there's an NSCo

Re: Use of AppKit in command-line app on headless node

2008-08-11 Thread Ken Ferry
Hi Rick, I think you might be misreading that technote.. what it says is that trying to guess which methods are and are not safe doesn't work, because a method that does not happen to require the windowserver in one release may require it in another. The section you're quoting is about what to do

Re: Thread deadlock?

2008-08-11 Thread Scott Ribe
> Which part is correct? The original code? The original code was what I meant. However I was thinking of traditional conditions & locks; NSConditionLock does operate at a higher level, and you are right that there is no need for an unconditional lock. But really, I don't see a need for a lock at

Re: Newbie Question on "self"

2008-08-11 Thread Charles Steinman
--- On Mon, 8/11/08, Scott Ribe <[EMAIL PROTECTED]> wrote: > > Using dot-syntax calls getters and setters. You would > get exactly the same > > behavior by calling self.myString = anotherString. > > That assumes Objective-C 2. The code in question was using properties with synthesized accessors.

Re: Newbie Question on "self"

2008-08-11 Thread Scott Ribe
> Using dot-syntax calls getters and setters. You would get exactly the same > behavior by calling self.myString = anotherString. That assumes Objective-C 2. -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-

Objective-C and Cocoa Training in the MD/DC/VA Area?

2008-08-11 Thread Lyndsey Ferguson
Hello, Is anyone aware of training in the Maryland, DC, Virginia area? I'm already aware of AboutObjects.com, but I'm looking at all the options. Thanks in advance, Lyndsey Ferguson --- Mr. Lyndsey Ferguson [EMAIL PROTECTED] http://winterlandexpat.blogspot.com/ _

Should I retain a variable returned from this accessor?

2008-08-11 Thread Sean DeNigris
Hi, how do I handle memory management for todoUid below? Do I have to retain or autorelease it? I'm using Scripting Bridge to communicate with iCal. Also, this is a sub-routine and todoUid will only be used in the method that calls it. - (NSString*) saveToiCalTodo: (NSString*) theSummary

Re: Thread deadlock?

2008-08-11 Thread Peter Duniho
Date: Mon, 11 Aug 2008 12:29:55 -0600 From: Scott Ribe <[EMAIL PROTECTED]> ...but it would surprise if you have to take the lock just to inspect the condition (per the "threadMustExit" method). That part is correct, as it's the entire point behind conditions, atomically check a condition and

Re: Delayed termination to allow release

2008-08-11 Thread Gregory Weston
Trygve Inda wrote: My main thread creates a few other objects which have NSThreads and/or timers. I have found that when I quit the app, and the threads are ended, something in the OS is retaining my objects for a bit... They end up never being dealloc'd which messes a few things up as some

Re: Delayed termination to allow release

2008-08-11 Thread Trygve Inda
> --- On Mon, 8/11/08, Trygve Inda <[EMAIL PROTECTED]> wrote: > >> My main thread creates a few other objects which have >> NSThreads and/or >> timers. I have found that when I quit the app, and the >> threads are ended, >> something in the OS is retaining my objects for a bit... >> They end up ne

Re: Use of AppKit in command-line app on headless node

2008-08-11 Thread Rick Hoge
I am trying to factor some frameworks so that code used in a document-based Cocoa app can be shared with command-line tools that might run on a headless node (no window server). I've seen some discussion in the past on questions such as whether NSImage and related classes can be used hea

Re: Delayed termination to allow release

2008-08-11 Thread Negm-Awad Amin
Am Mo,11.08.2008 um 20:33 schrieb Trygve Inda: My main thread creates a few other objects which have NSThreads and/or timers. I have found that when I quit the app, and the threads are ended, something in the OS is retaining my objects for a bit... They end up never being dealloc'd which me

Re: Why use NSObjectController?

2008-08-11 Thread Mike Abdullah
But then you'd have to figure out which text field to send it to, and whether the command is necessary. NSObjectController takes care of that for you. On 11 Aug 2008, at 19:05, R.L. Grigg wrote: On Aug 11, 2008, at 8:52 AM, Sean McBride wrote: But it seems you can't send commitEditing to

Change in NSDocument between 10.4 and 10.5

2008-08-11 Thread Randall Meadows
The application I'm working on is NSDocument-based. In my client's workflow, these documents will typically live on a server volume mounted on the desktop, and be edited from there. When a document is opened, it's file name (extension)[1] is changed to indicate that it is currently being

Re: Thread deadlock?

2008-08-11 Thread Trygve Inda
> Key Trygve, > > This looks similar to the threading code we talked about a while > back. Far be it for me to say that my threading code is bugless :), > but I haven't run into a deadlock problem, and the code you posted > has two changes that would give me pause... > > >> [self per

Re: Memory Leaks & Instruments Questions

2008-08-11 Thread Michael Kaye
Thanks for the reply - very helpful. Looks like I have some work to do. Appreciate the explanation of the singleton business too. To the other replier - no I'm not using GC with this app but thanks for the pointer. Regards. Michael. On 11 Aug 2008, at 16:21, Nathan Vander Wilt wrote: On

Re: Delayed termination to allow release

2008-08-11 Thread Charles Steinman
--- On Mon, 8/11/08, Trygve Inda <[EMAIL PROTECTED]> wrote: > My main thread creates a few other objects which have > NSThreads and/or > timers. I have found that when I quit the app, and the > threads are ended, > something in the OS is retaining my objects for a bit... > They end up never > bein

Re: Delayed termination to allow release

2008-08-11 Thread David Duncan
On Aug 11, 2008, at 11:33 AM, Trygve Inda wrote: My main thread creates a few other objects which have NSThreads and/or timers. I have found that when I quit the app, and the threads are ended, something in the OS is retaining my objects for a bit... They end up never being dealloc'd which m

Opening an external file in a external application

2008-08-11 Thread John Love
I have a multiple document Cocoa app where I (try to) open an external file in whatever application the file belongs to -- in my case, an Excel spreadsheet in Excel. The new Cocoa document window shown keeps track of the calculation progress in Excel via a NSProgressIndicator and a NSTextF

Use of AppKit in command-line app on headless node

2008-08-11 Thread Rick Hoge
Hi - I am trying to factor some frameworks so that code used in a document- based Cocoa app can be shared with command-line tools that might run on a headless node (no window server). I've seen some discussion in the past on questions such as whether NSImage and related classes can be use

Re: Challenge 18 in Hillegass Book

2008-08-11 Thread James G.
On Aug 10, 2008, at 10:03 AM, Kyle Sluder wrote: On Sat, Aug 9, 2008 at 8:54 PM, James Gorham <[EMAIL PROTECTED]> wrote: I think that's where I'm unclear. Making the Document class aware of the view is easy enough with an IBOutlet. But how to properly make the view aware of the document I'

Re: NSConditionLock vs MPQueue

2008-08-11 Thread Scott Ribe
If all your thread questions here relate to cleanly shutting down the thread, you could just spin on isFinished. Then file a bug report asking for a join method in NSThread... -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice __

Re: Cocoa Dev Style: Using Class versus Object Methods

2008-08-11 Thread Christopher Nebel
On Aug 8, 2008, at 8:33 AM, Uli Kusterer wrote: On 08.08.2008, at 07:28, Nick Zitzmann wrote: On Aug 7, 2008, at 11:08 AM, Lee, Frederick wrote: 1) why use instantiated objects versus classes (via class methods)? Because class methods other than +new return autoreleased objects, wh

Delayed termination to allow release

2008-08-11 Thread Trygve Inda
My main thread creates a few other objects which have NSThreads and/or timers. I have found that when I quit the app, and the threads are ended, something in the OS is retaining my objects for a bit... They end up never being dealloc'd which messes a few things up as some data is written to disk at

Re: Thread deadlock?

2008-08-11 Thread Scott Ribe
> ...but it would surprise if you have to take the lock > just to inspect the condition (per the "threadMustExit" method). That part is correct, as it's the entire point behind conditions, atomically check a condition and release the lock at the same time (and subsequently relock)--in order to avo

Opening an external file in a external application

2008-08-11 Thread John Love
I have a multiple document Cocoa app where I (try to) open an external file in whatever application the file belongs to -- in my case, an Excel spreadsheet in Excel. The new Cocoa document window shown keeps track of the calculation progress in Excel via a NSProgressIndicator and a NSTextF

Re: Newbie Question on "self"

2008-08-11 Thread Charles Steinman
--- On Mon, 8/11/08, Todd Heberlein <[EMAIL PROTECTED]> wrote: > Well, you don't need the "self" prefix, but > you may want to look at > using "setters" and "getters". It would > look like this > > @interface MyThingy : NSObject { > ... > NSString* myString; > ... > }; >

Re: Newbie Question on "self"

2008-08-11 Thread Gregory Weston
Matt Keyes wrote: Hello again, In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" i.e. this.m_sMyString = "this is my string"; In Objective-C, this doesn't seem as clear to me (or at least it doesn't compil

Re: Newbie Question on "self"

2008-08-11 Thread Todd Heberlein
- (id)initWithString:(NSString *) string { self.myString = [[NSString alloc] initWithString:string]; } Well, you don't need the "self" prefix, but you may want to look at using "setters" and "getters". It would look like this @interface MyThingy : NSObject { ... NSString*

RE: Newbie Question on "self"

2008-08-11 Thread Matt Keyes
Thanks y'all... in all the Obj-C examples I've read, I've never seen the -> operator used. I should have thought to check! (since in C++ it would be this->whatever). Thanks again, Matt > Date: Mon, 11 Aug 2008 11:05:55 -0700 > Subject: Re: Newbie Question on "self" > From: [EMAIL PROTECTED]

Re: Newbie Question on "self"

2008-08-11 Thread Matt Neuburg
On Mon, 11 Aug 2008 17:47:59 +, Matt Keyes <[EMAIL PROTECTED]> said: >Hello again, > >In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" > >i.e. this.m_sMyString = "this is my string"; > >In Objective-C, this does

Re: Why use NSObjectController?

2008-08-11 Thread R.L. Grigg
On Aug 11, 2008, at 8:52 AM, Sean McBride wrote: But it seems you can't send commitEditing to a textfield. Why? If this was supported, wouldn't it greatly simplify things, meaning no need to have a NSController subclass, etc.? This is what confuses alot of newbs like me. Not arguing again

Re: NSConditionLock vs MPQueue

2008-08-11 Thread Adam R. Maxwell
On Monday, August 11, 2008, at 09:56AM, "Michael Ash" <[EMAIL PROTECTED]> wrote: >On Mon, Aug 11, 2008 at 10:07 AM, Trygve Inda <[EMAIL PROTECTED]> wrote: >> I am using NSConditionLock in Cocoa but it seems unable to match the >> capabilities of MPQueue for my needs. >> >> I am using >> >> -- fro

Re: Newbie Question on "self"

2008-08-11 Thread Jonathan Hess
On Aug 11, 2008, at 10:47 AM, Matt Keyes wrote: Hello again, In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" i.e. this.m_sMyString = "this is my string"; In Objective-C, this doesn't seem as clear to me (

Re: Newbie Question on "self"

2008-08-11 Thread I. Savant
> In Objective-C, this doesn't seem as clear to me (or at least it doesn't > compile). For example: > > - (id)initWithString:(NSString *) string { >self.myString = [[NSString alloc] initWithString:string]; > } > > Produces an error: > > error: request for member 'myString' in something not a

Newbie Question on "self"

2008-08-11 Thread Matt Keyes
Hello again, In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" i.e. this.m_sMyString = "this is my string"; In Objective-C, this doesn't seem as clear to me (or at least it doesn't compile). For example: - (id

Re: Thread deadlock?

2008-08-11 Thread Peter Duniho
Date: Mon, 11 Aug 2008 12:09:05 + From: Trygve Inda <[EMAIL PROTECTED]> I am seeing a deadlock I think... It works in the debugger, but hangs when running alone. The killThread is called as part of the applicationWillTerminate delegate method. My thought is that somehow after blocking to

Re: Miniaturizing a window when PowerPoint is in full screen mode

2008-08-11 Thread Eric Schlegel
On Aug 11, 2008, at 6:14 AM, Angie Frazier wrote: I'm having trouble getting a window in my application to miniaturize when PowerPoint is open in full screen mode. The window counts down to zero, when it hits zero, it should miniaturize itself to the dock. This works as expected unless Powe

Re: Newbie Error on Loading XML

2008-08-11 Thread Devon Ferns
You're missing some parameters for initWithContentsOfURL The full method signature is - (id)initWithC

RE: Newbie Error on Loading XML

2008-08-11 Thread Matt Keyes
That makes sense. I am new to Objective-C and the compiler did not complain with the missing arguments... lesson learned! > CC: cocoa-dev@lists.apple.com > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: Re: Newbie Error on Loading XML > Date: Mon, 11 Aug 2008 11:24:07 -0600 > > On

Re: Newbie Error on Loading XML

2008-08-11 Thread Randall Meadows
On Aug 11, 2008, at 11:16 AM, Matt Keyes wrote: I am trying to load an XML file from the project, and here is what I do: NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"MyXmlFile" ofType:@"Xml"]]; NSXMLDocument *xmlDoc = nil; @try { xmlDoc = [[NSXMLDocu

Newbie Error on Loading XML

2008-08-11 Thread Matt Keyes
Hello, I am trying to load an XML file from the project, and here is what I do: NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"MyXmlFile" ofType:@"Xml"]]; NSXMLDocument *xmlDoc = nil; @try { xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:url];

Re: Get specified window from nib

2008-08-11 Thread Michael Ash
On Sun, Aug 10, 2008 at 10:01 PM, Fosse <[EMAIL PROTECTED]> wrote: > I have one nib containing more than ten dialogs and want to get the > specified window after nib is loading.. Don't take this badly, but if you have one nib with ten windows and you only want to access one of them, you're doing i

Re: NSConditionLock vs MPQueue

2008-08-11 Thread Michael Ash
On Mon, Aug 11, 2008 at 10:07 AM, Trygve Inda <[EMAIL PROTECTED]> wrote: > I am using NSConditionLock in Cocoa but it seems unable to match the > capabilities of MPQueue for my needs. > > I am using > > -- from my worker thread, do something on the main thread -- > > [lock lockWhenCondition:kTaskCo

Re: NSImage and zooming PDFs vs. bitmaps

2008-08-11 Thread Ken Ferry
On Aug 11, 2008, at 1:15 AM, Hamish Sanderson <[EMAIL PROTECTED] > wrote: On 8 Aug 2008, at 17:53, Ken Ferry wrote: The correct answer is to call setDataRetained:YES on your image. However, there may be a bug in Leopard and previous with NSImage cache expiration that prevents that from bei

Re: Thread deadlock?

2008-08-11 Thread Michael Ash
On Mon, Aug 11, 2008 at 8:09 AM, Trygve Inda <[EMAIL PROTECTED]> wrote: > I am seeing a deadlock I think... It works in the debugger, but hangs when > running alone. The killThread is called as part of the > applicationWillTerminate delegate method. You can use gdb to attach to the program after i

Re: Memory Leaks & Instruments Questions

2008-08-11 Thread Sean McBride
On 8/10/08 8:37 PM, Michael Kaye said: >I've ben running my app with leaks in Instruments and it is reporting >a fair number of leaks. Is your app garbage collected? Instruments reports many many false positives in GC apps. -- Sean Mc

Re: Why use NSObjectController?

2008-08-11 Thread Sean McBride
On 8/10/08 10:08 PM, Seth Willits said: >>> What is it that NSObjectController offers me? >> >> An implementation of the NSEditor and NSEditorRegistration protocols. > >Now I'll just have to figure out when I'd want to use those... I seem to have run into this situation the other day. Maybe my e

Miniaturizing a window when PowerPoint is in full screen mode

2008-08-11 Thread Angie Frazier
I'm having trouble getting a window in my application to miniaturize when PowerPoint is open in full screen mode. The window counts down to zero, when it hits zero, it should miniaturize itself to the dock. This works as expected unless PowerPoint is also running in full screen mode. The miniaturiz

Re: Table Column NSSegmentedCell - Segment not Selecting

2008-08-11 Thread hac
I've solved my own problem, finally. I have set the data source to return an NSNumber containing the selected index rather than an actual cell. I still don't really understand why I do this for only some types of cells, but this solution works fine. On Sun, Aug 10, 2008 at 11:32 PM, hac <[EMAIL PR

Table Column NSSegmentedCell - Segment not Selecting

2008-08-11 Thread hac
I have a table column that contains multiple types of cells. One is an NSSegmentedCell. To do this, I have tried variations of the following code. I use it in the table's data source as well as to override the column's dataCellForRow method: NSSegmentedCell *theCell = [[[NSSegmentedCell alloc] ini

Re: Memory Leaks & Instruments Questions

2008-08-11 Thread Nathan Vander Wilt
On Aug 10, 2008, at 12:37 PM, Michael Kaye wrote: I've ben running my app with leaks in Instruments and it is reporting a fair number of leaks. On analyzing these leaks, they all appear to be related to apple frameworks methods/code and never as a direct result of any objects I've instanti

Re: How to check the capital letter?

2008-08-11 Thread Marco Masser
How to check the capital letter? If you don't want to mess around with NSCharacterSet and NSScanner, you could also do this: NSString *string = @"abcABC"; NSUInteger index = 0; // The character at this index will be checked NSString *character = [string substringWithRange:NSMakeRange(index,

Re: addObserver:

2008-08-11 Thread Keary Suska
8/11/08 8:15 AM, also sprach [EMAIL PROTECTED]: > I'm making the following call (and defining observeValueForKeyPath on self > etc) on an NSArrayController, hoping to get notifications of it changing. But > I don't seem to be getting any notifications. Should this work? > > > [arrayController ad

Re: addObserver:

2008-08-11 Thread Negm-Awad Amin
Am Mo,11.08.2008 um 16:15 schrieb Chris Idou: I'm making the following call (and defining observeValueForKeyPath on self etc) on an NSArrayController, hoping to get notifications of it changing. But I don't seem to be getting any notifications. Should this work? [arrayController addOb

Re: Sort Descriptor problem in NSTableView

2008-08-11 Thread Keary Suska
8/11/08 4:35 AM, also sprach [EMAIL PROTECTED]: > I have a table view where one column's strings are sorted using > (NSCaseInsensitiveSearch | NSNumericSearch). To do this I use > compare:options: on the strings. > > I'd like to be able to allow the user to sort ascending or descending > in the u

addObserver:

2008-08-11 Thread Chris Idou
I'm making the following call (and defining observeValueForKeyPath on self etc) on an NSArrayController, hoping to get notifications of it changing. But I don't seem to be getting any notifications. Should this work? [arrayController addObserver:self forKeyPath:@"content" o

  1   2   >