Re: Quicktime Movie View error

2009-02-05 Thread elliott cable
> On Tue Nov 11 05:09:44 2008, Joey Hagedorn wrote: > > On Nov 10, 2008, at 3:01 PM, Christopher Kempke wrote: > > I'm trying to create a very, very simple QuickTime viewer in Cocoa. > > > > I create a new Application, add QTKit and Quicktime frameworks, and > > drag a QuickTime Movie View into the

Re: IKImageView selection issue

2009-02-05 Thread Christian Graus
Just a further note: I've handled the mouse events in my own class, and the delegate events in the containing class. I've used these to capture when the mouse goes down, when it goes up, and when a selection is created. By doing this, I can get the rect of the selection area, and I am using zoomI

Relaunching App Programmatically - Terminal Window Shows up

2009-02-05 Thread Oleg Krupnov
I want to have the ability to relaunch my app programmatically, e.g. after update or crash. I have checked the Sparkle Update's implementation of relaunch and I found a little helper app called "relaunch" (put into Resources). The main executable launches the helper app passing its own path and pro

Re: Simple memory problem

2009-02-05 Thread Martin Wierschin
On Feb 5, 2009, at 4:42 PM, Steve Sisak wrote: NSString * newString = [inputString stringByReplacingCharactersInRange:range withString:@""]; [inputString release]; // release old inputString inputString = [newString retain]; // retain new inputString This sequence is not saf

Re: performSelector:withObject fails with class object

2009-02-05 Thread Greg Parker
On Feb 5, 2009, at 9:50 PM, Tron Thomas wrote: I have a couple of classes that are delcared like this: #import #import @interface SomeClass : Object { @private // Instance data members ... } + (SomeClass*)instanceFromData:(id)data; // Other methods ... @end Class Object is dead. Don

Re: performSelector:withObject fails with class object

2009-02-05 Thread Ken Thomases
On Feb 5, 2009, at 11:50 PM, Tron Thomas wrote: @interface SomeClass : Object [...] @interface SomeOtherClass : Object [...] However, when the performSelector:withObject: is executed, output like the following is logged, and the program traps in the debugger: *** NSInvocation: warning: objec

Re: NSTask + incomplete stdout at end of process

2009-02-05 Thread Ken Thomases
On Feb 5, 2009, at 10:48 PM, xEsk PiV wrote: I'm using NSTask for executing a command line tool, but I'm having some troubles getting the entire output. I explain the situation: 1) When I execute the command line tool using the Terminal, the tool while is working it displays an ASCII progress

performSelector:withObject fails with class object

2009-02-05 Thread Tron Thomas
I have a couple of classes that are delcared like this: #import #import @interface SomeClass : Object { @private // Instance data members ... } + (SomeClass*)instanceFromData:(id)data; // Other methods ... @end @interface SomeOtherClass : Object { @private // Instance data mem

NSTask + incomplete stdout at end of process

2009-02-05 Thread xEsk PiV
Hi everyone. I'm using NSTask for executing a command line tool, but I'm having some troubles getting the entire output. I explain the situation: 1) When I execute the command line tool using the Terminal, the tool while is working it displays an ASCII progress bar (single line). (Screenshot > h

Re: Simple memory problem

2009-02-05 Thread Steve Sisak
At 12:17 AM + 2/6/09, harry greenmonster wrote: So, how do I keep a copy hanging around AND kill the mysterious new copy then (which shares the same name as the old one presumably)? Retain the copy you want to keep around manually: while([inputString isMatchedByRegex:regexString]) {

Re: IKImageView selection issue

2009-02-05 Thread Christian Graus
On Fri, Feb 6, 2009 at 2:40 PM, Graham Cox wrote: > > On 6 Feb 2009, at 2:14 pm, Christian Graus wrote: > > OK - that makes some sense, excepting that if I don't set the delegate, >> and just define the methods, they don't get called at all. Also, all the >> delegates are useless to me, b/c non

Re: Needed : set class for Cocoa

2009-02-05 Thread Adam R. Maxwell
On Feb 5, 2009, at 5:50 PM, Sean McBride wrote: Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 7:55 PM said: I have decided to do an implementation myself, as an objective c++ wrapper to std::set. I want to use the class to aid in destruction of directed cyclical object graphs, in d

Re: IKImageView selection issue

2009-02-05 Thread Graham Cox
On 6 Feb 2009, at 2:14 pm, Christian Graus wrote: OK - that makes some sense, excepting that if I don't set the delegate, and just define the methods, they don't get called at all. Also, all the delegates are useless to me, b/c none of them fire when the selection has been made, only when

Re: Simple memory problem

2009-02-05 Thread Scott Ribe
> So, how do I keep a copy hanging around AND kill the mysterious new > copy then (which shares the same name as the old one presumably)? 2 pointer variables... -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___

Re: IKImageView selection issue

2009-02-05 Thread Christian Graus
OK - that makes some sense, excepting that if I don't set the delegate, and just define the methods, they don't get called at all. Also, all the delegates are useless to me, b/c none of them fire when the selection has been made, only when the box is initially created. I've set the delegate to be

Re: IKImageView selection issue

2009-02-05 Thread Graham Cox
On 6 Feb 2009, at 11:50 am, Christian Graus wrote: I have a class derived from IKImageView, and in my initWithFrame ( which is the only init I call ), I set [self setDelegate:self]; Once I do this, I have this code: - (void) selectionRectAdded: (IKImageView *) imageView { NSLog(@"Created s

More info - drag and drop could be the issue....

2009-02-05 Thread Christian Graus
So, it seems that if I set my class to be it's own delegate, then the drag and drop code that exists in the containing class, does a perform drop when I drag out a box in my IKImageView. My breakpoints are not working properly tho ( which often happens to me in XCode ). So, - (BOOL)performDrag

Re: Needed : set class for Cocoa

2009-02-05 Thread Sean McBride
Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 7:55 PM said: >I have decided to do an implementation myself, as an objective c++ >wrapper to >std::set. I want to use the class to aid in destruction of >directed cyclical object graphs, >in dual mode frameworks. "Dual mode" as in both Ret

Re: How to transform a NSString to a NSString C string format?

2009-02-05 Thread Stephen J. Butler
On Thu, Feb 5, 2009 at 4:52 PM, Iceberg-Dev wrote: > Problem: > > > I would like to transform a NSString to a NSString conforming to the C > string format. > > Examples: > - > > toto -> toto > > "toto -> \"toto > > toto -> toto\ntiti > titi Well, first consider how you want to

Re: How to transform a NSString to a NSString C string format?

2009-02-05 Thread Michael Ash
On Thu, Feb 5, 2009 at 5:52 PM, Iceberg-Dev wrote: > Problem: > > > I would like to transform a NSString to a NSString conforming to the C > string format. > > Examples: > - > > toto -> toto > > "toto -> \"toto > > toto -> toto\ntiti > titi > > > My Current Solution: > -

Re: Restoring selection to NSOutlineView

2009-02-05 Thread Rob Keniger
On 06/02/2009, at 11:06 AM, Randall Meadows wrote: So, it seems like I need to try to get the actual *object* pointed to by the index path and see if there is a valid object there, but I can't figure out how to do that, either from the NSOutlineView or its backing NSTreeController. This

Restoring selection to NSOutlineView

2009-02-05 Thread Randall Meadows
Man, I'm feeling dumb today...NSOutlineView/NSTreeController is kicking my butt... I'm trying to determine a sane new selection for when I delete the currently selected item in an NSOutlineView. I'm failing. My thought was to get the index path of the item I deleted, then try to select t

Re: Needed : set class for Cocoa

2009-02-05 Thread Tommy Nordgren
On Feb 6, 2009, at 1:18 AM, Sean McBride wrote: Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 6:29 PM said: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mu

Re: CoreData migration and file change

2009-02-05 Thread Dave Fernandes
I do migration in a subclass of NSDocumentController in the openDocumentWithContentsOfURL:display:error: method. Works great, but I've only tested on 10.4 so far. You migrate the store and then call [super openDocumentWithContentsOfURL...]. Dave On Feb 5, 2009, at 9:56 AM, Dan Grassi wrote

IKImageView selection issue

2009-02-05 Thread Christian Graus
I have a class derived from IKImageView, and in my initWithFrame ( which is the only init I call ), I set [self setDelegate:self]; Once I do this, I have this code: - (void) selectionRectAdded: (IKImageView *) imageView { NSLog(@"Created sel rect"); } I run the app and make a selection. This

Re: Needed : set class for Cocoa

2009-02-05 Thread Peter N Lewis
At 0:29 +0100 6/2/09, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. You could always just use the C++ std::set Not Cocoa, as such, but has the semantics you desire. Enjoy, Peter

Re: Simple memory problem

2009-02-05 Thread Graham Cox
On 6 Feb 2009, at 11:16 am, Shawn Erickson wrote: Since inputString is large you really should avoid causing it to be copied over and over again I agree wholeheartedly, the autorelease pool "solution" is a sticking plaster on a gaping wound. A better approach is to avoid the need for it

Re: Simple memory problem

2009-02-05 Thread Shawn Erickson
On Thu, Feb 5, 2009 at 4:16 PM, Shawn Erickson wrote: > On Thu, Feb 5, 2009 at 3:39 PM, harry greenmonster > wrote: > >> 'inputString' is a 5mb text file, > > Since inputString is large you really should avoid causing it to be > copied over and over again which -[NSString > stringByReplacingChara

Re: Simple memory problem

2009-02-05 Thread harry greenmonster
"NSMutableString", good idea, I think that will work, will try that thanks. And thanks everyone else. On 6 Feb 2009, at 00:16, Shawn Erickson wrote: On Thu, Feb 5, 2009 at 3:39 PM, harry greenmonster wrote: 'inputString' is a 5mb text file, Since inputString is large you really should

Re: Needed : set class for Cocoa

2009-02-05 Thread Sean McBride
Tommy Nordgren (tommy.nordg...@comhem.se) on 2009-02-06 6:29 PM said: >Do anyone know of a set container class for Cocoa objects, that use >pointer semantics. > >Like this: > NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" >mutableCopy]; > > Somesetclass *someSet = [[

Re: Simple memory problem

2009-02-05 Thread harry greenmonster
I had already tried an NSAutoreleasePool but came across issues, it released inputString so as useless for the next iteration. So I tried keeping it around with... if (inputString != nil) { [inputString retain]; /* Keep match around.

Re: Simple memory problem

2009-02-05 Thread Shawn Erickson
On Thu, Feb 5, 2009 at 3:39 PM, harry greenmonster wrote: > 'inputString' is a 5mb text file, Since inputString is large you really should avoid causing it to be copied over and over again which -[NSString stringByReplacingCharactersInRange:withString:] is doing. You should instead use a mutable

Re: Needed : set class for Cocoa

2009-02-05 Thread Quincey Morris
On Feb 5, 2009, at 15:59, Quincey Morris wrote: Alternatively, you can use NSSet with values "encoded" by [NSValue valueWithPointer: someObject], and "decoded" by [someValueObject pointerValue]. Er, sorry, if you're going that route, it would be slightly more correct to use [NSValue value

Re: Needed : set class for Cocoa

2009-02-05 Thread Jason Foreman
You could throw the pointers into NSValue objects and store those in an NS[Mutable]Set.. Jason On Feb 5, 2009, at 5:29 PM, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" muta

Re: Needed : set class for Cocoa

2009-02-05 Thread Quincey Morris
On Feb 5, 2009, at 15:29, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; Somesetclass *someSet = [[Somesetclass alloc]init];

Re: Needed : set class for Cocoa

2009-02-05 Thread Ken Thomases
On Feb 5, 2009, at 5:29 PM, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; Somesetclass *someSet = [[Somesetclass alloc]init];

Re: Simple memory problem

2009-02-05 Thread Ken Thomases
On Feb 5, 2009, at 5:39 PM, harry greenmonster wrote: while([inputString isMatchedByRegex:regexString]){ range = [inputString rangeOfRegex:regexString]; inputString = [inputString stringByReplacingCharactersInRange:range withString:@""]; } 'inputString'

Re: Needed : set class for Cocoa

2009-02-05 Thread Graham Cox
On 6 Feb 2009, at 10:44 am, Jordan Breeding wrote: NSSet/NSMutableSet They don't compare by pointer, they compare using -isEqual:, which returns YES for the two strings that the OP indicated. I can only suggest wrapping the objects in an NSValue using [NSValue valueWithPointer:]; thoug

Re: Simple memory problem

2009-02-05 Thread Nick Zitzmann
On Feb 5, 2009, at 4:39 PM, harry greenmonster wrote: I'm a little confused as to why I have a problem. My understanding is that 'inputString' (on the third line) is replaced by the modified version of itself. I was expecting the memory footprint for the app to reduce in size (if anything)

Re: Simple memory problem

2009-02-05 Thread Graham Cox
On 6 Feb 2009, at 10:39 am, harry greenmonster wrote: a pointer address when replaced by another address free's up the old memory location it once pointed to, no? No. It just means you orphaned the object - the memory it occupies is still err, occupied. However, in this case it's OK to do

Re: Needed : set class for Cocoa

2009-02-05 Thread Jordan Breeding
On 05 Feb, 2009, at 17:44, Jordan Breeding wrote: On 05 Feb, 2009, at 17:29, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; S

Re: Needed : set class for Cocoa

2009-02-05 Thread Jordan Breeding
On 05 Feb, 2009, at 17:29, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; Somesetclass *someSet = [[Somesetclass alloc]init];

Simple memory problem

2009-02-05 Thread harry greenmonster
while([inputString isMatchedByRegex:regexString]){ range = [inputString rangeOfRegex:regexString]; inputString = [inputString stringByReplacingCharactersInRange:range withString:@""]; } 'inputString' is a 5mb text file, Activity Monitor shows that memory

Re: underlining

2009-02-05 Thread Graham Cox
On 6 Feb 2009, at 10:00 am, Eric Slosser wrote: I'm trying to draw underlined strings, but they come out wrong In what way? The code looks OK to me, the -drawGlyphsForGlyphRange:atPoint: claims it handles all the underlining, etc. I just had a load of pain with underlining too - what is

Needed : set class for Cocoa

2009-02-05 Thread Tommy Nordgren
Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" mutableCopy], * s2 = [@"Hello" mutableCopy]; Somesetclass *someSet = [[Somesetclass alloc]init]; [someSet add:s1]; [someSet add: s2];

Re: Transparency with PNG on NSImageView

2009-02-05 Thread Quincey Morris
On Feb 5, 2009, at 14:28, Damien Cooke wrote: I have what is probably a stupid problem. In my window I have a background NSImageView and I want to pop another much smaller one on top. The one I am putting on top is a png with transparencies. When I do this I get a rectangular image over m

Re: How to transform a NSString to a NSString C string format?

2009-02-05 Thread Sean McBride
On 2/5/09 11:52 PM, Iceberg-Dev said: >I would like to transform a NSString to a NSString conforming to the >C string format. > >Examples: >- > >toto -> toto > >"toto -> \"toto > >toto -> toto\ntiti >titi I think people are misunderstanding your question. I doubt Cocoa has any built-in

Re: Transparency with PNG on NSImageView

2009-02-05 Thread Damien Cooke
Thanks David, I am not sure that this will work for me in this instance as the smaller image needs to be in a NSImageView so I can drag n'drop other images in there. Regards Damien On 06/02/2009, at 9:22 AM, David Blanton wrote: I do this to composite one image over another: CGCo

underlining

2009-02-05 Thread Eric Slosser
I'm trying to draw underlined strings, but they come out wrong when the font is bold. So I made a sample app from the Cocoa template, and added a custom view to the main window. The code is below. But the output doesn't underline correctly. What am I doing wrong? NSTextStorage* ge

Re: How to transform a NSString to a NSString C string format?

2009-02-05 Thread Luke the Hiesterman
easiest for most cases to use [myString UTF8String]. Luke On Feb 5, 2009, at 2:55 PM, David Blanton wrote: cStringUsingEncoding: Returns a representation of the receiver as a C string using a given encoding. - (const char *)cStringUsingEncoding:(NSStringEncoding)encoding On Feb 5, 2009,

Re: How to transform a NSString to a NSString C string format?

2009-02-05 Thread David Blanton
cStringUsingEncoding: Returns a representation of the receiver as a C string using a given encoding. - (const char *)cStringUsingEncoding:(NSStringEncoding)encoding On Feb 5, 2009, at 3:52 PM, Iceberg-Dev wrote: Problem: I would like to transform a NSString to a NSString conform

Re: Transparency with PNG on NSImageView

2009-02-05 Thread Damien Cooke
I create a new NSImageView and load it with the image then display the NSImageView Damien On 06/02/2009, at 9:13 AM, Randall Meadows wrote: On Feb 5, 2009, at 3:28 PM, Damien Cooke wrote: Hi All, I have what is probably a stupid problem. In my window I have a background NSImageView and

Re: Transparency with PNG on NSImageView

2009-02-05 Thread David Blanton
I do this to composite one image over another: CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); CGContextDrawImage(ctx, rect, _meterImages[0]); CGContextSetBlendMode (ctx, kCGBlendModeNormal); CGContextDrawImage(ctx

How to transform a NSString to a NSString C string format?

2009-02-05 Thread Iceberg-Dev
Problem: I would like to transform a NSString to a NSString conforming to the C string format. Examples: - toto -> toto "toto -> \"toto toto -> toto\ntiti titi My Current Solution: I can do this using a NSMutableString and a series of call to: -

Transparency with PNG on NSImageView

2009-02-05 Thread Damien Cooke
Hi All, I have what is probably a stupid problem. In my window I have a background NSImageView and I want to pop another much smaller one on top. The one I am putting on top is a png with transparencies. When I do this I get a rectangular image over my background but what I want to see i

Re: Confused about NSTrackingAreas with autoscroll [WORKAROUND]

2009-02-05 Thread Corbin Dunn
The cell consumes the event loop and dispatches events. Look at the code via http://developer.apple.com/samplecode/PhotoSearch/listing9.html ie: if ([theEvent type] == NSMouseEntered || [theEvent type] == NSMouseExited) { [NSApp sendEvent:theEvent]; } But do please log a bug; at worst, we c

Re: Memory management question in Objective-C 2.0 @property notation

2009-02-05 Thread Kiel Gillard
Thanks mmalc, that clears things up for me. On 05/02/2009, at 8:08 PM, mmalc Crawford wrote: On Feb 4, 2009, at 10:01 PM, Kiel Gillard wrote: I'm confused as to why else the memory would be leaking? Can you please identify my error? The error is in your explanation. However, doing this

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread Andrew Farmer
On 05 Feb 09, at 10:21, Josh de Lioncourt wrote: I've never seen anything that promoted the idea of storing non- standard data files in that folder. If there's a good argument for it, please enlighten me. Many Carbon applications (especially older ones) store preferences in ~/Library/Prefe

Re: Getting *my* object out of a tree controller?

2009-02-05 Thread Kyle Sluder
On Thu, Feb 5, 2009 at 3:36 PM, Randall Meadows wrote: > Even when I query the tree controller directly for its items, I don't get > *my* object types back, but rather NSTreeControllerTreeNodes: Why does this surprise you? The outline view's data source (the tree controller) is providing instanc

[moderator] Re: AquaticPrime Config.php + PayPal Advanced Variables Not Working

2009-02-05 Thread Scott Anguish
please take this discussion to either the creator of the AquaticPrime system or to the macsb (mac small business) list. On 3-Feb-09, at 7:21 PM, Chunk 1978 wrote: i have AquaticPrime set up with PayPal for a small software license that i sell maybe once every 2 months. i'm releasing somethi

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Michael Ash
On Thu, Feb 5, 2009 at 12:39 PM, Eric Gorr wrote: > > On Feb 5, 2009, at 12:33 PM, Andy Lee wrote: > >> On Feb 5, 2009, at 12:17 PM, Eric Gorr wrote: >>> >>> I wasn't sure what _textField2 was supposed to refer to exactly, >> >> Oops, copy-paste error. :) >> >>> so I tried this instead: >>> >>> [[

Getting *my* object out of a tree controller?

2009-02-05 Thread Randall Meadows
I have an NSOutlineView backed by an NSTreeController. selectedObject = [[treeController selectedObjects] objectAtIndex:n] gives me back an object (of the type) that I expect. However, when I then try to find where that object lives in the tree [treeView rowForItem:selectedObject] returns -

Re: Confused about NSTrackingAreas with autoscroll [WORKAROUND]

2009-02-05 Thread Luke Evans
Hi Corbin. Thanks for the note. Well, the trouble is, if you are consuming the event loop, then you need to dispatch things. Have you seen: http://developer.apple.com/samplecode/PhotoSearch/ ? Yes, I studied this before I started and used the patterns in there. The cell consumes the even

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread Mike Abdullah
On 5 Feb 2009, at 18:29, I. Savant wrote: On Thu, Feb 5, 2009 at 1:21 PM, Josh de Lioncourt wrote: There are several reasons we're not doing it this way. One is that our application data will be stored in a customized format that is *not* a .plist file, because we need to maintain cross-

Re: Encoding to use for file names

2009-02-05 Thread Clark Cox
On Thu, Feb 5, 2009 at 9:41 AM, Nick Zitzmann wrote: > > On Feb 5, 2009, at 10:29 AM, Francis Devereux wrote: > >> I have an NSString with a filename in it that I need to pass to the >> portable code as a char *. The portable code will then pass it to UNIX file >> handling functions like fopen().

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread Sean McBride
On 2/5/09 10:21 AM, Josh de Lioncourt said: >It doesn't seem wise to me to >store non-.plist files in ~/Library/Preferences. I disagree. The Mac OS had a standard Preferences folder since at least System 7 and in those days we didn't have the CFPreferences API and apps stored prefs in that folde

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread I. Savant
On Thu, Feb 5, 2009 at 1:21 PM, Josh de Lioncourt wrote: > There are several reasons we're not doing it this way. One is that our > application data will be stored in a customized format that is *not* a > .plist file, because we need to maintain cross-platform support. Yes, I > know that techni

Re: Open OtherApp just behind MyApp

2009-02-05 Thread Ken Thomases
On Feb 5, 2009, at 2:31 AM, Yang Meyer wrote: Thanks for pointing out the potential cause. I read up on Obj-C trampoline methods/objects (pretty cool, actually!) and understand the basic idea, but honestly I'm not seeing the connection to my problem. Why and how would such a trampoline obje

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread Josh de Lioncourt
On Feb 5, 2009, at 4:49 AM, Mike Abdullah wrote: Please, please, please do not store preferences in ~/Library/ Application Support/ They should go in ~/Library/Preferences Everything else is fine to go in app support. Apple provides both NSUserDefaults and CFPreferences APIs for storing your

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Eric Gorr
On Feb 5, 2009, at 12:39 PM, Eric Gorr wrote: On Feb 5, 2009, at 12:33 PM, Andy Lee wrote: On Feb 5, 2009, at 12:17 PM, Eric Gorr wrote: I wasn't sure what _textField2 was supposed to refer to exactly, Oops, copy-paste error. :) so I tried this instead: [[textField currentEditor] setSe

Re: Encoding to use for file names

2009-02-05 Thread Francis Devereux
On 5 Feb 2009, at 17:40, Joar Wingfors wrote: On Feb 5, 2009, at 9:29 AM, Francis Devereux wrote: I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it that I need to pass to the portable code as

Re: Encoding to use for file names

2009-02-05 Thread Clark Cox
Just use: const char *filename = [nsstring fileSystemRepresentation]; On Thu, Feb 5, 2009 at 9:29 AM, Francis Devereux wrote: > Hi, > > I am porting an app to Mac OS X (well, actually someone else has ported it > and I am building a cocoa GUI). > > I have an NSString with a filename in it that I

Re: Encoding to use for file names

2009-02-05 Thread glenn andreas
On Feb 5, 2009, at 11:29 AM, Francis Devereux wrote: Hi, I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it that I need to pass to the portable code as a char *. The portable code will then

Re: Encoding to use for file names

2009-02-05 Thread Douglas Davidson
On Feb 5, 2009, at 9:33 AM, David Springer wrote: I generally use UTF8. On Thu, Feb 5, 2009 at 10:29 AM, Francis Devereux wrote: Hi, I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it th

Re: Encoding to use for file names

2009-02-05 Thread Nick Zitzmann
On Feb 5, 2009, at 10:29 AM, Francis Devereux wrote: I have an NSString with a filename in it that I need to pass to the portable code as a char *. The portable code will then pass it to UNIX file handling functions like fopen(). I guess that I need to use NSString's getCString:maxLength:

Re: Encoding to use for file names

2009-02-05 Thread Shawn Erickson
On Thu, Feb 5, 2009 at 9:29 AM, Francis Devereux wrote: > I guess that I need to use NSString's getCString:maxLength:encoding: method, > but what should I pass for the encoding parameter? Phrased another way, > what encoding does fopen() expect filenames to be in? -[NSString fileSystemRepresent

Re: Encoding to use for file names

2009-02-05 Thread Joar Wingfors
On Feb 5, 2009, at 9:29 AM, Francis Devereux wrote: I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it that I need to pass to the portable code as a char *. The portable code will then pass it

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Eric Gorr
On Feb 5, 2009, at 12:33 PM, Andy Lee wrote: On Feb 5, 2009, at 12:17 PM, Eric Gorr wrote: I wasn't sure what _textField2 was supposed to refer to exactly, Oops, copy-paste error. :) so I tried this instead: [[textField currentEditor] setSelectedRange:NSMakeRange(0, 0)]; Bah, currentEdi

Re: Encoding to use for file names

2009-02-05 Thread David Springer
I generally use UTF8. On Thu, Feb 5, 2009 at 10:29 AM, Francis Devereux wrote: > Hi, > > I am porting an app to Mac OS X (well, actually someone else has ported it > and I am building a cocoa GUI). > > I have an NSString with a filename in it that I need to pass to the > portable code as a char

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Andy Lee
On Feb 5, 2009, at 12:17 PM, Eric Gorr wrote: I wasn't sure what _textField2 was supposed to refer to exactly, Oops, copy-paste error. :) so I tried this instead: [[textField currentEditor] setSelectedRange:NSMakeRange(0, 0)]; Bah, currentEditor is what I was trying to remember. --Andy _

Encoding to use for file names

2009-02-05 Thread Francis Devereux
Hi, I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it that I need to pass to the portable code as a char *. The portable code will then pass it to UNIX file handling functions like fopen().

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Eric Gorr
On Feb 5, 2009, at 12:15 PM, Kyle Sluder wrote: On Thu, Feb 5, 2009 at 11:29 AM, Eric Gorr wrote: In case it matters and in case someone can suggest something better, the reason why I need to do this is because I have a NSView (ResourceItem) which contains both a NSImageView and a NSTextF

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Eric Gorr
On Feb 5, 2009, at 12:08 PM, Andy Lee wrote: --Boundary_(ID_M0oYCC145WUCuhpk/sOO1w) Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-transfer-encoding: 7BIT On Feb 5, 2009, at 11:33 AM, Eric Gorr wrote: [myTextField selectText:nil]; Thanks. Unfortunately, that i

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Kyle Sluder
On Thu, Feb 5, 2009 at 11:29 AM, Eric Gorr wrote: > In case it matters and in case someone can suggest something better, the > reason why I need to do this is because I have a NSView (ResourceItem) which > contains both a NSImageView and a NSTextField. You can see a picture here: Maybe you should

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Andy Lee
On Feb 5, 2009, at 11:33 AM, Eric Gorr wrote: [myTextField selectText:nil]; Thanks. Unfortunately, that is not quite the desired behavior as it causes all of the text to be selected and I want to see the blinking cursor. It did begin a text editing session though, so it is quite close.

Re: Anyone using IKImageView/any alternatives ?

2009-02-05 Thread Jim Turner
I'm using IKImageView in an app and while it's far from being a "fully-featured" control, it can do some things ok. If all you need to do is pan and zoom, IKImageView will work just fine. It's when you get into more "advanced" things like "rotation" and "saving changes" where the implementation f

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Eric Gorr
On Feb 5, 2009, at 11:23 AM, Andy Lee wrote: On Feb 5, 2009, at 10:54 AM, Eric Gorr wrote: For example, NSTextField does not respond to the setSelectedRange message. [myTextField selectText:nil]; Thanks. Unfortunately, that is not quite the desired behavior as it causes all of the text t

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Eric Gorr
On Feb 5, 2009, at 10:54 AM, Eric Gorr wrote: The documentation at: http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/TextEditing/Tasks/SetFocus.html#/ /apple_ref/doc/uid/2933 seems to indicate that one just needs to do: [theWindow makeFirstResponder: theTextView]; [theTextView

Re: [Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Andy Lee
On Feb 5, 2009, at 10:54 AM, Eric Gorr wrote: For example, NSTextField does not respond to the setSelectedRange message. [myTextField selectText:nil]; --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin request

Re: Anyone using IKImageView/any alternatives ?

2009-02-05 Thread douglas welton
Have you tried using a CALayer or perhaps a CAScrollLayer in a layer- hosted view? As for NSImageView, the things is supprots are listed in the documentation ;^} On Feb 5, 2009, at 5:13 AM, Christian Graus wrote: I am googling for example of IKImageView, and all I am finding is posts like

Re: Confused about NSTrackingAreas with autoscroll [WORKAROUND]

2009-02-05 Thread Corbin Dunn
On Feb 4, 2009, at 5:51 PM, Luke Evans wrote: OK, FWIW for the record here is the resolution I've arrived at: mouseEntered and mouseExited events from tracking areas that are active when mouse dragging begins are dysfunctional in the drag, specifically when autoscrolling at the boundaries

Re: Full Screen Mode With MenuBar

2009-02-05 Thread douglas welton
Adam, How do you want to do "fullscreen mode"? Do you want your window/view to take up the entire screen, except for the menu bar? If so, have you tried to create a borderless window and resize it using [[NSScreen mainScreen] visibleFrame]? or... Do you want your window/view to take up t

Re: why popupbuttoncell always select second item in tableview ?

2009-02-05 Thread Corbin Dunn
On Feb 4, 2009, at 7:47 PM, Yang Mu wrote: How to implement difference popup items in each row in table view? I want to make popup cell related to others. so different row show different pop cell. but table view only can set datacell to column, how to set datacell to row? I still sugg

Re: another NSCFDictionary and GC problem?

2009-02-05 Thread Bill Bumgarner
On Feb 5, 2009, at 3:23 AM, Markus Guhe wrote: I get the following elusive crash (about once in 20 app launches). It happens while decoding a dictionary using an NSKeyedUnarchiver from a saved file when my application starts. The value of the dictionary that causes this problem is an attribu

[Q] How can one programatically begin a text editing session in a NSTextField?

2009-02-05 Thread Eric Gorr
The documentation at: http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/TextEditing/Tasks/SetFocus.html#/ /apple_ref/doc/uid/2933 seems to indicate that one just needs to do: [theWindow makeFirstResponder: theTextView]; [theTextView setSelectedRange:NSMakeRange(0,0)]; However, up

Re: Memory management question in Objective-C 2.0 @property notation

2009-02-05 Thread Bryan Henry
No, you do need to release it. You should release the ivars for any retain or copy-type properties in your -dealloc implementation. Is your property was just an assign property, then you would not need to release it in -dealloc. Also - a common mistake when using properties is to set the iv

Re: Interface Builder Nested Object Selection

2009-02-05 Thread Richard Somers
Joey and Jonathan, Hey guys thanks for the tips! I had no idea this functionality was available in Interface Builder. Richard On Feb 4, 2009, at 6:36PM, Joey Hagedorn wrote: One tip that you might find helpful to select nested items quickly in Interface Builder is to hold down Shift + Con

Re: Full Screen Mode With MenuBar

2009-02-05 Thread Sean McBride
On 2/4/09 8:26 PM, Adam Gerson said: >I am looking to implement a fullscreen window while showing the >menubar. The consensus is that NSView's enterFullScreenMode is buggy >and doesn't support showing the menu bar. True. >What is the alternative? Are >there any good examples out there? I have do

Re: CoreData migration and file change

2009-02-05 Thread Dan Grassi
I am doing the migration in readFromURL:ofType:error: I call: migrationManager with migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error : Thus I get a new file on the migration, that seems to be the crux of the problem. So I

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread Gregory Weston
Shawn Erickson wrote: On Wed, Feb 4, 2009 at 6:05 PM, Josh de Lioncourt wrote: Hi, I have some products under development written in C++. I am not using Cocoa for the most part, as these are cross-platform projects. Review... http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Lo

  1   2   >