What is [NSTextStorage fontSetChanged]?

2008-03-12 Thread 慧 松本
On Leopard, my editor application sometimes receives the fontSetChanged notification when it was turned to the front application. But I don't set my application as an observer of NSFontSetChangedNotification explicitly. The notification invokes [NSTextStorage fontSetChanged] as below and

Re: NSURLDownload and userInfo

2008-03-12 Thread Trygve Inda
> Hi, > Oh, sorry, replace everything in that message with NSURLDownload, same > idea. > I agree with your original approach, especially if you just need to > store an int (or an NSNumber in this case). > > There is a reason almost every delegate method in Cocoa passes the > delegate object as a p

NSPersistentDocument Tutorial

2008-03-12 Thread Ian Jackson
I was happily plugging through the NSPersistentDocument Tutorial, when I got to the "Creating a Custom Class" chapter. The first strange thing is that when I created the files, the next instruction is to change the class name for the Employee entity from NSManagedObject to Employee, but thi

Setting the badgeValue in ToolbarItem in ViewController file.

2008-03-12 Thread Benjamin Ortuzar Seconde
Hi guys, Im new to Cocoa development and Obj-C development, and I need a little help to set up the ToolbarItem property badgeValue. I was able to set the Title, Image and ImageSelected for the ToolbarItem successfully, but for some reason i cant see on the screen the badgeValue. This is how i set

Re: NSPersistentDocument Tutorial

2008-03-12 Thread Adam P Jenkins
On Mar 12, 2008, at 5:15 AM, Ian Jackson wrote: I was happily plugging through the NSPersistentDocument Tutorial, when I got to the "Creating a Custom Class" chapter. The first strange thing is that when I created the files, the next instruction is to change the class name for the Employee

Clean NSWindowController / NSObjectController architecture

2008-03-12 Thread Pierre DOUCY
Hi all, I have a core data, document-based app, in which a document consists in a main window displaying a list. Clicking an item on this list opens a new window (B) with some details specific to the clicked item. To open window B, I do the following : I instantiate a custom subclass of NSW

Re: Setting the badgeValue in ToolbarItem in ViewController file.

2008-03-12 Thread Kyle Sluder
On Wed, Mar 12, 2008 at 7:33 AM, Benjamin Ortuzar Seconde <[EMAIL PROTECTED]> wrote: > Hi guys, > Im new to Cocoa development and Obj-C development, and I need a little help > to set up the ToolbarItem property badgeValue. I was able to set the Title, > Image and ImageSelected for the ToolbarIte

runtime error

2008-03-12 Thread Daniel Child
In the process of parsing thousands and thousands of records and placing (most of) them in a table which I want to save to disk, I get this error: LSC Data Preparation(1097,0xa000ed88) malloc: *** vm_allocate (size=1069056) failed (error code=3) LSC Data Preparation(1097,0xa000ed88) malloc:

Re: runtime error

2008-03-12 Thread Matt Gough
Some points of interest: 1. vm_allocate(size=1069056) - Is each of your 'thousands and thousands of records' this large? If so then it is no wonder that you will run out of address space after a couple of thousand (on 32-bit) 2. If not, then after you have parsed each record, are you sure

Re: Controlling line tightening

2008-03-12 Thread glenn andreas
On Mar 11, 2008, at 9:54 PM, John Stiles wrote: Gah, I spoke too soon. This "solution" actually disables tightening entirely. So I'm back to square one. Please help! You could try to manually squeeze the result by setting an attributed string's NSKernAttributeName value, but that would b

Clean NSWindowController / NSObjectController architecture

2008-03-12 Thread Pierre DOUCY
Hi all, I have a core data, document-based app, in which a document consists in a main window displaying a list. Clicking an item on this list opens a new window (B) with some details specific to the clicked item. To open window B, I do the following : I instantiate a custom subclass of NSW

Re: NSTableView + delete button?

2008-03-12 Thread Sean McBride
On 3/11/08 8:47 PM, Kevin Dixon said: >I have implemented -keyDown as such > >if([theEvent type] == NSKeyDown) { > if([theEvent keyCode] == 51) { > //process 'delete' press > } >} > >to catch the pressing of delete on the NSTableView. This works, but >reminds me of BASIC.

Where are the system spellchecker prefs stored?

2008-03-12 Thread Davide Benini
Hello folks. Do you know where the system spellchecker language preferences are stored? I would like the access the spell checker and programatically change its "set" language. I thought I would find a plist, I've done a few spotlight searches, but no luck so far. Any help will be appreciat

Re: To unmount a volume

2008-03-12 Thread Nick Rogers
Using -[NSWorkspace unmountAndEjectDeviceAtPath:], I can only unmount my USB pen drive volume and not the volume in my secondary HDD. it returns "NO" in case of a volume on secondary HDD. please help. Regards, Nick On 11-Mar-08, at 11:02 PM, Randall Meadows wrote: On Mar 11, 2008, at 11:03

encoding objects containing NSData ivars using NSKeyedArchiver

2008-03-12 Thread Daniel Thorpe
Hello everyone! I'm trying to archive an object using NSKeyedArchiver. The object is question has quite a complex structure, and one of it's instance variables is an NSMutableData. I've tried using [coder encodeObject:result forKey:@"TchebichefMoment_momentData"]; which doesn't seem to do

Help with Bindings

2008-03-12 Thread development2
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com

Re: runtime error

2008-03-12 Thread Thomas Engelmeier
On 12.03.2008, at 14:34, Daniel Child wrote: >In the process of parsing thousands and thousands of records and placing (most of) them in a table which I want to save to disk, "Table you want to save to disk"? DUH? You know, I'm currently programming the thingy that interacts with the great

RE: Help with Bindings

2008-03-12 Thread development2
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com

Re: Help with Bindings

2008-03-12 Thread I. Savant
Are you going to actually ask a question, or keep posting and replying to blank messages? ;-) -- I.S. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators a

Re: Quit application when window closes

2008-03-12 Thread Joachim Deelen
You could use: - (void)windowWillClose:(NSNotification*)notification { [aboutWindow setDelegate:nil]; [NSApp terminate:self]; } Replace "aboutWindow", with your window. You could also use [NSApp stop:self] but terminate ends more gracefully... Am 12.03.2008 um 00:51 schrieb

Re: best time to alter GUIs

2008-03-12 Thread Daniel Child
On Mar 8, 2008, at 1:11 AM, Ken Thomases wrote: We can think of three stages of loading a window from a NIB and showing it: 1. Loading the NIB bundle's contents into memory 2. Unarchiving the NIB's contents and instantiating the object graph that was frozen within it 3. Showing the window

Re: Where are the system spellchecker prefs stored?

2008-03-12 Thread Douglas Davidson
On Mar 12, 2008, at 7:48 AM, Davide Benini wrote: Do you know where the system spellchecker language preferences are stored? I would like the access the spell checker and programatically change its "set" language. I thought I would find a plist, I've done a few spotlight searches, but no l

Help with Bindings

2008-03-12 Thread development2
(I hope this goes through this time, I have tried twice and this text would not go through) Iam hoping I can get some help here. I have not done any bindings yet asmost of the programs I have written over the last couple of years hadto support clear back to 10.2, so now I am done with that and I

Re: Controlling line tightening

2008-03-12 Thread John Stiles
Interesting! I didn't think to use kerning directly. Thank you for the idea!! It makes sense since obviously I am trying to do something a little more sophisticated than the default "tighten" functionality. How does "line tightening" pick an appropriate kerning value? I'm thinking you could us

Re: runtime error

2008-03-12 Thread John Stiles
You're running out of memory. If your inner loop isn't wrapped in an autorelease pool, consider adding one. Also, use Instruments to see where the memory is going. Daniel Child wrote: In the process of parsing thousands and thousands of records and placing (most of) them in a table which I wa

Re: Encoding NSString for URL

2008-03-12 Thread Jens Alfke
On 11 Mar '08, at 11:56 PM, JanakiRam wrote: I've used couple of methods ( one from cocoa - stringByAddingPercentEscapesUsingEncoding and another one from CoreFoundation CFURLCreateStringByAddingPercentEscapes) , but they are not encoding special characters such as @#$%&* etc. .

Re: NSURLDownload and userInfo

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 12:39 AM, Trygve Inda wrote: I am surprised NSURLDownload and NSURLRequest do not have userInfo ivars like many other Cocoa classes that do asynchronous operations (NSTimer for instance). Thanks for this. I too am surprised there is no userInfo in these classes and wanted t

BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
I need to get at the RGB pixel data of an image (with will be a jpg or png, tho probably a jpg) NSImage * image = [NSImage imageNamed:@"colorTest"]; NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]]; unsigned char * imageData = [imageRep b

Re: encoding objects containing NSData ivars using NSKeyedArchiver

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 7:44 AM, Daniel Thorpe wrote: I'm trying to archive an object using NSKeyedArchiver. The object is question has quite a complex structure, and one of it's instance variables is an NSMutableData. I've tried using [coder encodeObject:result forKey:@"TchebichefMoment_momentDa

NSAffineTransform & bezier path line widths

2008-03-12 Thread Shamyl Zakariya
I'm using an NSAffineTransform to scale and offset drawing a bezier path into a view. The bezier path *vertices* are correctly transformed. The oddity is that the line width sometimes is transformed, and sometimes isn't. Specifically, if the view is redrawn as a result of [self setNeedsDi

Re: BitMap data format and autorelease

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 9:09 AM, Trygve Inda wrote: NSImage * image = [NSImage imageNamed:@"colorTest"]; NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData: [image TIFFRepresentation]]; That will work, I think, but it's sort of inefficient, since it requires encoding an

Re: warning: assignment from distinct Objective-C type

2008-03-12 Thread Dennis C. De Mars
On Mar 11, 2008, at 3:59 PM, j o a r wrote: On Mar 11, 2008, at 3:49 PM, Quincey Morris wrote: Personally I prefer the factory method approach, a la [NSArray array] etc: Note that factory class methods typically also return id for the same reason that init methods return id (NSArray, N

Re: Working with large files and Memory

2008-03-12 Thread Scott Ribe
One more thing, if you can require 10.5, you can build a 64-bit app. You should *still* avoid unnecessary allocations, and likely read the file in chunks, to lower the amount of RAM your users will require in order to avoid too much VM swapping. -- Scott Ribe [EMAIL PROTECTED] http://www.killerb

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
> > On 12 Mar '08, at 9:09 AM, Trygve Inda wrote: > >> NSImage * image = [NSImage imageNamed:@"colorTest"]; >> NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData: >> [image >> TIFFRepresentation]]; > > That will work, I think, but it's sort of inefficient, since it > req

Re: Where are the system spellchecker prefs stored?

2008-03-12 Thread Davide Benini
I realized the question was not well put. Basically, I would like to switch the language of the spellchecker of the application in focus. I realize this might be tricky, and probably not doable... That's why I thought about modifying the plist of apps preferences; unless this preference is n

Re: Where are the system spellchecker prefs stored?

2008-03-12 Thread Douglas Davidson
On Mar 12, 2008, at 10:02 AM, Davide Benini wrote: I realized the question was not well put. Basically, I would like to switch the language of the spellchecker of the application in focus. I realize this might be tricky, and probably not doable... That's why I thought about modifying the

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
> > On 12 Mar '08, at 9:09 AM, Trygve Inda wrote: > >> NSImage * image = [NSImage imageNamed:@"colorTest"]; >> NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData: >> [image >> TIFFRepresentation]]; This comes from here: http://www.cocoadev.com/index.pl?NSBitMapImageRep

Re: Where are the system spellchecker prefs stored?

2008-03-12 Thread Douglas Davidson
On Mar 12, 2008, at 10:18 AM, Davide Benini wrote: I was planning to build a menulet to speed up switching language, which is kind of annoying, especially when you're writing in a couple of languages, switching all the time... I was actually wondering why no one had done such a menulet bef

Re: runtime error

2008-03-12 Thread Daniel Child
On Mar 12, 2008, at 12:00 PM, [EMAIL PROTECTED] wrote: Some points of interest: 1. vm_allocate(size=1069056) - Is each of your 'thousands and thousands of records' this large? If so then it is no wonder that you will run out of address space after a couple of thousand (on 32-bit) No. I build

Re: Where are the system spellchecker prefs stored?

2008-03-12 Thread John Stiles
Could you do it via the Accessibility APIs, perhaps? Davide Benini wrote: I see. I was planning to build a menulet to speed up switching language, which is kind of annoying, especially when you're writing in a couple of languages, switching all the time... I was actually wondering why no one

Re: Where are the system spellchecker prefs stored?

2008-03-12 Thread Davide Benini
I see. I was planning to build a menulet to speed up switching language, which is kind of annoying, especially when you're writing in a couple of languages, switching all the time... I was actually wondering why no one had done such a menulet before probably because it's not doable :)

Re: Cocoa-dev Digest, Vol 5, Issue 393

2008-03-12 Thread Daniel Child
Each record is allocated and explicitly released at the end of the loop after adding it to the table. I thought autorelease might wait too long to get rid of it, so I do it explicitly. As for Instruments, unfortunately I'm doing this on Tiger. On Mar 12, 2008, at 12:00 PM, [EMAIL PROTECTED]

Re: NSURLDownload and userInfo

2008-03-12 Thread Adam Leonard
Well, there are a few more places I see it used for delegate-like operations :) NSCachedURLResponse - also in WebKit NSTrackingArea NSEvent (called userData) NSBeginAlertSheet() (called contextInfo) So yeah, you are right it is not used everywhere, but I think it is used enough for it to be

memory warnings

2008-03-12 Thread Alexander Cohen
Is there any way to be notified when my app is running low on memory? My app is very memory intensive and needs to have a lot of images in memory at the same time, id like to be able to clear some cache if memory gets too low. thx AC ___ Cocoa-d

Re: Cocoa-dev Digest, Vol 5, Issue 393

2008-03-12 Thread John Stiles
Daniel Child wrote: Each record is allocated and explicitly released at the end of the loop after adding it to the table. I thought autorelease might wait too long to get rid of it, so I do it explicitly. Just because you never autorelease it in your code, doesn't mean that it is never autorele

Re: Cocoa-dev Digest, Vol 5, Issue 393

2008-03-12 Thread Nick Zitzmann
On Mar 12, 2008, at 11:35 AM, Daniel Child wrote: Each record is allocated and explicitly released at the end of the loop after adding it to the table. I thought autorelease might wait too long to get rid of it, so I do it explicitly. As for Instruments, unfortunately I'm doing this on Tig

Re: memory warnings

2008-03-12 Thread Nick Zitzmann
On Mar 12, 2008, at 11:40 AM, Alexander Cohen wrote: Is there any way to be notified when my app is running low on memory? Not really. My app is very memory intensive and needs to have a lot of images in memory at the same time, id like to be able to clear some cache if memory gets too l

Re: Setting the badgeValue in ToolbarItem in ViewController file.

2008-03-12 Thread Kyle Sluder
On Wed, Mar 12, 2008 at 10:34 AM, Benjamin Ortuzar Seconde <[EMAIL PROTECTED]> wrote: > Im trying to develop an Iphone app. Though it's still a bit confusing, iPhone discussion is not permitted on this list. Check back in the archives for the explanation form Scott Anguish (and the confusion that

Re: memory warnings

2008-03-12 Thread John Stiles
You can dive into BSD to get some values which might help you. vm_statisticsvmstats; mach_msg_type_number_t count; kern_return_t result = host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t) &vmstats, &count); uint64 freeMem= uint64(vmstats.free_count +

Re: memory warnings

2008-03-12 Thread Alexander Cohen
Thanks, ill look into this. Its much better than nothing. AC On 12-Mar-08, at 2:00 PM, John Stiles wrote: You can dive into BSD to get some values which might help you. vm_statisticsvmstats; mach_msg_type_number_t count; kern_return_t result = host_statistics(mach_host_se

Re: Controlling line tightening

2008-03-12 Thread John Stiles
Followup: this requires a bit of math but it works great in practice. I have a lot more control over the tightening now, which is just what I needed. Thanks! John Stiles wrote: Interesting! I didn't think to use kerning directly. Thank you for the idea!! It makes sense since obviously I am try

Re: Setting the badgeValue in ToolbarItem in ViewController file.

2008-03-12 Thread Benjamin Ortuzar Seconde
Hi Kyle, Very confusing indeed. I don't know where to talk about iphone development then. :( Maybe an IRC channel, or forum for us ? Thanks, ben On Wed, Mar 12, 2008 at 1:55 PM, Kyle Sluder < [EMAIL PROTECTED]> wrote: > On Wed, Mar 12, 2008 at 10:34 AM, Benjamin Ortuzar Seconde > <[EMAIL PROTEC

Re: Controlling line tightening

2008-03-12 Thread Aki Inoue
John, The tightening is controlled by -[NSParagraphStyle tighteningFactorForTruncation]. http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/Classes/NSParagraphStyle_Class/Reference/ Reference.html#//apple_ref/occ/instm/NSParagraphStyle/ tighteningFactorForTruncation

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
> Then you definitely want to create your own NSBitmapImageRep — the > init method will give you total control over the pixel format. Then > you can lockFocus and draw whatever you want into it. So I have created this: imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL

Re: Controlling line tightening

2008-03-12 Thread John Stiles
Right, we went over this a month or two ago. But in this case, I actually needed finer-grained control over the tightening—for instance, I didn't want an ellipsis when the tightening threshold is exceeded. Instead, when the tightening threshold is exceeded, I just want it to use the maximum tig

Mute System

2008-03-12 Thread Herr Thomas Bartelmess
Hi everyone, does somebody know, what i have to do to control the system Aduio Volume (mute, increase, decrease). I searched a lot, but without result thanks for your help Thomas ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do n

Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Nathan Vander Wilt
I am having trouble understanding how Core Animation geometry interacts with NSView geometry in a layer-hosting situation. I have an NSView that hosts a root layer, and it has two sublayers that I need the user to be able to drag each around. I want to be able to convert a mouse coordinate into a

Re: Mute System

2008-03-12 Thread I. Savant
On Wed, Mar 12, 2008 at 2:49 PM, Herr Thomas Bartelmess <[EMAIL PROTECTED]> wrote: > Hi everyone, does somebody know, > what i have to do to control the system Aduio Volume (mute, increase, > decrease). > > I searched a lot, but without result A quick Google search revealed this AppleScript:

Re: Mute System

2008-03-12 Thread Jean-Daniel Dupas
The easiest way is to use AppleScript (there is a get volume settings' and a 'set volume' command in StandardAdditions). The other way is to use CoreAudio. Le 12 mars 08 à 19:49, Herr Thomas Bartelmess a écrit : Hi everyone, does somebody know, what i have to do to control the system Aduio Vo

Re: memory warnings

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 11:00 AM, John Stiles wrote: You can dive into BSD to get some values which might help you. I'm not an expert on this, but I've listened in on email threads where OS X kernel engineers were giving answers. Trying to preflight memory allocations is, basically, not feasibl

Re: BitMap data format and autorelease

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 12:01 PM, Trygve Inda wrote: (1) draw an NSImage into this bitmap (2) draw some semi-opaque text over the bitmap As I said, call -lockFocus on the imagerep. Then issue drawing commands (just as though you were in a view's -drawRect: method). Then calll -unlockFocus. (

Re: Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 12:13 PM, Nathan Vander Wilt wrote: I want to be able to convert a mouse coordinate into a point suitable for -hitTest:'ing on my root layer. I can convert from the mouse coordinates to the view's coordinates, but then I am not sure how to proceed. There doesn't seem to be a

Re: runtime error

2008-03-12 Thread Daniel Child
I see your point now. Thanks. Putting in the pool enabled the application to complete parsing of the raw data. Unfortunately, the program now stops several minutes into the sorting operation (the large table has to be sorted). I'll look for a spot to place an autorelease pool, though I don'

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
> > On 12 Mar '08, at 12:01 PM, Trygve Inda wrote: > >> (1) draw an NSImage into this bitmap >> (2) draw some semi-opaque text over the bitmap > > As I said, call -lockFocus on the imagerep. Then issue drawing > commands (just as though you were in a view's -drawRect: method). Then > calll -unlo

Deleting a folder

2008-03-12 Thread Mr . Gecko
Hello I have been trying to find a way to delete a folder so when some one chooses replace in the save panel it would delete the folder before it recreates it. What is the easiest way of doing that? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.

Re: Deleting a folder

2008-03-12 Thread Randall Meadows
On Mar 12, 2008, at 2:42 PM, Mr.Gecko wrote: Hello I have been trying to find a way to delete a folder so when some one chooses replace in the save panel it would delete the folder before it recreates it. What is the easiest way of doing that? NSFileManager -removeFileAtPath:handler: _

Re: Quit application when window closes

2008-03-12 Thread Kyle Sluder
On Tue, Mar 11, 2008 at 6:22 AM, Felipe Monteiro de Carvalho <[EMAIL PROTECTED]> wrote: > How can I implement the behavior that the application closes when my > window closes? Please don't do this if you've got a document-based application. It's best for apps that display only one dialog, like

NSTimer and seg faults

2008-03-12 Thread Gregory Short
Howdy all, first-time poster here. I'm pretty new to Objective-C and it's associated run-time environment, so I apologize if this is a total newbie question that has been answered before (I couldn't find anything, but I might not know where to look.) My problem is this: I have an NSTimer wh

Re: BitMap data format and autorelease

2008-03-12 Thread Adam R. Maxwell
On Wednesday, March 12, 2008, at 01:26PM, "Trygve Inda" <[EMAIL PROTECTED]> wrote: >> >Is there a benefit to calling: > >image = [[NSImage alloc] initWithSize:NSMakeSize(width, height)]; >[image addRepresentation:imageRep]; > >Then using: > >[image lockFocusOnRepresentation:imageRep]; > >[image

Re: NSTimer and seg faults

2008-03-12 Thread Andrew Farmer
On 12 Mar 08, at 13:56, Gregory Short wrote: Howdy all, first-time poster here. I'm pretty new to Objective-C and it's associated run-time environment, so I apologize if this is a total newbie question that has been answered before (I couldn't find anything, but I might not know where to lo

Re: NSTimer and seg faults

2008-03-12 Thread Hamish Allan
Hi Gregory, The method [NSDate date] returns an autoreleased object, which has been dealloced by the time your NSTimer fires. I'd recommend reading the documentation on memory management, starting with: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html Best wi

Re: Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Quincey Morris
On Mar 12, 2008, at 13:13, Jens Alfke wrote: On 12 Mar '08, at 12:13 PM, Nathan Vander Wilt wrote: I want to be able to convert a mouse coordinate into a point suitable for -hitTest:'ing on my root layer. I can convert from the mouse coordinates to the view's coordinates, but then I am not su

Re: NSTimer and seg faults

2008-03-12 Thread Hank Heijink (Mailinglists)
You're getting an autoreleased date and autoreleased timer from the methods you call, but you're not retaining either your timer our your date, so they'll both be gone after you leave awakeFromNib. Read the memory management guide for how all this works:

Re: NSTimer and seg faults

2008-03-12 Thread Gregory Short
Thanks everyone! For the relevant documentation, solutions, and explanations. Hopefully next time my question will be a little tougher. ;) -G ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator com

Re: Controlling line tightening

2008-03-12 Thread John Stiles
BTW, I've just documented this limitation in Radar: rdar://5795937 AppKit string tightening should work with non-truncating line break modes This one is up to you—if you think it would be a useful addition, great; if not, I guess you can punt it as "Behaves Correctly" or something. John

Re: memory warnings

2008-03-12 Thread John Stiles
I'm sure what you say is true. If you try to allocate right up to the limit, yes, you will eventually hit failures. But knowing your heap is, say, 90% full is still pretty useful information. You can jettison stuff and try to reduce your footprint well before you reach "the wall." Jens Alfke w

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
Jens said: > As I said, call -lockFocus on the imagerep. Then issue drawing > commands (just as though you were in a view's -drawRect: method). Then > calll -unlockFocus. NSImageRep does not seem to allow lockFocus With Adam's method... Is there any reason I might want an NSImage? > [NSGraphics

Re: runtime error

2008-03-12 Thread John Stiles
I haven't used Tiger's ObjectAlloc in a while but I am pretty sure you can get stack crawls. If not, MallocDebug definitely supports this. Instruments can do stack crawls as well. Daniel Child wrote: I see your point now. Thanks. Putting in the pool enabled the application to complete parsing

Re: Encoding NSString for URL

2008-03-12 Thread Jerry Krinock
On 2008 Mar, 11, at 23:56, JanakiRam wrote: CFURLCreateStringByAddingPercentEscapes...not encoding special characters such as @#$%&* etc. CFURLCreateStringByAddingPercentEscapes only encodes the characters mentioned in RFC 2396, which is: All non-ASCII characters plus these fourteen: `

How does -drawPageBorderWithSize: place pageHeader?

2008-03-12 Thread Mike Wright
I have an app (Universal, compiled using XCode 2.5, running on an Intel iMac, under Leopard) that lets the user set page margins when printing. It also lets them specify the printing of headers and footers. The odd thing I'm seeing with this is that the placement of the pageHeader string va

Re: Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Nathan Vander Wilt
--- Quincey Morris <[EMAIL PROTECTED]> escribió: > On Mar 12, 2008, at 13:13, Jens Alfke wrote: > > > On 12 Mar '08, at 12:13 PM, Nathan Vander Wilt > wrote: > > > >> I want to be able to convert a mouse > >> coordinate into a point suitable for > -hitTest:'ing on > >> my root layer. I can convert

Re: NSTokenField bug in 10.5.2?

2008-03-12 Thread Tom Bunch
It looks like the answer here is that there's no great workaround. Linked against 10.4, NSTokenField will not preserve your whitespace. The delegate method: - (id)tokenField:(NSTokenField *)tokenField representedObjectForEditingString:(NSString *)editingString is not called with an edi

Re: Deleting a folder

2008-03-12 Thread Herr Thomas Bartelmess
unix command rm -r thomas Am 12.03.2008 um 21:42 schrieb Mr.Gecko: Hello I have been trying to find a way to delete a folder so when some one chooses replace in the save panel it would delete the folder before it recreates it. What is the easiest way of doing that? _

Re: Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Nathan Vander Wilt
> > CALayers don't have this bounds/frame distinction > > They do, actually. The bounds is the internal view > of the coordinate > system, and the frame is the external view. At first this sounded incorrect, because it's emphasized that frame is just a function of other propertiesbut I was

Re: Deleting a folder

2008-03-12 Thread John Stiles
This is pretty dangerous if you get it wrong (spaces in the path? quotes? weird control characters?). Also, it makes it extremely difficult to provide feedback if errors occur. I wouldn't take that route. Herr Thomas Bartelmess wrote: unix command rm -r thomas Am 12.03.2008 um 21:42 schrieb M

re: Deleting a folder

2008-03-12 Thread Mr. Gecko
I was going to do that but it is not internal I used NSFileManager - removeFileAtPath:handler: instead [[NSFileManager defaultManager] removeFileAtPath:@"/folder/" handler:nil]; On Mar 12, 2008, at 3:45 PM, Herr Thomas Bartelmess wrote: unix command rm -r thomas Am 12.03.2008 um 21:42 schrieb

Re: BitMap data format and autorelease

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 2:22 PM, Trygve Inda wrote: NSImageRep does not seem to allow lockFocus With Adam's method... Is there any reason I might want an NSImage? Sorry, my mistake. Probably the NSImage-less way is slightly better, as it might avoid some unnecessary caching of the image in displa

Re: Deleting a folder

2008-03-12 Thread Jean-Daniel Dupas
Le 12 mars 08 à 23:12, Mr. Gecko a écrit : I was going to do that but it is not internal I used NSFileManager - removeFileAtPath:handler: instead [[NSFileManager defaultManager] removeFileAtPath:@"/folder/" handler:nil]; On Mar 12, 2008, at 3:45 PM, Herr Thomas Bartelmess wrote: unix command

Re: Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 3:06 PM, Nathan Vander Wilt wrote: When one draws a rectangle in a CALayer delegate, and the -drawLayer:: concatenates (and/or sets?) its own transform before drawing, when the layer has a transform, and the root parent layer has both a transform and a sublayer transform, and

Re: warning: assignment from distinct Objective-C type

2008-03-12 Thread Keith Duncan
There's no reason why it can't be named "create..." and return a retained object, My personal preference is to use Create... for naming functions which return alloc/malloc memory, inline with the CoreFoundation memory management rules. I tend to use -(id)new... for methods, again for the

Adding several UIViews in random places of the screen at intervals

2008-03-12 Thread Benjamin Ortuzar Seconde
Hi guys, Im interested in finding a good way to display Views in different parts of the application at random times, so the user can interact with them. The application is supposed to be a game in which several creatures appear in different parts of the screen and u must click on them to kill them.

Re: Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Jens Alfke
On 12 Mar '08, at 2:49 PM, Nathan Vander Wilt wrote: I don't understand what this "base" coordinate system is (not the window's, otherwise the conversions would likely be offset by the view's position therein, right?). But whatever it is, it seems to be shared by the CALayer. The Cocoa Drawi

Ignore QTMovieView Inputs

2008-03-12 Thread Herr Thomas Bartelmess
Hello sorry for my constant asking... i have a QTMovieView. Is there a possibility to make is immune for mouseclicks, so that it can't be controled? Thanks for any help Thomas ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

Re: Mute System

2008-03-12 Thread Keith Duncan
what i have to do to control the system Aduio Volume (mute, increase, decrease). I use CoreAudio; AppleScript is too inefficient for my uses. static OSStatus GetDefaultAudioDevice(AudioDeviceID *device) { OSStatus status; UInt32 size; size = sizeof(*device); st

How to make a UI like in Mail?

2008-03-12 Thread Thomas Wickl
Hello, I´m new to Cocoa and I really need a hint in UI Design. How can I create this Panel like it is shown in a lot of Application like Mail? http://www.spongedpics.com/upload/WH1205339930W47d8071ae5a64-Panel.jpg And also how do they make this Bar at the Bottom? http://www.spongedpics.com/

Re: Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Quincey Morris
On Mar 12, 2008, at 14:49, Nathan Vander Wilt wrote: I don't understand what this "base" coordinate system is (not the window's, otherwise the conversions would likely be offset by the view's position therein, right?). But whatever it is, it seems to be shared by the CALayer. I'd appreciate a g

Ignore mouse in QTMovieView

2008-03-12 Thread Herr Thomas Bartelmess
Hello my problem is: i have a QTMovieView. Is there a possibility to make is immune for mouseclicks, so that it can't be controled? Thanks for any help Thomas ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin request

Re: Core Animation geometry, layer hosting, and resolution independence

2008-03-12 Thread Nathan Vander Wilt
--- Jens Alfke <[EMAIL PROTECTED]> escribió: > > On 12 Mar '08, at 2:49 PM, Nathan Vander Wilt wrote: > > > I don't understand what this "base" coordinate > system > > is (not the window's, otherwise the conversions > would > > likely be offset by the view's position therein, > > right?). But w

What is the status on the New Cocoa 2.0 Books?

2008-03-12 Thread colo
I know hillegass is doing one but has anyone a date on it ? And might there be others ? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admin

Re: best time to alter GUIs

2008-03-12 Thread Ken Thomases
On Mar 12, 2008, at 10:45 AM, Daniel Child wrote: On Mar 8, 2008, at 1:11 AM, Ken Thomases wrote: We can think of three stages of loading a window from a NIB and showing it: 1. Loading the NIB bundle's contents into memory 2. Unarchiving the NIB's contents and instantiating the object gra

  1   2   >