Re: escaping a string

2008-09-21 Thread Stephen J. Butler
On Sun, Sep 21, 2008 at 12:09 AM, Sandro Noel <[EMAIL PROTECTED]> wrote: > NSData *torrentData = [[NSData alloc]initWithContentsOfURL:[NSURL > URLWithString:itemLink]]; > if (0 < [torrentData length]){ >NSString *torrentString = [[[NSString alloc]initWithData:torrentData > encoding:NSASCIIS

Storing Instances of a structure in a file

2008-09-21 Thread Adil Saleem
Hi,   I want to store instances of a structure in a file so that my application can retreive them and read them.(Basically they are different configuration presets for the application) I also want each instance that is stored to be unique. I know this becomes a typical database problem but i don

Re: Storing Instances of a structure in a file

2008-09-21 Thread Phil
On Sun, Sep 21, 2008 at 9:13 PM, Adil Saleem <[EMAIL PROTECTED]> wrote: > Hi, > > I want to store instances of a structure in a file so that my application can > retreive them and read them.(Basically they are different configuration > presets for the application) I also want each instance that i

Re: Storing Instances of a structure in a file

2008-09-21 Thread Adil Saleem
And what if the fields in structures are instances of Cocoa classes (like NSNumber etc) ?         --- On Sun, 9/21/08, Phil <[EMAIL PROTECTED]> wrote: From: Phil <[EMAIL PROTECTED]> Subject: Re: Storing Instances of a structure in a file To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date:

Re: Storing Instances of a structure in a file

2008-09-21 Thread Phil
On Sun, Sep 21, 2008 at 11:09 PM, Adil Saleem <[EMAIL PROTECTED]> wrote: > And what if the fields in structures are instances of Cocoa classes (like > NSNumber etc) ? > Do you have to use structs, or can you wrap them up in an Objective-C class that implements NSCoding? Phil _

Re: Storing Instances of a structure in a file

2008-09-21 Thread Phil
On Sun, Sep 21, 2008 at 11:21 PM, Adil Saleem <[EMAIL PROTECTED]> wrote: > I will have to use structs. > Then you will have to write your own code to handle any fields that are pointers to values/objects that exist elsewhere. Phil ___ Cocoa-dev mailing

Re: Core Data migration

2008-09-21 Thread Timothy Larkin
Having worked through this problem myself, I can offer a few suggestions. First, some kind list member pointed out to me that the automated migration function does not support abstract classes. So you have to outwit Apple. I created a custom migration policy for the abstract class by subc

Re: Finding other apps' paths - deterministically!

2008-09-21 Thread Tommy Nordgren
On Sep 21, 2008, at 6:36 AM, Michael Ash wrote: On Sat, Sep 20, 2008 at 12:57 PM, Tommy Nordgren <[EMAIL PROTECTED]> wrote: Use NSTask with the command line find -x / -name '*.app' Do this on a separate thread, and cache the result. I highly recommend against this approach. One proble

Re: escaping a string

2008-09-21 Thread Sandro Noel
Stephen. I'm really new at a lot of things at this point in time...(torrents, cocoa, binary format, ) in this litle adventure of mine, so please excuse if the questions seem a little beginner's type. Would this function make more sense? is this the "right way to do it" ? so basically what

Re: Finding other apps' paths - deterministically!

2008-09-21 Thread Peter O'Gorman
Tommy Nordgren wrote: > > On Sep 21, 2008, at 6:36 AM, Michael Ash wrote: > >> On Sat, Sep 20, 2008 at 12:57 PM, Tommy Nordgren >> <[EMAIL PROTECTED]> wrote: >>> Use NSTask with the command line find -x / -name '*.app' >>> Do this on a separate thread, and cache the result. >> >> I highly

Re: escaping a string

2008-09-21 Thread Andrew Farmer
On 21 Sep 08, at 11:14, Sandro Noel wrote: so basically what i'm dooing here, is that if i find the caracter "d" and i'm at least 4 bytes into the file, i check to see if the 4 caracters before my location contain the word "info", so then i know that my current location is the start of the in

Re: NSOperationQueue

2008-09-21 Thread John Love
has wrote: Getting back to the main discussion of the OP's threading/ NSOperationQueue problems, perhaps it would help if he backs up a bit and explains in general terms what he's trying to achieve, rather than focus on individual details of how he's currently trying to do it? That way, fo

How to load a window

2008-09-21 Thread Eric Lee
My question is simple (and probably basic from some of you experts :S). How do you load another window just by pressing a button? On CocoaDevCentral, they say to use NSBundle, but I read on the documentation that you can also use NSWindowController? Thanks for any help!

Re: How to load a window

2008-09-21 Thread Nick Zitzmann
On Sep 21, 2008, at 2:53 PM, Eric Lee wrote: On CocoaDevCentral, they say to use NSBundle, but I read on the documentation that you can also use NSWindowController? NSBundle has the master methods for loading nibs into memory. NSWindowController uses NSBundle internally. Generally, if you

Appropriateness of assign attribute and -fobj-gc-only

2008-09-21 Thread Rick Mann
According to the Obj-C 2.0 docs: assign Specifies that the setter uses simple assignment. This is the default. If your application uses garbage collection, if you want to use assign for a property whose class adopts the NSCopying protocol you should specify the attribute explicitly rather t

Re: How to load a window

2008-09-21 Thread Charles Steinman
--- On Sun, 9/21/08, Eric Lee <[EMAIL PROTECTED]> wrote: > My question is simple (and probably basic from some of you > experts :S). How do you load another window just by > pressing a button? > > On CocoaDevCentral, they say to use NSBundle, but I read on > the > documentation that you can a

Re: Finding other apps' paths - deterministically!

2008-09-21 Thread Peter O'Gorman
Peter O'Gorman wrote: > Tommy Nordgren wrote: >> On Sep 21, 2008, at 6:36 AM, Michael Ash wrote: >> >>> On Sat, Sep 20, 2008 at 12:57 PM, Tommy Nordgren >>> <[EMAIL PROTECTED]> wrote: Use NSTask with the command line find -x / -name '*.app' Dunno how I missed the -x, does not matter th

Re: NSOperationQueue

2008-09-21 Thread Mike Fischer
Am 21.09.2008 um 22:46 schrieb John Love: has wrote: Getting back to the main discussion of the OP's threading/ NSOperationQueue problems, perhaps it would help if he backs up a bit and explains in general terms what he's trying to achieve, rather than focus on individual details of how he

Re: escaping a string

2008-09-21 Thread Sandro Noel
Oups, I did not think of that ... newbe error :) Thanks. On 21-Sep-08, at 4:25 PM, Andrew Farmer wrote: On 21 Sep 08, at 11:14, Sandro Noel wrote: so basically what i'm dooing here, is that if i find the caracter "d" and i'm at least 4 bytes into the file, i check to see if the 4 caracters

Re: fullscreen quicktime across multiple monitors

2008-09-21 Thread Memo Akten
hmm, yea does seem a bit problematic. so is it not possible to play quicktime across multiple monitors then? those threads seem to have not come to a solution... On 19 Sep 2008, at 17:48, Sean McBride wrote: It does, doesn't it. However, it has lots of little problems, and is only re

Re: Appropriateness of assign attribute and -fobj-gc-only

2008-09-21 Thread Quincey Morris
On Sep 21, 2008, at 14:04, Rick Mann wrote: But the warning is: "warning: 'assign' attribute on property 'portName' which implements 'NSCopying' protocol not appropriate with -fobjc-gc-only" So, is it really inappropriate? It seems very appropriate to assign the pointer rather than alloca

Re: Finding other apps' paths - deterministically!

2008-09-21 Thread Tommy Nordgren
On Sep 21, 2008, at 11:25 PM, Peter O'Gorman wrote: Peter O'Gorman wrote: Tommy Nordgren wrote: On Sep 21, 2008, at 6:36 AM, Michael Ash wrote: On Sat, Sep 20, 2008 at 12:57 PM, Tommy Nordgren <[EMAIL PROTECTED]> wrote: Use NSTask with the command line find -x / -name '*.app' Dunno

Re: Appropriateness of assign attribute and -fobj-gc-only

2008-09-21 Thread Michael Ash
On Sun, Sep 21, 2008 at 5:04 PM, Rick Mann <[EMAIL PROTECTED]> wrote: > According to the Obj-C 2.0 docs: > >> assign >> Specifies that the setter uses simple assignment. This is the default. >> >> If your application uses garbage collection, if you want to use assign for >> a property whose class a

Re: Finding other apps' paths - deterministically!

2008-09-21 Thread Michael Ash
On Sun, Sep 21, 2008 at 1:52 PM, Tommy Nordgren <[EMAIL PROTECTED]> wrote: > > On Sep 21, 2008, at 6:36 AM, Michael Ash wrote: > >> On Sat, Sep 20, 2008 at 12:57 PM, Tommy Nordgren >> <[EMAIL PROTECTED]> wrote: >>> >>> Use NSTask with the command line find -x / -name '*.app' >>> Do this on a

Re: Appropriateness of assign attribute and -fobj-gc-only

2008-09-21 Thread Quincey Morris
On Sep 21, 2008, at 15:00, Quincey Morris wrote: So, is it really inappropriate? It seems very appropriate to assign the pointer rather than allocate a new object and copy it, especially for immutable objects. No, it's not. Sorry, just to clarify -- no, it's not really inappropriate. Yes,

Re: fullscreen quicktime across multiple monitors

2008-09-21 Thread Jean-Daniel Dupas
You are free to setup a window yourself , add a QTMovieView in it, and display it as you need. NSRect contents = [aScreen frame]; contents.origin = NSZeroPoint; NSWindow *window = [super initWithContentRect:contents styleMask:NSBorderlessWindowMas

Re: How to load a window

2008-09-21 Thread Chris Hanson
On Sep 21, 2008, at 1:53 PM, Eric Lee wrote: My question is simple (and probably basic from some of you experts :S). How do you load another window just by pressing a button? On CocoaDevCentral, they say to use NSBundle, but I read on the documentation that you can also use NSWindowControll

How do I get CAScrollLayer to draw its sublayers

2008-09-21 Thread Cesar Alaniz
I have set up a CAScrollLayer with one sublayer, in this case a CATiledLayer. The documentation say's that CATiledLayer will call drawLayer:(CALayer*)layer inContext:(CGContextRef) ref as the layer is needed to be drawn. I cannot see this method being called currently. My CAScrollLayer,

Re: NsPredicateEditor

2008-09-21 Thread Chris Idou
There's one or two demo apps on the apple site. I think it's called PredicateEditorSample. If the editor is totally empty on start you may have to initialise it with an empty NSCompoundPredicate so that you can at least see the add button. You can also search the archives for some tips. --- O

Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Rick Mann
I want to implement a simple console for my app. As it generates data, it outputs a string representation of it to an NSTextView in a window. Already this was fairly cumbersome to do, but I got it working. The part that doesn't work is that it doesn't automatically scroll the text up after

Re: Appropriateness of assign attribute and -fobj-gc-only

2008-09-21 Thread Rick Mann
On Sep 21, 2008, at 15:22:22, Quincey Morris wrote: On Sep 21, 2008, at 15:00, Quincey Morris wrote: So, is it really inappropriate? It seems very appropriate to assign the pointer rather than allocate a new object and copy it, especially for immutable objects. No, it's not. Sorry, jus

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Jason Coco
On Sep 21, 2008, at 21:05 , Rick Mann wrote: I want to implement a simple console for my app. As it generates data, it outputs a string representation of it to an NSTextView in a window. Already this was fairly cumbersome to do, but I got it working. The part that doesn't work is that it d

Re: NSScroller will be visible even it is below other view in 10.4

2008-09-21 Thread qi . liu
Hi Andrew, Yeah, that is what I mean. But I am not sure if I understand your suggestion correctly, you mean I change the imageview's autoResizingMask? Since my app sometimes has to place the imageview on top of the scroller, now I can only set the scroller hidden when the imageview is on top

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Erik Buck
To add to the answer: http://www.cocoabuilder.com/archive/message/cocoa/2005/9/30/147205 It's also worth noting that a search of the archives reveals literally 100 answers to this and similar questions. ___ Cocoa-dev mailing list (Cocoa-dev@lists.

Re: NSScroller will be visible even it is below other view in 10.4

2008-09-21 Thread Andrew Merenbach
Greetings! When I mentioned having an image view (in a borderless window) on top of your scroll view, I meant an actual window which has nothing besides an NSImageView inside of it. You would make the window borderless -- so that no title bar or close/minimize/zoom buttons will be displa

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Rick Mann
Thanks! On Sep 21, 2008, at 18:32:58, Jason Coco wrote: You would have to track whether or not the text view is at the end. I suggest looking at the documentation for NSTextView as well as the Scroll View Programming Guide: Well, I was looking all through the NSTextView docs, and couldn't

How to load a window

2008-09-21 Thread Kevin Bracey
If the Window you wish to open is in the same nib, then create a IBOutlet NSWindow *otherWindow in your controller, connect in IBuilder then [otherWindow makeKeyAndOrderFront:self]; Cheers Kevin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: NSScroller will be visible even it is below other view in 10.4

2008-09-21 Thread qi . liu
Hi, The scroller means NSScroller... Yes, I want to draw over the arrow. What I want to implement feels like *LAYERS*, though there are no layers actually.Layer1 has a NSScroller in it. Layer2 has a NSImageView in it. I don't want to see layer1 when layer2 is on top of it. Hope I have made it cl

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Jason Coco
On Sep 21, 2008, at 22:03 , Rick Mann wrote: Thanks! You're welcome :) On Sep 21, 2008, at 18:32:58, Jason Coco wrote: You would have to track whether or not the text view is at the end. I suggest looking at the documentation for NSTextView as well as the Scroll View Programming Guide:

Re: NsPredicateEditor

2008-09-21 Thread Sandro Noel
Thank you, that did it!!! Sandro. On 21-Sep-08, at 7:24 PM, Chris Idou wrote: There's one or two demo apps on the apple site. I think it's called PredicateEditorSample. If the editor is totally empty on start you may have to initialise it with an empty NSCompoundPredicate so that you c

Re: NSScroller will be visible even it is below other view in 10.4

2008-09-21 Thread Andrew Merenbach
Hi! The class reference documentation for NSScroller has, as one of the listed methods: drawArrow:highlight: Draws the scroll button indicated by arrow, which is either NSScrollerIncrementArrow (the down or right scroll button) or NSScrollerDecrementArrow (up or left). - (void)drawArro

Re: Appropriateness of assign attribute and -fobj-gc-only

2008-09-21 Thread Quincey Morris
On Sep 21, 2008, at 18:08, Rick Mann wrote: I was going to say...especially for immutable objects like NSString and NSNumber, which you pointed out are almost always used as attributes and not as relationships, it seems to make more sense (from a performance standpoint, at least) to just as

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Rick Mann
On Sep 21, 2008, at 19:38:16, Jason Coco wrote: If you look at the top of the reference document, you will see a small table. The first row is the list of object references that the object inherits from. Clicking on any of these will take you to the reference for that superclass. The seco

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Jason Coco
On Sep 21, 2008, at 23:02 , Rick Mann wrote: On Sep 21, 2008, at 19:38:16, Jason Coco wrote: If you look at the top of the reference document, you will see a small table. The first row is the list of object references that the object inherits from. Clicking on any of these will take you t

Re: How to load a window

2008-09-21 Thread Michael Ash
On Sun, Sep 21, 2008 at 4:58 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: > > On Sep 21, 2008, at 2:53 PM, Eric Lee wrote: > >> On CocoaDevCentral, they say to use NSBundle, but I read on the >> documentation that you can also use NSWindowController? > > NSBundle has the master methods for loading

Re: NsPredicateEditor

2008-09-21 Thread Barry Wark
I think you can also call setCanRemoveAllRows:NO to prevent the editor from deleting the last (compound predicate) row. -barry On Sun, Sep 21, 2008 at 4:24 PM, Chris Idou <[EMAIL PROTECTED]> wrote: > > There's one or two demo apps on the apple site. I think it's called > PredicateEditorSample. I

Re: Listening for changes in a table

2008-09-21 Thread Chris Idou
I seem to have found a reasonable solution, but I'm a bit confused about why it works and other things haven't. To recap, I'm trying to control an array of dictionaries. Each dictionary contains a file name and a checkbox (boolean). The array is stored in a @"files" member of the user defaults

Did I find a NSScanner bug, or am I doing this all wrong?

2008-09-21 Thread Britt Durbrow
Hi -- I'm getting some really odd behavior out of NSScanner; it seems to be choking on character sets that only have whitespace in them. This doesn't work: #import int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Nathan Kinsinger
On Sep 21, 2008, at 9:09 PM, Jason Coco wrote: On Sep 21, 2008, at 23:02 , Rick Mann wrote: On Sep 21, 2008, at 19:38:16, Jason Coco wrote: If you look at the top of the reference document, you will see a small table. The first row is the list of object references that the object inherits

Re: Did I find a NSScanner bug, or am I doing this all wrong?

2008-09-21 Thread Stephen J. Butler
On Mon, Sep 22, 2008 at 1:15 AM, Britt Durbrow <[EMAIL PROTECTED]> wrote: > I'm getting some really odd behavior out of NSScanner; it seems to be > choking on character sets that only have whitespace in them. Your problem is that you need to set the characters to be skipped to something other than