Re: [Q] copy operation and authorization

2009-11-13 Thread Jens Miltner
Am 13.11.2009 um 07:53 schrieb Jerry Krinock: On 2009 Nov 12, at 14:24, Kyle Sluder wrote: No. Do not do this. Follow the pattern of BetterAuthorizationSample: http://developer.apple.com/mac/library/samplecode/BetterAuthorizationSample/listing4.html Yes, what Kyle says is true. AEWP

Re: CGImageRef printing issue

2009-11-13 Thread Mirko Viviani
On 12/nov/2009, at 23.46, David Duncan wrote: Just like with all CGContexts you can apply a transform matrix to change the coordinate system. However in general this isn't necessary. If you want an image to display in a 1 x 1 area on screen, draw it into a 72x72 box. The pixel size of the

Re: [Q] copy operation and authorization

2009-11-13 Thread Dave Keck
As a user, I would become very suspicious if Finder suddenly requires me to authorize some copy operation just because I launched an app, or, even worse, because I took some action within an app... Absolutely - that's the point of the Details disclosure triangle in the authorization window: so

Re: Possible hardware-platform-dependent bug in NSTextView?!?

2009-11-13 Thread Jay Reynolds Freeman
I seem to have a fix for this one; at least, the person who originally reported the problem does not see it any more. But the situation is a little disturbing: On review of my code I find that perhaps scrollRangeToVisible doesn't always do what its name suggests, at least, not on all Macintoshes.

Re: NSXMLParser choking on single quotes

2009-11-13 Thread Ken Tozier
On Nov 12, 2009, at 11:04 AM, Matt Neuburg wrote: On Thu, 12 Nov 2009 12:08:20 + (UTC), kentoz...@comcast.net said: I'm using NSXMLParser to parse XML output from Microsoft Word and am finding that if a string contains a single quote, the parser is only giving me the part of the string

CPU sampling and +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]

2009-11-13 Thread Paulo Andrade
Hello, I'm sampling an iPhone app to detect any bottlenecks in performance. Interesting thing is that, from the first use of an NSURLConnection the following method will appear on Instruments: +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] And it's constantly running,

KVO cross dependencies

2009-11-13 Thread Half Activist
Hi all, I have sevral objects of different kind that observe values on each other. Now, when the objects are being released, I get an exception from the KVO stuff telling me that an object is being deallocated while still observed. And that's justified. Yet, the problem is in whatever

Re: KVO cross dependencies

2009-11-13 Thread Roland King
One option - use Garbage Collection under Snow Leopard, it does it all for you. If you can't do that. I assume, from the fact that your observed objects are being released at all that the observing objects are not retaining them (or keeping strong references if you are using Garbage

NSTableView and NSTextFieldCell redraw oddness when undo

2009-11-13 Thread jonat...@mugginsoft.com
I have a subclassed NSTextFieldCell to create a cell that draws outside of it's frame. This is to enable NSTableView rows to have one line of text that runs beneath several other cells. Bindings are utilised. This works fine except, curiously, when an operation is undone. In this case the cell

Re: NSTableView and NSTextFieldCell redraw oddness when undo

2009-11-13 Thread Corbin Dunn
On Nov 13, 2009, at 6:35 AM, jonat...@mugginsoft.com wrote: I have a subclassed NSTextFieldCell to create a cell that draws outside of it's frame. All the logic in tableview redraws things based on -frameOfCellAtColumn:row:. Things will frequently not get redrawn if you draw outside of

Printing panel issue

2009-11-13 Thread Mirko Viviani
Hi, in my application I have implemented a printing view like the one in the ImageApp example and it works like a charm apart a small thing in the Layout panel printing sheet. In 10.6.2 the Flip horizontally does not work, but Reverse page orientation does. In 10.5.7 Reverse page orientation

Re: NSTableView and NSTextFieldCell redraw oddness when undo

2009-11-13 Thread jonat...@mugginsoft.com
On 13 Nov 2009, at 15:15, Corbin Dunn wrote: On Nov 13, 2009, at 6:35 AM, jonat...@mugginsoft.com wrote: I have a subclassed NSTextFieldCell to create a cell that draws outside of it's frame. All the logic in tableview redraws things based on -frameOfCellAtColumn:row:. Things will

LSOpenFromURLSpec() returns -10825 on Tiger

2009-11-13 Thread Mirko Viviani
Hi, I have a problem building an application targeted to 10.4.10 and up. Launching the app with open I get: $ open /Applications/myapp.app ... LSOpenFromURLSpec() returned -10825 for application (null) urls file://localhost/Applications/myapp.app/. while launching the exe inside the

Re: CPU sampling and +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]

2009-11-13 Thread Joar Wingfors
On 13 nov 2009, at 04.36, Paulo Andrade wrote: I'm guessing that when using a NSURLConnection the framework spawns a new thread and creates a runloop for it, That sounds about right. I could also see that the framework might choose to keep this thread around after you've finished using it

NSPredicateEditorRowTemplate and dynamic popups

2009-11-13 Thread Dave DeLong
Hi everyone, I have an NSPredicateEditor, with some standard row templates. I'd like to add a custom row template with three views: a popup button (indicating the attributes this template references), a second popup button (with the operators), and a third popup button that's populated with

Re: CGImageRef printing issue

2009-11-13 Thread David Duncan
On Nov 13, 2009, at 1:27 AM, Mirko Viviani wrote: To be honest I didn't remember the resolution indipendent thing, but I was supposing something similar since drawing my image in tiles on this context resulted with gaps ! But I was not able to obtain the scale factor of the printing context

Re: NSTableView and NSTextFieldCell redraw oddness when undo

2009-11-13 Thread Corbin Dunn
On Nov 13, 2009, at 8:19 AM, jonat...@mugginsoft.com wrote: On 13 Nov 2009, at 15:15, Corbin Dunn wrote: On Nov 13, 2009, at 6:35 AM, jonat...@mugginsoft.com wrote: I have a subclassed NSTextFieldCell to create a cell that draws outside of it's frame. All the logic in tableview

Detect - Corrupt JPEG data: premature end of data segment

2009-11-13 Thread Trygve Inda
I am downloading an image from the server and sometimes I get an image that is only the first half of the data, either because of a lost connection to the server or the file being replaced on the server while I am downloading. Opening in preview, generates a console message: Corrupt JPEG data:

Re: CPU sampling and +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]

2009-11-13 Thread Paulo Andrade
Hello, I'm using the CPU sampler template. Here (http://1wzi.sl.pt) is a sample of a very simple run to prove my point. Here's how I collected it: - Start the app and let it fully launch (it does a few request at boot) - Attach instruments with the CPU Sampler template - Let it run for 30

Callback when OS delivers console msg for my process?

2009-11-13 Thread Trygve Inda
I use: imageWithContentsOfFile:@a.jpg And sometime it generates a console message: Corrupt JPEG data: premature end of data segment How can I use an observer/exception handler or other notification to detect such messages as NSImage accepts this image as valid when it is not. Something deeper

Derived Value and Core Data

2009-11-13 Thread Luther Baker
Using Core Data - I have created a named NSManagedObject that has both a start time and end time. In an iphone app (UITableViewController), I'd like to display a list of these *Sessions* and I'd like the SECTION headers to break per day, based on a Session's start *date*. So, I'm storing a *time*

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Joel Levin
You might try checking NSImage's -isValid after loading it. - Joel On Nov 13, 2009, at 11:23 AM, Trygve Inda wrote: I use: imageWithContentsOfFile:@a.jpg And sometime it generates a console message: Corrupt JPEG data: premature end of data segment How can I use an

Re: NSTableView and NSTextFieldCell redraw oddness when undo

2009-11-13 Thread jonat...@mugginsoft.com
On 13 Nov 2009, at 17:02, Corbin Dunn wrote: On Nov 13, 2009, at 8:19 AM, jonat...@mugginsoft.com wrote: On 13 Nov 2009, at 15:15, Corbin Dunn wrote: On Nov 13, 2009, at 6:35 AM, jonat...@mugginsoft.com wrote: I have a subclassed NSTextFieldCell to create a cell that draws

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Trygve Inda
You might try checking NSImage's -isValid after loading it. - Joel On Nov 13, 2009, at 11:23 AM, Trygve Inda wrote: isValid returns YES Immediately afterwards calling [image drawInRect:myRect fromRect:imageRect operation:NSCompositeCopy fraction:1.0]; Send this to the console: Error:

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Joel Levin
This has been a known issue and was supposedly fixed in Snow Leopard - are you running 10.5 by any chance? If you are running Snow Leopard, I would recommend filing a radar at http://bugreport.apple.com. - Joel On Nov 13, 2009, at 12:13 PM, Trygve Inda wrote: You might try checking NSImage's

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Gary L. Wade
Have you tried NSImage's delegate methods for loading status? On Nov 13, 2009, at 11:23 AM, Trygve Inda wrote: I use: imageWithContentsOfFile:@a.jpg And sometime it generates a console message: Corrupt JPEG data: premature end of data segment How can I use an observer/exception

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Trygve Inda
You might try checking NSImage's -isValid after loading it. - Joel On Nov 13, 2009, at 11:23 AM, Trygve Inda wrote: isValid returns YES Immediately afterwards calling [image drawInRect:myRect fromRect:imageRect operation:NSCompositeCopy fraction:1.0]; Send this to the console:

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Kyle Sluder
2009/11/13 Trygve Inda cocoa...@xericdesign.com: How can I use an observer/exception handler or other notification to detect such messages as NSImage accepts this image as valid when it is not. Break on NSLog (or perhaps CFLog). --Kyle Sluder ___

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Trygve Inda
This has been a known issue and was supposedly fixed in Snow Leopard - are you running 10.5 by any chance? If you are running Snow Leopard, I would recommend filing a radar at http://bugreport.apple.com. - Joel On Nov 13, 2009, at 12:13 PM, Trygve Inda wrote: You might try checking

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Adam R. Maxwell
On Nov 13, 2009, at 1:31 PM, Kyle Sluder wrote: 2009/11/13 Trygve Inda cocoa...@xericdesign.com: How can I use an observer/exception handler or other notification to detect such messages as NSImage accepts this image as valid when it is not. Break on NSLog (or perhaps CFLog). Or maybe

Re: NSPredicateEditorRowTemplate and dynamic popups

2009-11-13 Thread Jim Turner
Try this: Create an outlet to your row template. When you need to update the popups, make a copy of that template. Make a copy of the rowTemplates the predicate editor currently tracks and iterate over them replacing the template in the list that is the same class as your custom template. Then

Re: Auto-scrolling view

2009-11-13 Thread Alfonso Urdaneta
Symadept wrote: How to design Auto-scrolling view. Any pointers are highly appreciable. Start with a view, add some scrolling, then a little auto? -- alfonso e. urdaneta red82.com - are you ready? ___ Cocoa-dev mailing list

Bindings vs MOC change notification

2009-11-13 Thread David Catmull
In my Core Data app, I have objects with a date property, and I want to maintain a list of all years that I have objects in. I'm having trouble settling on an approach. Currently, I'm listening for NSManagedObjectContextObjectsDidChangeNotification. This is working fine for additions and

Core Data: Begin+End Undo Group = Dirty Dot. Why?

2009-11-13 Thread Jerry Krinock
I have discovered (one of?) the mysterious causes of a Core Data document becoming dirty (red button in title bar gets black dot) when no changes have been made to the store. STEPS TO REPRODUCE: * Mac OS 10.5.8 (haven't tested 10.6 yet) * Download a fresh copy of Apple's

Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?

2009-11-13 Thread Kyle Sluder
On Fri, Nov 13, 2009 at 6:53 PM, Jerry Krinock je...@ieee.org wrote: Why would the dirty dot become dirty when no change was made to the store?  I don't see any logical reason for this. Because NSDocument change count is linked to the NSUndoManager notifications. See

Re: Bindings vs MOC change notification

2009-11-13 Thread Jerry Krinock
First of all, after reading your message, I believe the subject of your message should be KVO vs MOC change notification. But we all get our terms mixed up once in awhile :) On 2009 Nov 13, at 18:11, David Catmull wrote: Recommendations? Other options? I believe there is no easy answer

NSPopUpButton submenu's

2009-11-13 Thread SRD
Can anyone offer some advice on how to add submenu's on the menu of an NSPopUpButton. I'm a bit confused as I've heard it can, and then can't be done. And XCode has it on it's toolbar (e.g. Action - Add - New Target). I just dragged an NSMenu from the palette onto my NSPopUpButtons main menu and

Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?

2009-11-13 Thread Graham Cox
On 14/11/2009, at 1:53 PM, Jerry Krinock wrote: - (IBAction)dooDoo:(id)sender { [[self undoManager] beginUndoGrouping] ; [[self undoManager] endUndoGrouping] ; A known bug in NSUndoManager is that doing this records an empty undo task - the Undo menu becomes available but does

Re: Bindings vs MOC change notification

2009-11-13 Thread Kyle Sluder
On Fri, Nov 13, 2009 at 6:11 PM, David Catmull uncom...@uncommonplace.com wrote: Currently, I'm listening for NSManagedObjectContextObjectsDidChangeNotification. This is working fine for additions and deletions, but it's harder for changes, mainly because I don't know the old value. If I

Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?

2009-11-13 Thread Jerry Krinock
On 2009 Nov 13, at 19:06, Kyle Sluder wrote: On Fri, Nov 13, 2009 at 6:53 PM, Jerry Krinock je...@ieee.org wrote: Why would the dirty dot become dirty when no change was made to the store? I don't see any logical reason for this. Because NSDocument change count is linked to the

Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?

2009-11-13 Thread Kyle Sluder
On Fri, Nov 13, 2009 at 7:44 PM, Jerry Krinock je...@ieee.org wrote: Maybe you or someone could explain it a little better? See Graham's explanation. AppKit already does this for you.  See -[NSUndoManager groupsByEvent]

Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?

2009-11-13 Thread Jerry Krinock
On 2009 Nov 13, at 19:41, Graham Cox wrote: On 14/11/2009, at 1:53 PM, Jerry Krinock wrote: - (IBAction)dooDoo:(id)sender { [[self undoManager] beginUndoGrouping] ; [[self undoManager] endUndoGrouping] ; A known bug in NSUndoManager is that doing this records an empty undo task - the

Re: Core Data: Begin+End Undo Group = Dirty Dot. Why?

2009-11-13 Thread Jerry Krinock
On 2009 Nov 13, at 19:50, Kyle Sluder wrote: On Fri, Nov 13, 2009 at 7:44 PM, Jerry Krinock je...@ieee.org wrote: Maybe you or someone could explain it a little better? See Graham's explanation. Got it. Known bug. Yes it does, but once you build a Core Data app which is more

Re: NSPopUpButton submenu's

2009-11-13 Thread Jerry Krinock
On 2009 Nov 13, at 19:24, SRD wrote: I can only seem to get the first level menu and it's items, but nothing underneath. Send -[NSMenuItem submenu]. Each level of a hierarchical menu consists of two parts. First, the (sub)menu, then the menu items. Repeat for each level.

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Ken Thomases
On Nov 13, 2009, at 2:53 PM, Trygve Inda wrote: Also... NSURL* imgURL = [NSURL fileURLWithPath:path]; CGImageSourceRefimgRef; CGImageSourceStatus imgStatus; imgRef = CGImageSourceCreateWithURL (imgURL, nil); CGImageSourceGetStatus (imgRef) returns kCGImageStatusComplete

Stack-based C++ class to wrap NSAutoreleasePool

2009-11-13 Thread Dan Korn
I'm building a Framework with some exported extern C functions in Objective-C++, based on this example: http://developer.apple.com/internet/webservices/webservicescoreandcfnetwork.html Because this is a Framework, it doesn't have its own main() function to set up an NSAutoreleasePool. So I

Re: Close/Minimize the app

2009-11-13 Thread kirankumar
hi, this will help you keep this 3lines of code in awakeFromNib, and mpwindow is you are window name. id closeButton = [mpWindow standardWindowButton:NSWindowCloseButton ]; [closeButton setAction:@selector(closeapp:)]; [closeButton setTarget:self]; - (IBAction)closeapp:(id)sender {

Building a tree

2009-11-13 Thread Jonathan Guy
Hi all I'm having a hard time finding a good example of this on the web so I thought I'd post here. I have an array of file system paths (NSStrings) and need to convert this into a tree structure using parent child tree node objects. The method has to be as efficient as possible as it

Re: Drag-Move the Transparent windowed app over the screen

2009-11-13 Thread kirankumar
Hi, goto attributes for your window ,enable the texture checkbox so that you can drag your window. Regards, kiran. On Nov 12, 2009, at 2:09 PM, Symadept wrote: Hi, My app's window is a BorderLess Window because of which I will not have the Titlebar (Ref: RoundTransparentWindow of Apple

[iPhone] OS 3.0 and @synthesize AND @dynamic for the same property

2009-11-13 Thread Joerg Simon
Dear all other Cocoa Developers: In an app I am developing I have the following strange thing: [code in the .h file] @interface XY : CALayer BOOL _editing; ... @property (assign, getter = isEditing) BOOL editing; [/code] [code in the .m file] @synthesize editing = _editing; @dynamic

Using HTML form in cocoa app

2009-11-13 Thread Mark Reddick
Hey all. I'm trying to figure out how to use an HTML form in a cocoa application. The situation is that I need to be able to read files that contain an HTML page with an HTML form in it. I then need to somehow present this form to the user (in my cocoa app) and let them fill it out. These

NSColor colorUsingColorSpace: extremely slow on 10.6?

2009-11-13 Thread Aaron Epstein
Hi all, I've got some simple color space conversion code using NSColor's colorUsingColorSpace: method that runs fast on 10.5, but is extremely slow on 10.6 (especially in a loop run 1,000+ times). Has anyone else noticed this issue? Are there any known workarounds? I've attached some sample

Re: Multiple variable rules in for() statement

2009-11-13 Thread David Ross
Jonathon, GCC does not like declaring variables in a for statement. If you want to make the variable m have the scope for only the for loop, you would need: foo() { ... { int i, m; for (i=0, m=0; i5; i++){...} printf(Final value of

Interested in a Tampa Bay Area CocoaHeads?

2009-11-13 Thread Jason Broyles
I was thinking about starting up a Tampa Bay area CocoaHeads group. Are there any local devs who may be interested in the group? The closest one is in Orlando and this is a bit of a drive. The meetings could be somewhere central to Tampa / Clearwater / St. Petersburg. -- Jason Broyles

Advice On Subclass vs. Delegate

2009-11-13 Thread s.ross
I'm building an app that has two NSTextFields (prob'ly more before I'm done). Each of these text fields does word splitting according to different criteria (comma, optional space for one, and whitespace for the other). One of them counts the words and checks case-insensitive for dups. The other

iPhone: Having a touch point want to find layer it is in

2009-11-13 Thread Tino Rachui
I have a UIView and a hierarchy of CALayers added to the views layer. When a touch event occurs I can get the 'locationInView' for instance but what is the best way to find the top most visible CALayer in the views layer hierarchy? I played a bit with 'hitTest' but in vain so far. Maybe I'm doing

Tracking Safari usage through a background process or dameon

2009-11-13 Thread Suresh Pandey
Hi All, I need to develop a background process that gets started on user login to Mac machine and then onwards it logs whatever operations the user is performing on Safari. Please suggest me what approach/technology/API's should use to achieve followings: 1. How can my bg process can

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-13 Thread Dale Miller
PPC has the cntlzw and cltlzd hardware instructions (count leading zeros word/doubleword). Subtracting the result from 32 or 64 would give the bit number of the leading 1-bit (or 32/64 for no 1-bits). Dale Miller dalelmil...@comcast.net ___

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Trygve Inda
On Nov 13, 2009, at 2:53 PM, Trygve Inda wrote: Also... NSURL* imgURL = [NSURL fileURLWithPath:path]; CGImageSourceRefimgRef; CGImageSourceStatus imgStatus; imgRef = CGImageSourceCreateWithURL (imgURL, nil); CGImageSourceGetStatus (imgRef) returns

Re: Building a tree

2009-11-13 Thread Dave DeLong
While this doesn't exactly address what you're looking for, I'd just thought I'd throw in a plug for the CHDataStructures framework, which (among other things) contains a whole bunch of tree-based data structures (AVL, AA, RB, etc) so you don't have to recreate it yourself. It's FOSS and can

Re: [iPhone] OS 3.0 and @synthesize AND @dynamic for the same property

2009-11-13 Thread Roland King
take the @dynamic out. Since you are synthesizing the property you don't need the @dynamic which suppresses the warning that you haven't defined the setter or the getter. You use the @dynamic statement to tell the compiler to suppress a warning if it can’t find an implementation of accessor

Re: [iPhone] OS 3.0 and @synthesize AND @dynamic for the same property

2009-11-13 Thread BJ Homer
On Thu, Nov 12, 2009 at 2:52 AM, Joerg Simon j_si...@mac.com wrote: Dear all other Cocoa Developers: In an app I am developing I have the following strange thing: [code in the .h file] @interface XY : CALayer BOOL _editing; ... @property (assign, getter = isEditing) BOOL editing;

Re: Multiple variable rules in for() statement

2009-11-13 Thread Andrew Farmer
On 12 Nov 2009, at 11:50, David Ross wrote: GCC does not like declaring variables in a for statement. Adding -std=c99 or -std=gnu99 to the compiler flags will fix that. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Close/Minimize the app

2009-11-13 Thread Andrew Farmer
On 11 Nov 2009, at 21:23, kirankumar wrote: this will help you keep this 3lines of code in awakeFromNib, and mpwindow is you are window name. id closeButton = [mpWindow standardWindowButton:NSWindowCloseButton ]; [closeButton setAction:@selector(closeapp:)]; [closeButton setTarget:self];

Re: Drag-Move the Transparent windowed app over the screen

2009-11-13 Thread Andrew Farmer
On 12 Nov 2009, at 01:58, kirankumar wrote: goto attributes for your window ,enable the texture checkbox so that you can drag your window. While this does have the desired effect, there is a much more direct approach available (which Dave Keck has hinted