Re: Core data, bindings and multiple view NIB

2009-05-26 Thread Tomaž Kragelj
How are you binding the "item" array controller? It has to be bound to the group list array controller or to a property of the app delegate that depends on its selection. In MainMenu.nib the two array controllers are bound: GroupsController: - managed object context -> AppController.managedO

Using fmdb with Cocoa Bindings

2009-05-26 Thread Kelvin Chung
I'm fairly new to both fmdb and Cocoa bindings, so I am wondering if anyone can help me out: Suppose I have an FMResultSet resulting in a query. I'm trying to put the results in an NSTableView with Cocoa Bindings. Now the table view has its contentArray bound to an NSArrayController (call

[MEET] Amsterdam CocoaHeads tonight!

2009-05-26 Thread Cathy Shive
Hello! The Amsterdam chapter of CocoaHeads is meeting tonight, May 27, from 7-9 pm. Please join us if you can make it. Tonight's speaker is Klass Pierter Annema, who will talk about the iPhone app he's been developing for Sofa (http://www.madebysofa.com/). Location and other info can be

Re: NSColorPanel flat out lies

2009-05-26 Thread Cathy Shive
Hi Seth, I have a subclass of NSColorWell that broadcasts a "ColorWellDidBecomeActive" notification on "activate:". Objects using the color panel listen for the notification and set some internal flag so that they can either ignore the "changeColor" message or not depending on which color

Re: Filling a Bezier path with a texture

2009-05-26 Thread Graham Cox
On 27/05/2009, at 1:02 PM, Dave Keck wrote: NSColor *color = [NSColor colorWithPatternImage: patternImage]; [[NSGraphicsContext currentContext] saveGraphicsState]; [path addClip]; [color set]; NSRectFill([self bounds]); [[NSGraphicsContext currentContext] restoreGraphicsState]; Or simpler: [

Re: Filling a Bezier path with a texture

2009-05-26 Thread Dave Keck
I'd do something that would look vaguely like this: NSColor *color = [NSColor colorWithPatternImage: patternImage]; [[NSGraphicsContext currentContext] saveGraphicsState]; [path addClip]; [color set]; NSRectFill([self bounds]); [[NSGraphicsContext currentContext] restoreGraphicsState]; Disclaimer

Re: Filling a Bezier path with a texture

2009-05-26 Thread Graham Cox
On 27/05/2009, at 12:46 PM, Development wrote: I have a tiny little texture image that I want to use to fill a bezier path The problem is that I cannot seem to figure out how to use the image to fill the path. It's a curved path basically a hill and the texture is grass. Any ideas? Any one

Re: Displaying a number with Quartz

2009-05-26 Thread Graham Cox
On 27/05/2009, at 12:34 PM, Graham Cox wrote: On 27/05/2009, at 12:24 PM, Pierre Berloquin wrote: That would mean dropping all the niceties of Quartz that lets me draw outlined text, for one. That's not the case. The attributes you pass in - drawAtPoint:withAttributes: can include outlin

Filling a Bezier path with a texture

2009-05-26 Thread Development
I have a tiny little texture image that I want to use to fill a bezier path The problem is that I cannot seem to figure out how to use the image to fill the path. It's a curved path basically a hill and the texture is grass. Any ideas? Any one know of a bit of example code that might help m

Re: Displaying a number with Quartz

2009-05-26 Thread Graham Cox
On 27/05/2009, at 12:24 PM, Pierre Berloquin wrote: That would mean dropping all the niceties of Quartz that lets me draw outlined text, for one. That's not the case. The attributes you pass in - drawAtPoint:withAttributes: can include outlines (NSStrokeWidthAttributeName) in different co

Re: Displaying a number with Quartz

2009-05-26 Thread Pierre Berloquin
That would mean dropping all the niceties of Quartz that lets me draw outlined text, for one. 2009/5/26 Gunnar Proppe > > Actually, your pure Objective C version would be to use NSString's > drawAtPoint:withAttributes instead of converting to a char* and using > CGContextShowTextAtPoint. > > > h

Re: NSColorPanel flat out lies

2009-05-26 Thread Seth Willits
On May 26, 2009, at 6:15 PM, Graham Cox wrote: I have a color well, which I am clicking on, and whenever I change the color in the color panel, the color panel sends a changeColor: message down the responder chain. Every time. I *don't* want this, because it's sending changeColor to the wro

Re: NSColorPanel flat out lies

2009-05-26 Thread Graham Cox
On 27/05/2009, at 10:11 AM, Seth Willits wrote: I have a color well, which I am clicking on, and whenever I change the color in the color panel, the color panel sends a changeColor: message down the responder chain. Every time. I *don't* want this, because it's sending changeColor to the w

Re: NSColorPanel flat out lies

2009-05-26 Thread Alexander Heinz
I'm sorry, I misread; you're talking about NSColorPanel. You might try sending setContinous:NO to the color panel. Hope that helps, Alex Heinz On May 26, 2009, at 8:54 PM, Alexander Heinz wrote: NSColorWell is a subclass of NSControl. It should respond to setTarget:. Just use that. HTH, Al

Re: NSColorPanel flat out lies

2009-05-26 Thread Alexander Heinz
NSColorWell is a subclass of NSControl. It should respond to setTarget:. Just use that. HTH, Alex Heinz On May 26, 2009, at 8:11 PM, Seth Willits wrote: I have a color well, which I am clicking on, and whenever I change the color in the color panel, the color panel sends a changeColor:

NSColorPanel flat out lies

2009-05-26 Thread Seth Willits
I have a color well, which I am clicking on, and whenever I change the color in the color panel, the color panel sends a changeColor: message down the responder chain. Every time. I *don't* want this, because it's sending changeColor to the wrong object. It's a bit long-winded to explain,

Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect

2009-05-26 Thread mmalc Crawford
On May 26, 2009, at 4:28 PM, Mark Allan wrote: FWIW, I initially came from a Java background and something I still really miss from the JavaDoc style API documentation is the group of sections entitled "Methods inherited from XYZ". Those sections make it incredibly easy to see at a glance

Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect

2009-05-26 Thread Alex Kac
YES! I've been missing that for a long time. Couldn't put my finger on it until you said it. Bugreporter.apple.com time. On May 26, 2009, at 6:28 PM, Mark Allan wrote: FWIW, I initially came from a Java background and something I still really miss from the JavaDoc style API documentation is

Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect

2009-05-26 Thread Mark Allan
I had the same problems with AppKiDo and eventually went back to Apple's online docs too. They're definitely the most up-to-date version you're going to find anywhere, and when you've got your own way of using it, it works really well. I tend to keep the main framework reference pages ope

Re: NULL Outlets in one file work in another

2009-05-26 Thread Andy Lee
I don't have time to go into detail, but I think you need to understand what happens when nibs are loaded and how that's different from instantiating an object with alloc/init. On May 26, 2009, at 11:26 AM, Walker Argendeli wrote: Typos on my part It's applicationDidFinishLaunching: That de

Re: Class Design for delegate, outlets, and mouse events

2009-05-26 Thread Shlok Datye
To determine whether the app is launching for the first time, you can put a boolean called "firstLaunch" into the user defaults. It would have a factory default of YES and could be changed to NO inside of applicationDidFinishLaunching:. As for the buttons, are you sure you want to detect mo

Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect

2009-05-26 Thread WT
I too tried AppKiDo and eventually went back to XCode's built-in documentation tool. My only peeve with XCode's doc tool is that copying and pasting code from the doc pages sometimes introduces non- ascii characters onto my source files. I use an external editor (BBEdit), rather than XCode's

Re: Reading an AliasHandle from a Finder alias file

2009-05-26 Thread Greg Guerin
Erg Consultant wrote: FSFollowFinderAlias kind of does what I want, but not really. Then please explain what you really want to do, and why FSFollowFinderAlias doesn't meet those needs. Be specific. If I read the entire data fork of a Finder alias will the read data be a valid AliasRe

Re: Reading an AliasHandle from a Finder alias file

2009-05-26 Thread Sean McBride
On 5/26/09 2:13 PM, Erg Consultant said: >Is there a way to read AliasHandle data from an OS X Finder alias file - >sort of like the way one could create an AliasHandle in memory in the >old days by reading a alias resource from OS 9 alias files? > >The Alias Manager APIs only seem to provide rout

Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect

2009-05-26 Thread Nathan
I used to have the same issue, and AppKiDo was recommended to me as well. But it's not built into Xcode like Apple's stuff, and it doesn't recieve doc changes instantly. Plus, it takes a little while to load which is always annoying. I went back to Apple's stuff and found that after awhile

Reading an AliasHandle from a Finder alias file

2009-05-26 Thread Erg Consultant
Is there a way to read AliasHandle data from an OS X Finder alias file - sort of like the way one could create an AliasHandle in memory in the old days by reading a alias resource from OS 9 alias files? The Alias Manager APIs only seem to provide routines for determining if a file is an alias,

Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect

2009-05-26 Thread David LeBer
On 26-May-09, at 4:48 PM, colo wrote: I want to really get Cocoa and iphone methods etc... so I find myself in the Docs every other minute. But I find that it's kinda wonky to see where things subclass from or what goes with what as examples. I know there was some sort of guide to navigating it

Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect

2009-05-26 Thread jonat...@mugginsoft.com
On 26 May 2009, at 21:48, colo wrote: I want to really get Cocoa and iphone methods etc... so I find myself in the Docs every other minute. But I find that it's kinda wonky to see where things subclass from or what goes with what as examples. I know there was some sort of guide to navigating it

Bound NSPopUpButton + null at the beginning

2009-05-26 Thread Stamenkovic Florijan
Hi all, I am trying to figure out how to properly accomplish the following, and after reading docs, references and googling, I am still stuck. Any help appreciated: 1. Have an NSPopUp, "Contents" and "Content values" bound to an NSArrayController's "arrangedObjects" and "arrangedObjects.

Class Design for delegate, outlets, and mouse events

2009-05-26 Thread Walker Argendeli
Here's a simplification: I have an application with several buttons. If it is the first time the application is launching, I want to do some special things. In my AppController class, which is a delegate of NSApp, I use the delegate method -applicationDidFinishLaunching: to perform the test

Recommendations to Reading the Xcode in built Documentation to the fullest effect

2009-05-26 Thread colo
I want to really get Cocoa and iphone methods etc... so I find myself in the Docs every other minute. But I find that it's kinda wonky to see where things subclass from or what goes with what as examples. I know there was some sort of guide to navigating it and learning from it better. Do you know

[Moderator] Re: [OT] default boot device

2009-05-26 Thread Scott Anguish
Please, do _not_ post Off-Topic messages to this list. Prefixing a message with [OT] should be an IMMEDIATE indicator that it should not be posted here. moderator On 2009-05-26, at 9:43 AM, Тимофей Даньшин wrote: Hello. I installed another version of MacOS X in a separate partition of my

Re: Adding a Timer to a Thread

2009-05-26 Thread Andreas Grosam
On May 26, 2009, at 8:53 PM, Ken Thomases wrote: On May 26, 2009, at 1:27 PM, Jean-Daniel Dupas wrote: Le 26 mai 09 à 20:15, Andreas Grosam a écrit : What would you suggest is the preferred way to add a timer to a different running thread? Normally, I would use: NSRunLoop *runLoop

Re: what am I missing with NSString ?

2009-05-26 Thread Jeffrey Oleander
> On Tue, 2009/05/26, Volker in Lists wrote: > From: Volker in Lists > Subject: Re: what am I missing with NSString ? > To: "vinai" > Cc: Cocoa-dev@lists.apple.com > Date: Tuesday, 2009 May 26, 08:41 > from the code listed I cannot tell if you alloc'ed memory > for your NSString at all? > > Wh

Re: Adding a Timer to a Thread

2009-05-26 Thread Ken Thomases
On May 26, 2009, at 1:27 PM, Jean-Daniel Dupas wrote: Le 26 mai 09 à 20:15, Andreas Grosam a écrit : What would you suggest is the preferred way to add a timer to a different running thread? Normally, I would use: NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; [runLoop addTimer:a

Re: Threads and retain/release

2009-05-26 Thread Dave DeLong
DOH! Funny thing is, I read that sentence a couple days ago in the docs, but only registered the "retains the ... argument" bit at the time (because that's what I was looking for). You're right. That makes everything *much* simpler. Lesson learned... again... when in doubt, read the document

Call for submissions for a forthcoming book

2009-05-26 Thread Mike Mangino
Hi everyone, I cleared this message with the list owners. If you are interested in submitting a response, please send it to submissions@ iphonerecipesbook.com. Please DO NOT reply to the list. In just over a year since the iPhone API was released, we’ve seen some incredible applications c

Re: Adding a Timer to a Thread

2009-05-26 Thread Jean-Daniel Dupas
Le 26 mai 09 à 20:15, Andreas Grosam a écrit : What would you suggest is the preferred way to add a timer to a different running thread? Normally, I would use: NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; [runLoop addTimer:aTimer forMode:NSDefaultRunLoopMode]; However, this r

Adding a Timer to a Thread

2009-05-26 Thread Andreas Grosam
What would you suggest is the preferred way to add a timer to a different running thread? Normally, I would use: NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; [runLoop addTimer:aTimer forMode:NSDefaultRunLoopMode]; However, this requires that it will be invoked from the context

Re: How to safely break read stream?

2009-05-26 Thread Greg Guerin
Chris Gardner wrote: Firstly, I will close the CFReadStream with CFReadStreamClose. Secondly, I will use a new CFReadStream, and perform all the same setup as I did before to download the same file, meanwhile I am using kCFStreamPropertyFTPFileTransferOffset to offset the length of file dat

Re: NSPredicateEditorRowTemplate, NSPopupButton and bindings

2009-05-26 Thread Peter Ammon
Hi Martin, Yes, that's right. More generally, any changes to the popups after calling setRowTemplates: are likely to be futile. This is because the real popup buttons displayed in an NSPredicateEditor are not the same popup buttons returned from your NSPredicateEditorRowTemplate's - temp

Re: String Comparison and return values

2009-05-26 Thread Shawn Erickson
On Tue, May 26, 2009 at 9:56 AM, Kirk Kerekes wrote: > Consider the pattern: > > [[thing description] isEqualToString: someString]; > > All objects will return a string for description. Whether it is meaningful > in your terms is a whole other issue. > > NSNumber will return a sensible numeric str

[ANN] CocoaHeads Paris #3 - 27th of May (tomorrow)

2009-05-26 Thread Guillaume Cerquant
Hi, A quick note to let you know that the third session of CocoaHeads Paris will meet tomorrow (wednesday, 27th of May, at 7pm). Presentations will be: * FScript, by its creator, Philippe Mougin www.fscript.org * Osculator, a software for making sound and vision with new controllers www.osc

Re: Displaying a number with Quartz

2009-05-26 Thread Ken Thomases
On May 26, 2009, at 11:58 AM, Pierre Berloquin wrote: Yes you are right, we work with limited memory and I should be release minded and watch my variables. But didn't I read somewhere an advice against oneliners to skip the releases? It's a trade-off of best efficiency vs. developer conveni

Re: How to draw background image in my app window

2009-05-26 Thread Nick Zitzmann
On May 26, 2009, at 11:04 AM, cocoa learner wrote: How to draw background image in my app window? You could change the window's content view using -setContentView: to a view that will draw a background image, such as NSImageView... Of course, if you have any other controls in the content

Re: Displaying a number with Quartz

2009-05-26 Thread Gunnar Proppe
Actually, your pure Objective C version would be to use NSString's drawAtPoint:withAttributes instead of converting to a char* and using CGContextShowTextAtPoint. http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSString_AppKitAdditions/Reference/Reference.html G

Re: NULL Outlets in one file work in another

2009-05-26 Thread Greg Guerin
I wrote: If they are in App_Delegate, is IB connecting to those, or is it connecting to ones in App_Delegate? but meant to write: If they are in App_Delegate, is IB connecting to those, or is it connecting to ones in FirstLaunch? -- GG ___

How to draw background image in my app window

2009-05-26 Thread cocoa learner
Hi all, How to draw background image in my app window? I have found a way but not sure whether that's correct. So here is my way of doing - 1>. Get a window from IB Library. 2>. Drag NSImage item from IB Library on window. 3>. Make it the size of window. 4>. Now drag and drop the NSTextField to t

Re: Displaying a number with Quartz

2009-05-26 Thread Pierre Berloquin
Yes you are right, we work with limited memory and I should be release minded and watch my variables. But didn't I read somewhere an advice against oneliners to skip the releases? Pierre 2009/5/26 Ken Thomases > On May 26, 2009, at 11:13 AM, Pierre Berloquin wrote: > > Finally, thanks to Alexan

Re: String Comparison and return values

2009-05-26 Thread Kirk Kerekes
Consider the pattern: [[thing description] isEqualToString: someString]; All objects will return a string for description. Whether it is meaningful in your terms is a whole other issue. NSNumber will return a sensible numeric string. NSString will return itself. Generally, property-list obj

Re: Displaying a number with Quartz

2009-05-26 Thread Ken Thomases
On May 26, 2009, at 11:13 AM, Pierre Berloquin wrote: Finally, thanks to Alexander, my pure Objective C solution is NSString *S = [[NSString alloc] initWithFormat:@"%i", i]; const char *text = [S UTF8String]; Don't forget, after you're through with S: [S release]; Or, you could use

Re: NULL Outlets in one file work in another

2009-05-26 Thread Greg Guerin
Walker Argendeli wrote: So in App_Delegate's applicationDidFInishLaunching method, I have something that looks like this: [self doStuff]; FirstLaunch *thing = [[FirstLaunch alloc] init]; [thing doStuff]; And either the first line is commented out or the last two are commented out. The method

Re: Displaying a number with Quartz

2009-05-26 Thread Pierre Berloquin
Finally, thanks to Alexander, my pure Objective C solution is NSString *S = [[NSString alloc] initWithFormat:@"%i", i]; const char *text = [S UTF8String]; and no warning this time except that I should learn more about C Thanks Pierre 2009/5/26 Sean McBride > On 5/26/09 5:12 PM, Alexander Spohr

What information does NSFont -description convey?

2009-05-26 Thread Ross Carter
NSFont -description returns a string like this: "HoeflerText-Regular 12.00 pt. P [] (0x012c18d0) fobj=0x0133bdf0, spc=3.00"; The first two items are obvious. What's in the rest of the string? Thanks, Ross ___ Cocoa-dev mailing list (Cocoa-dev@list

Re: System Preference like App

2009-05-26 Thread cocoa learner
Yha Uli. That's what I have also experienced.But what kind of cell? That's I have not yet figured out. Probably I need some more time to get that knowledge. :-) I am really thankful for your help. Cocoa.learner On Sun, May 24, 2009 at 9:13 PM, Uli Kusterer wrote: > On 24.05.2009, at 16:22, coco

Re: NSWindow in threads

2009-05-26 Thread Michael Ash
On Tue, May 26, 2009 at 10:51 AM, Joar Wingfors wrote: > Your comment is correct in general, but according to the thread safety > guidelines you're supposed to be able to create windows on background > threads: > >

Re: [OT] default boot device

2009-05-26 Thread M Pulis
become familiar with system preferences. learn the mac before programming the mac. Sent from my iPhone On May 26, 2009, at 6:43 AM, Тимофей Даньшин wrote: Hello. I installed another version of MacOS X in a separate partition of my hard disc. And now whenever i start the computer, it bo

Re: Displaying a number with Quartz

2009-05-26 Thread Alexander Spohr
Am 26.05.2009 um 17:00 schrieb Sean McBride: Never ever use sprintf for anything. If you use "%d" and know it will be an int? You know how many chars you’ll have at max, no buffer-overflow possible. (You might argue here, that at some time we will habe 128-bit ints, but hey you should re

Re: Core data, bindings and multiple view NIBs

2009-05-26 Thread Keary Suska
On May 26, 2009, at 5:21 AM, Tomaž Kragelj wrote: I'm (again) banging my head with a single window, multiple views app using core data. Each of my view is implemented within it's own NIB and handled by a NSViewController subclass. The views share the same data from the same MOC. Using the f

Re: Threads and retain/release

2009-05-26 Thread Michael Ash
On Tue, May 26, 2009 at 10:41 AM, Dave DeLong wrote: > All of this works fine.  My question has to do with memory management and > thread cleanup. I'm snipping out most of your message because I think that all will make sense once you know this one fact: NSThread retains the target and argument

Threads and retain/release

2009-05-26 Thread Dave DeLong
Hey everyone, I'm working on an app that needs to work on 10.4 and is multi-threaded. One of the nice things about 10.5 is the ability to create NSThread objects in ways other than [NSThread detachNewThreadSelector...]; Since that option isn't available to me, here's what I've decided to do:

Re: NSWindow in threads

2009-05-26 Thread Mike Abdullah
On 26 May 2009, at 15:51, Joar Wingfors wrote: On 26 maj 2009, at 07.27, Mike Abdullah wrote: You've missed the big warning somewhere in the docs that most of AppKit is not threadsafe. Why do you want to create a window on another thread? What is wrong with doing it on the main thread?

Re: NSWindow in threads

2009-05-26 Thread Joar Wingfors
On 26 maj 2009, at 07.27, Mike Abdullah wrote: You've missed the big warning somewhere in the docs that most of AppKit is not threadsafe. Why do you want to create a window on another thread? What is wrong with doing it on the main thread? Mike, Your comment is correct in general, but ac

Re: How to check whether a application is launch or not...?

2009-05-26 Thread Michael Ash
On Tue, May 26, 2009 at 7:33 AM, Anshul jain wrote: > HI All, >                At the starting of my application i am trying to find out > whether Time machine is launched or not. I tried to use NSWorkSpace API >  launchedApplications >             but i get every application that is launched exce

Re: [OT] default boot device

2009-05-26 Thread I. Savant
2009/5/26 Тимофей Даньшин : > I installed another version of MacOS X in a separate partition of my hard > disc. And now whenever i start the computer, it boots from that partition by > default (unless i press option to select the partition to boot from this > time). How can i permanently change th

Re: Displaying a number with Quartz

2009-05-26 Thread Sean McBride
On 5/26/09 5:12 PM, Alexander Spohr said: >> Never ever use sprintf for anything. > >If you use "%d" and know it will be an int? You know how many chars >you'll have at max, no buffer-overflow possible. (You might argue >here, that at some time we will habe 128-bit ints, but hey you should >recode

Re: NSWindow in threads

2009-05-26 Thread Joar Wingfors
On 26 maj 2009, at 08.03, Mike Abdullah wrote: Wow, I had no idea of this particular aspect of the rules. My suspicion is this exists to accomodate Cocoa's ability to use window objects for caching a view's contents to an image. Maybe the act of showing a window is what is breaking on a se

Re: what am I missing with NSString ?

2009-05-26 Thread vinai
Hi All, Thanks so much to Micheal, Volker, and esp. to Ken for the pointer/object refresher. I think my mistake came from thinking that NSString's initWithString method did memory allocation as well, and would create a new object in one swell foop. ;-) From my own trials and failures, and f

Re: Displaying a number with Quartz

2009-05-26 Thread Sean McBride
Never ever use sprintf for anything. See here for why: On 5/26/09 3:26 PM, Alexander Spohr said: >sprintf > > > >Am 25.05.2009 um 09:16 schrieb P

Re: NULL Outlets in one file work in another

2009-05-26 Thread Volker in Lists
Hi, are you using - (void)applicationDidFinishLaunch:(NSNotification *)aNotification or - (void)applicationDidFinishLaunching: (NSNotification *)aNotification ? The first is not a valid delegate method, the second is. Have you connected your AppDelegate as delegate of your app - can it rec

Re: Threads and retain/release

2009-05-26 Thread Dave DeLong
DOH! Funny thing is, I read that sentence a couple days ago in the docs, but only registered the "retains the ... argument" bit at the time (because that's what I was looking for). You're right. That makes everything *much* simpler. Lesson learned... again... when in doubt, read the documenta

Re: NULL Outlets in one file work in another

2009-05-26 Thread Walker Argendeli
Typos on my part It's applicationDidFinishLaunching: That delegate method is in the file App_Delegate.m, which is the App_Delegate file. The App_Delegate file is a delegate of the app. Basically, I have some code working with outlets. If I put it as a method in App_Delegate, it works. I call

Re: warning 'NSEvent' may not respond to '+eventWithEventRef:'

2009-05-26 Thread Bill Cheeseman
I sent this reply to Ken but neglected to send it to the list. On May 26, 2009, at 12:52 AM, Ken Tozier wrote: 'm getting a warning when calling NSEvent's eventWithEventRef NSEvent *event = [NSEvent eventWithEventRef: ref]; I include Appkit and Carbon in the file where this warning appears

Re: NSWindow in threads

2009-05-26 Thread Mike Abdullah
You've missed the big warning somewhere in the docs that most of AppKit is not threadsafe. Why do you want to create a window on another thread? What is wrong with doing it on the main thread? On 26 May 2009, at 10:51, Mattias Jansson wrote: I'm trying to create a window from code in a thr

Re: [OT] default boot device

2009-05-26 Thread Jean-Daniel Dupas
Le 26 mai 09 à 15:43, Тимофей Даньшин a écrit : Hello. I installed another version of MacOS X in a separate partition of my hard disc. And now whenever i start the computer, it boots from that partition by default (unless i press option to select the partition to boot from this time). How

NULL Outlets in one file work in another

2009-05-26 Thread Walker Argendeli
I have a App_Delegate file. In applicationDidFinishLaunch:, I instantiate a FirstLaunch object and call its start method. The weird thing is that this method, which access several IBOutlets, seems to be working with null outlets. All the connections are right in IB, and yet the outlets a

Re: what am I missing with NSString ?

2009-05-26 Thread Ken Thomases
On May 26, 2009, at 8:33 AM, vinai wrote: I think I am missing something really basic here with NSString. Actually, it seems you're missing stuff much more basic than that. You seem to not understand the difference between a pointer and an object (which a pointer might point to). if

Core Animation faulty behaviour?

2009-05-26 Thread Boris Prohaska
Hi guys... i'm new to Core Animation. What i want is a simple dissolve between two images. In the Code below you can see what i'm doing. //self = a NSButton subclass recordButton = [CALayer layer]; [self setWantsLayer:YES]; [self.layer addSublaye

[OT] default boot device

2009-05-26 Thread Тимофей Даньшин
Hello. I installed another version of MacOS X in a separate partition of my hard disc. And now whenever i start the computer, it boots from that partition by default (unless i press option to select the partition to boot from this time). How can i permanently change the primary boot device

Re: what am I missing with NSString ?

2009-05-26 Thread Volker in Lists
Hi, from the code listed I cannot tell if you alloc'ed memory for your NSString at all? What is the goal you try to achieve? If you just want to store a single file path... with a global NSString do as along the lines of: [rawFileName release]; rawFileName = [[NSString alloc] initWithStri

Re: what am I missing with NSString ?

2009-05-26 Thread Michael Vannorsdel
rawFileName = [[NSString alloc] initWithString:[[files objectAtIndex:i] stringByStandardizingPath]]; Be sure to release rawFileName before you replace it with a new path. On May 26, 2009, at 7:33 AM, vinai wrote: think I am missing something really basic here with NSString. I am trying to

Re: Displaying a number with Quartz

2009-05-26 Thread Michael Vannorsdel
NSString's stringWithFormat:, or using sprintf/asprintf with the %d format: char * str; if(asprintf(&str, "%d", intval) < 0) //error CGContextShowTextAtPoint... free(str); or if you know the possible max size of the text: char strbuffer[MAX]; if(snprintf(strbuffer, MAX, "%d", intv

what am I missing with NSString ?

2009-05-26 Thread vinai
Hi Folks, I think I am missing something really basic here with NSString. I am trying to store the path of a user-selected file (from an NSOpenPanel) internally so other routines can act on the data within the file. Here's the relevant section of code: if ([oPanel runModalForDirectory:n

Re: Displaying a number with Quartz

2009-05-26 Thread Alexander Spohr
sprintf Am 25.05.2009 um 09:16 schrieb Pierre Berloquin: Hi I need to display an int with CGContextShowTextAtPoint that only accepts char arrays. How do I go about it ? I can't find how to convert an int into a char* in objective-C !! Thanks Pierre __

Re: String Comparison and return values

2009-05-26 Thread Rainer Brockerhoff
At 01:06 -0700 26/05/09, cocoa-dev-requ...@lists.apple.com wrote: >From: Thomas Davie >To: John Ku >References: > <298ad53c-ec5e-4519-bbba-61a13ca9c...@bigpond.com> > > > <7e0b7c90-a346-431f-8220-c8eccafd9...@mac.com> > >In-Reply-To: >Date: Tue, 26 May 2009 10:0

NSWindow in threads

2009-05-26 Thread Mattias Jansson
I'm trying to create a window from code in a thread created with NSThread detachNewThreadSelector:toTarget:withObject The main thread simply calls NSApplicationMain The window is created with [[NSWindow alloc] initWithContentRect:rect styleMask:(NSTitledWindowMask|NSClosableWindowMask|NSMini

Re: Underlining a Tab item label

2009-05-26 Thread Shlok Datye
You can subclass NSTabViewItem, override its drawLabel:inRect:, and put your custom drawing code there. Shlok Datye Coding Turtle http://codingturtle.com On 25.05.2009, at 18:41, David Alter wrote: With NSTabView I can set the font of the NSTabViewItem label. Is there a way to make it unde

Displaying a number with Quartz

2009-05-26 Thread Pierre Berloquin
Hi I need to display an int with CGContextShowTextAtPoint that only accepts char arrays. How do I go about it ? I can't find how to convert an int into a char* in objective-C !! Thanks Pierre ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

How to check whether a application is launch or not...?

2009-05-26 Thread Anshul jain
HI All, At the starting of my application i am trying to find out whether Time machine is launched or not. I tried to use NSWorkSpace API launchedApplications but i get every application that is launched except Time Machine. Is there a Problem in my approach. or

Re: How to safely break read stream?

2009-05-26 Thread Christian Weykopf
Am 26.05.2009 um 05:51 schrieb Chris Gardner: To: cocoa-dev@lists.apple.com From: glgue...@amug.org Date: Mon, 25 May 2009 10:46:40 -0700 Subject: Re: How to safely break read stream? Chris Gardner wrote: I create a read stream with CFReadStreamOpen(), but I don't know how to safely break

How to check whether a application is launch or not...?

2009-05-26 Thread Anshul jain
HI All, At the starting of my application i am trying to find out whether Time machine is launched or not. I tried to use NSWorkSpace API launchedApplications but i get every application that is launched except Time Machine. Is there a Problem in my approach. or

Core data, bindings and multiple view NIBs

2009-05-26 Thread Tomaž Kragelj
Hi all I'm (again) banging my head with a single window, multiple views app using core data. Each of my view is implemented within it's own NIB and handled by a NSViewController subclass. The views share the same data from the same MOC. Using the following core data model I cannot bind th

RE: How to use CFReadStrem and abort read stream normally?

2009-05-26 Thread Chris Gardner
Hi peter, I have read the docs ,and when stopping the read stream, I do use the functions, as your said,below CFReadStreamUnscheduleFromRunLoop(myStream, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); CFReadStreamClose(myStream); CFRelease(myStream); According to the docs, it can be safely stop

RE: How to safely break read stream?

2009-05-26 Thread Chris Gardner
Hi GG, Thanks for your reply. > When you say "resuming to connect the same file", do you mean you're > trying to reopen the same CFReadStream that was created earlier and > subsequently closed? > > If that's what you're doing, then it won't work. Refer to the docs > for CFReadStream: > >

Re: How to use CFReadStrem and abort read stream normally?

2009-05-26 Thread Peter Blazejewicz
Hello Chris, On May 22, 2009, at 5:10 AM, Chris Gardner wrote: Hi, I have already read through CFReadStream archives, and still have trouble with it. After CFReadStreamOpen() has been implement and its status is kCFStreamEventHasBytesAvailable, so I can read data from the source.Of course,

Re: [announce] A Core Data tutorial

2009-05-26 Thread Mic Pringle
Hi Mike, I really enjoyed reading this article. Any ideas on when part 2 will be available ? Cheers -Mic 2009/5/22 Michael Swan : > Just finished the first in a series of tutorials that takes a Core Data app > from beginning to end including things like icons, and serial numbers. > > http://the

Re: String Comparison and return values

2009-05-26 Thread John Ku
Yeah, it seems that the problem exist between chair and keyboard. Just starting, so I thought I could use NSString for everything. :) Need to pay attention to types more! Thanks, John On Tue, May 26, 2009 at 1:10 AM, Jelle De Laender < maill...@codingmammoth.com> wrote: > A NSNumber has a 'stri

Re: String Comparison and return values

2009-05-26 Thread Jelle De Laender
A NSNumber has a 'stringValue' method, but I don't know why you want to compare them at String-level. Jelle, On 26 May 2009, at 10:07, John Ku wrote: That seems to make sense to use NSNumber instead of NSString, thanks it works! But I would think NSString would accept the return numbers a

Re: String Comparison and return values

2009-05-26 Thread John Ku
Ahhh, that's a really great tip! Thanks!!Would come in really handy! On Tue, May 26, 2009 at 1:04 AM, Thomas Davie wrote: > > Op 26 May 2009, om 09:56 heeft John Ku het volgende geschreven: > > Oh so the very first return value from a Dictionary is not actually a >> string? >> NSString *itemA =

Re: String Comparison and return values

2009-05-26 Thread John Ku
That seems to make sense to use NSNumber instead of NSString, thanks it works! But I would think NSString would accept the return numbers as string and compare them at the string level, it should work in theory no? But NSNumber - isEqualToNumber works great! Thanks! On Tue, May 26, 2009 at 12:57

  1   2   >