Re: tiffs on pasteboard

2009-11-20 Thread Alexander Spohr
Am 20.11.2009 um 03:04 schrieb Chris Idou: But what are the rules and conventions? Why would Finder put the icon in the pasteboard on the assumption that is what the user wants, but TextEdit would paste in the actual file on the assumption that is what the user wants? It seems

Re: Authorization plugin samples

2009-11-20 Thread Jean-Daniel Dupas
Le 19 nov. 2009 à 12:14, Alan James Caruana a écrit : Hi, I am not sure this is the right list for this question. If it is not, I aplologize, and ask which list should I address ? Security related questions go on this list: http://lists.apple.com/mailman/listinfo/apple-cdsa --

Re: ColorSyncDeprecated.h in OSX - 10.6

2009-11-20 Thread Jean-Daniel Dupas
Le 19 nov. 2009 à 12:35, Simon ONeill a écrit : Hi, Does anyone have any idea where the new functions for ColorSyncManager (presumably 64bit focused) are documented? Currently, the only place is in the headers themselves (the header are in the same folder as ColorSyncDeprecated.h).

Re: IBOutlets or property + binding

2009-11-20 Thread Christian Ziegler
On 19.11.2009, at 18:45, Keary Suska wrote: On Nov 19, 2009, at 10:32 AM, Christian Ziegler wrote: For instance I got a NSStepper and I only need the integerValue of that stepper. I could either define an IBOutlet and access the integerValue with [stepper integerValue], or I could

Re: How to avoid text distortion

2009-11-20 Thread Alastair Houghton
On 20 Nov 2009, at 02:10, Padmakumar T V wrote: I have created an Application using Wizard like design with the help of NSView. In addition to what others have said, there is no such thing as a Wizard on Mac OS X. The fact you're using Windows terminology here leads me to worry that you

Re: tiffs on pasteboard

2009-11-20 Thread Chris Idou
I thought the solution to big files was to use pasteboard promises... not to setup a pasteboard which is conflicted about what item it is trying to store. At least that's what I find documented by Apple. From: Alexander Spohr a...@freeport.de To: Chris

Re: asl_log aborts the program?

2009-11-20 Thread Jeremy Pereira
On 20 Nov 2009, at 06:33, Chris Idou wrote: I've got a report from a user of my program crashing. In the console they are getting this: 11/19/09 3:08:46 PM[0x0-0x18a18a]Progname[8699]Progname(8699,0x1167b) malloc: *** error for object 0x100563870: pointer being freed was not

Re: asl_log aborts the program?

2009-11-20 Thread Chris Idou
I just noticed something I didn't see before, namely that the doco says to call asl_open once for each thread, which I'm not doing. I guess this most likely is the cause. From: Jeremy Pereira a...@jeremyp.net To: Chris Idou idou...@yahoo.com; Cocoa Forum

Re: extracting the mantissa for a NSDecimal

2009-11-20 Thread Tom Bernard
Hello Olivier, I am working with NSDecimals and ran across your 7 year old post in Cocoa-dev. Did you ever get an answer to your mantissa question? The archives do not show a response to the thread. Btw, did you consider NSData's +dataWithBytes:length: method? NSData *anNSDecimalAsData =

Re: setToolTip: not working

2009-11-20 Thread Andy Lee
On Nov 19, 2009, at 1:04 PM, Ben Haller wrote: This led me to suspect the custom NSView subclass that I am using as a content view, and indeed, if I use that custom subclass as the content view in Andy's code, it breaks the tooltip there too. Total shot in the dark: what if you don't change

Re: extracting the mantissa for a NSDecimal

2009-11-20 Thread Roland King
I don't know if he ever did get an answer however your method of putting it in an NSData is a much better idea and the original question sort of missed the point. Yes there is a constructor for NSDecimalNumber which allows you to give a mantissa and an exponent, but that doesn't mean the

Re: resizing PDF obtained from dataWithPDFInsideRect:

2009-11-20 Thread Scott Thompson
On Nov 19, 2009, at 4:37 PM, Chinh Nguyen wrote: The conversion to screen coordinates is causing stair stepping in connected lines and other oddities when exporting to PDF. As a temporary solution until the code is rewritten, I've created a subclass of my view that's sized at the large

Re: NSRunloop + shared thread

2009-11-20 Thread Hank Heijink (Mailinglists)
On Nov 19, 2009, at 7:51 PM, Jens Alfke wrote: On Nov 19, 2009, at 3:40 PM, Colin Deasy wrote: This shared thread is actually handling potentially large numbers of concurrent url connections/downloads. The reason that I want a block in some of those at different times is a for a form of

Re: Dealing with faults in CoreData / AppleScript

2009-11-20 Thread Jim Correia
On Nov 19, 2009, at 10:19 PM, Greg Hoover wrote: I've been working through adding scriptability to my CoreData application but ran into a snag: accessing relationships may return a fault instead of the actual set of objects. Is there an accepted way of solving this issue? I don't want

Re: Stretching NSImage PNGs smoothly

2009-11-20 Thread Dave Keck
Did you account for resolution independence and integral pixel alignment?  If not, I can see how your own code would be faster. Ah, that might explain it. And looking at the docs for NSDrawThreePartImage(): You should prefer the use of this function over your own custom code for handling

Re: tableView:setObjectValue:forTableColumn:row: not called when button pressed

2009-11-20 Thread Scott Ribe
If I understand you correctly, this is described in the 10.5 AppKit Release Notes: I'm not using bindings (and this app is not NSDocument-based) . My controller is a subclass of NSWindowController, which does not implement commitEditing. So as far as I can tell, this doesn't help me. --

Core Data: rules for custom managed object setter implementations

2009-11-20 Thread Sean McBride
Hi all, If I implement a custom setter for an NSManagedObject attribute, what can/can't I do? For example, can I do nothing if the old and new values are the same? - (void)setSalary:(NSNumber*)newsalary { get current salary compare with newsalary if different [self

Re: How to avoid the movie distortion ?

2009-11-20 Thread Sean McBride
On 11/20/09 1:24 PM, James said: I implement a simple movie player using QTMovieView. But some movies will be distorted by reason of the proportion of the Height and Width. How to avoid the movie distortion? If you player is so simple that it takes the whole window, how about

Re: IBOutlets or property + binding

2009-11-20 Thread Keary Suska
On Nov 20, 2009, at 2:13 AM, Christian Ziegler wrote: On 19.11.2009, at 18:45, Keary Suska wrote: On Nov 19, 2009, at 10:32 AM, Christian Ziegler wrote: For instance I got a NSStepper and I only need the integerValue of that stepper. I could either define an IBOutlet and access the

Re: tableView:setObjectValue:forTableColumn:row: not called when button pressed

2009-11-20 Thread Scott Ribe
The crude approach of [[self window] makeFirstResponder: nil]; seems to work well enough. (I'd previously tried a couple of other things along those lines and failed.) -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice

Re: setToolTip: not working

2009-11-20 Thread Ben Haller
On 20-Nov-09, at 6:57 AM, Andy Lee wrote: On Nov 19, 2009, at 1:04 PM, Ben Haller wrote: This led me to suspect the custom NSView subclass that I am using as a content view, and indeed, if I use that custom subclass as the content view in Andy's code, it breaks the tooltip there too.

Re: tiffs on pasteboard

2009-11-20 Thread Jens Alfke
On Nov 20, 2009, at 1:35 AM, Chris Idou wrote: I thought the solution to big files was to use pasteboard promises... not to setup a pasteboard which is conflicted about what item it is trying to store. At least that's what I find documented by Apple. You're correct that promises would

Re: How to avoid the movie distortion ?

2009-11-20 Thread douglas welton
James, In Interface Builder, did you check the Preserve Aspect Ratio checkbox for your QTMovieView? curiously, douglas On Nov 20, 2009, at 12:24 AM, James wrote: Hi, all I implement a simple movie player using QTMovieView. But some movies will be distorted by reason of the proportion

Re: asl_log aborts the program?

2009-11-20 Thread Jens Alfke
On Nov 19, 2009, at 10:33 PM, Chris Idou wrote: Thread 2 Crashed: 0 libSystem.B.dylib 0x7fff87a7784d usleep$NOCANCEL + 0 1 libSystem.B.dylib 0x7fff87a96e3c abort + 93 2 libSystem.B.dylib 0x7fff879ae155 free + 128 3 libSystem.B.dylib

Re: Trouble finding bounding rect of NSAttributedString

2009-11-20 Thread Jens Alfke
On Nov 19, 2009, at 9:20 PM, Dave DeLong wrote: However, in both of these methods, the attributedString of the textview is nil, thus giving me the strange results I'm seeing. How are you getting the attributedString out of the textview? (I'm guessing by calling -textStorage.) If so, that

Re: extracting the mantissa for a NSDecimal

2009-11-20 Thread Greg Guerin
Tom Bernard wrote: NSData *anNSDecimalAsData = [NSData dataWithBytes:anNSDecimal length:sizeof(NSDecimal)]; gives you an NSData object suitable for an NSDictionary without having to muck around with NSDecimal's private fields. The representation stored in the NSData may be

Re: SB won't create an element on 10.5

2009-11-20 Thread Matt Neuburg
On Wed, 18 Nov 2009 16:19:45 -0600, Fritz Anderson fri...@manoverboard.org said: It begins to look more and more that I'm out of luck... To review, here is the NSLog of the failed core/crel event on 10.5: Event = 'core'\'crel'{ 'kocl':'cFld', 'insh':'insl'{ 'kobj':'obj '{ 'want':'cFld',

Re: extracting the mantissa for a NSDecimal

2009-11-20 Thread Jens Alfke
On Nov 20, 2009, at 9:53 AM, Greg Guerin wrote: The representation stored in the NSData may be endian-sensitive. If the NSDictionary contents might cross architectures, that could be problematic. s/may be/is/ s/could be/will be/ NSDecimal is a struct containing multi-byte integers. It

Re: IBOutlets or property + binding

2009-11-20 Thread Karolis Ramanauskas
Let me see. The way I understand what you want to do is this: You have some controls in your window: c1, c2, c3, c4... You don't care to be notified when they change. Only thing you care about is to read their values when you click a button. I thing the best thing to do here is just create a

Re: NSWindowCollectionBehaviorMoveToActiveSpace doesn't work

2009-11-20 Thread slasktrattena...@gmail.com
Hum, no. I was wrong. [self setCollectionBehavior:1] means can join all spaces. Any ideas how to get NSWindowCollectionBehaviorMoveToActiveSpace to work? Again, test app here demonstrates the problem: http://lists.apple.com/archives/cocoa-dev/2009/Oct/msg00647.html On Sun, Nov 15, 2009 at 8:12

Re: extracting the mantissa for a NSDecimal

2009-11-20 Thread Gary L. Wade
On 11/20/2009 10:49 AM, Jens Alfke j...@mooseyard.com wrote: On Nov 20, 2009, at 9:53 AM, Greg Guerin wrote: The representation stored in the NSData may be endian-sensitive. If the NSDictionary contents might cross architectures, that could be problematic. s/may be/is/ s/could

question about informal protocols

2009-11-20 Thread Michael de Haan
I am working through an example in Buck/Yacktman's book that uses an informal protocol. In the interface of of a custom class, it is declared as such. #import Cocoa/Cocoa.h @interface MyShapeEditorDocument : NSDocument { ivars } @end @interface

Re: question about informal protocols

2009-11-20 Thread Jean-Daniel Dupas
Le 20 nov. 2009 à 20:46, Michael de Haan a écrit : I am working through an example in Buck/Yacktman's book that uses an informal protocol. In the interface of of a custom class, it is declared as such. #import Cocoa/Cocoa.h @interface MyShapeEditorDocument : NSDocument {

Re: IBOutlets or property + binding

2009-11-20 Thread Christian Ziegler
You got it right :-). That's what I've been doing. I was just wondering whether people would use binding in that case. thanks a lot for clarification. Cheers Chris On 20.11.2009, at 20:02, Karolis Ramanauskas karol...@gmail.com wrote: Let me see. The way I understand what you want to do

CoreData/NSPersistentDocument initialization

2009-11-20 Thread Oftenwrong Soong
Hi all, My document model is Core Data based. When a new document is created, I must initialize the model to contain several objects with default values. I followed Apple's Departments example:

Re: question about informal protocols

2009-11-20 Thread Michael de Haan
The usual way is to NOT implements the NSObject category and test if the delegate implements the method using -respondsToSelector: But this way works too if you don't want to have to test before sending your message. Anyway, informal protocols are deprecated in favor of @protocol with

Re: question about informal protocols

2009-11-20 Thread David Duncan
On Nov 20, 2009, at 12:09 PM, Michael de Haan wrote: Did not see that it was deprecated, but will take your lead and convert them to that. Does the, in your opinion, optional addition pretty much replace categories as a whole, or is there still a role for them? The addition of @optional

Re: question about informal protocols

2009-11-20 Thread Jean-Daniel Dupas
Le 20 nov. 2009 à 21:09, Michael de Haan a écrit : The usual way is to NOT implements the NSObject category and test if the delegate implements the method using -respondsToSelector: But this way works too if you don't want to have to test before sending your message. Anyway,

Re: question about informal protocols

2009-11-20 Thread Michael de Haan
On Nov 20, 2009, at 12:19 PM, David Duncan wrote: On Nov 20, 2009, at 12:09 PM, Michael de Haan wrote: Did not see that it was deprecated, but will take your lead and convert them to that. Does the, in your opinion, optional addition pretty much replace categories as a whole, or is there

UI Question: Hide application window after minimising

2009-11-20 Thread Michael Davey
Hi there, This is my first post, so please be gentle ;o) I am writing an application using obj-c/Cocoa and I was curious about something I have seen in another application that I would like mine to be able to do. Basically, when you minimise the application, it's window goes down into the

Re: UI Question: Hide application window after minimising

2009-11-20 Thread Jason Foreman
On Nov 20, 2009, at 2:02 AM, Michael Davey wrote: Hi there, This is my first post, so please be gentle ;o) I am writing an application using obj-c/Cocoa and I was curious about something I have seen in another application that I would like mine to be able to do. Basically, when you

Re: UI Question: Hide application window after minimising

2009-11-20 Thread Fritz Anderson
On 20 Nov 2009, at 2:02 AM, Michael Davey wrote: Basically, when you minimise the application, it is window goes down into the dock as per normal, but once this has been doe it then vanishes from the dock, and does not re-appear. Does anyone know if this is possible within Cocoa and which

How to incrementally compress jpeg?

2009-11-20 Thread Phi Le
I posted this question at http://stackoverflow.com/questions/1773360/how-to-compress-jpeg-image-with-cocoa . Copy and paste: I have an jpeg image and I want to be able to incrementally compress it using Cocoa/Core Image/Core Graphics.  For example, I have A.jpg (3MB), I compress A and get B.jpg

Re: [SOLVED] CoreData/NSPersistentDocument initialization

2009-11-20 Thread Oftenwrong Soong
Hi all, Well it's solved, for now, but I have no idea how or why. I'll explain the steps taken as well as I can remember them, in the hopes that someone has seen something similar and can tell me what in the world just happened. I needed to initialize a Core Data model on new document creation

Re: How to incrementally compress jpeg?

2009-11-20 Thread douglas welton
insert pure speculation here Is what you want to do (multiple pass compressions) actually something that is valid to do? Let's say that you compress an image A (using JPEG). If you try to re-compress (JPEG again) the resultant data A , the compression effort will not be very useful because

Re: How to incrementally compress jpeg?

2009-11-20 Thread Jens Alfke
On Nov 20, 2009, at 1:47 PM, Phi Le wrote: I have an jpeg image and I want to be able to incrementally compress it using Cocoa/Core Image/Core Graphics. For example, I have A.jpg (3MB), I compress A and get B.jpg (1MB), compress B and get C.jpg (400KB), and so on till the image can't be

Re: Magic Mouse and NSTouch

2009-11-20 Thread Nathan Vander Wilt
On Oct 27, 2009, at 10:44 PM, Scott Anguish wrote: There should be a tech note shortly that describes these capabilities. Is this the one? http://developer.apple.com/mac/library/releasenotes/DriversKernelHardware/RN-MagicMouse/index.html It doesn't mention NSTouch, so I'm hoping there's more

Re: How to incrementally compress jpeg?

2009-11-20 Thread Phi Le
I am coming from a .NET C# background, so I have some expectations that might not apply to Cocoa development. In .NET, I can incrementally compress an image like this: A = new Image(data) B = A.save(JPEGType, 0.5) C = B.save(JPEGType, 0.5) where the sizes A B C and the deltas are significant.

Re: What exactly does NSController do?

2009-11-20 Thread Michael de Haan
On Nov 20, 2009, at 2:02 PM, Chase Meadors wrote: Thought I'd give the question another try. Any insight appreciated. May I suggest you invest in a book called Cocoa Design Patterns, where that **exact** question is painstakingly answered.___

Fwd: UI Question: Hide application window after minimising

2009-11-20 Thread Michael Davey
Ooops, forgot the list... From: Michael Davey frak@gmail.com Date: 21 November 2009 09:59:39 GMT+11:00 To: Jason Foreman ja...@threeve.org Subject: Re: UI Question: Hide application window after minimising This is not what I wanted to do, but thanks... On 21 Nov 2009, at 08:05,

Re: How to incrementally compress jpeg?

2009-11-20 Thread Jens Alfke
On Nov 20, 2009, at 2:20 PM, Phi Le wrote: A = new Image(data) B = A.save(JPEGType, 0.5) C = B.save(JPEGType, 0.5) where the sizes A B C and the deltas are significant. I can do this if B is saved to disk and reload back. Weird — the save method must be looking up the original

Re: How to incrementally compress jpeg?

2009-11-20 Thread Scott Ribe
I am coming from a .NET C# background, so I have some expectations that might not apply to Cocoa development. In .NET, I can incrementally compress an image like this: A = new Image(data) B = A.save(JPEGType, 0.5) C = B.save(JPEGType, 0.5) You *could* do that, but it's a bad idea. You'll

Re: tableView:setObjectValue:forTableColumn:row: not called when button pressed

2009-11-20 Thread Quincey Morris
On Nov 20, 2009, at 09:11, Scott Ribe wrote: The crude approach of [[self window] makeFirstResponder: nil]; seems to work well enough. (I'd previously tried a couple of other things along those lines and failed.) Maybe I missed something earlier in this thread, but I don't see why using the

[iPhone] weird crash (aren't they all?): ivar seems to be dynamically changing its type

2009-11-20 Thread Paul Archibald
Comrades, I have a bunch of UITableViewControllers in my app, each of which is responsible for some aspect of the data in my sqlite database. Now, maybe I should have done it differently, but I am passing a backpointer from each parent vc to its child vc, where the child vc is going to

Re: [iPhone] weird crash (aren't they all?): ivar seems to be dynamically changing its type

2009-11-20 Thread Michael Babin
On Nov 20, 2009, at 5:55 PM, Paul Archibald wrote: So, why does setParentViewController get called twice, and why is the parameter type different the second time, and why don't I get an exception when the wrong type is gets passed into setParentViewController that second time? Probably

Re: tiffs on pasteboard

2009-11-20 Thread Chris Idou
Well... now that in 10.6 the pasteboard types are UTI types, I'm not sure that one can say anymore that there is no mapping from files to pasteboard types. And 10.6 Finder puts a public.tiff into the pasteboard in this case, but I would argue it is the wrong tiff. On Nov

method_getNumberOfArguments counts blocks twice

2009-11-20 Thread Philip White
Hello, I apologize if this has been touched on already. Have others observed that the function method_getNumberOfArguments counts block arguments as two arguments? The corresponding method in NSMethodSignature counts them once. Similarly, method_getArgumentType splits up the @? into @

Re: Magic Mouse and NSTouch

2009-11-20 Thread Raleigh Ledet
No. The Magic mouse does not issue NSTouches. -raleigh On Nov 20, 2009, at 2:08 PM, Nathan Vander Wilt wrote: On Oct 27, 2009, at 10:44 PM, Scott Anguish wrote: There should be a tech note shortly that describes these capabilities. Is this the one?

Re: tableView:setObjectValue:forTableColumn:row: not called when button pressed

2009-11-20 Thread Sean McBride
Quincey Morris (quinceymor...@earthlink.net) on 2009-11-20 6:34 PM said: ...the window controller could send 'commitEditing:' messages directly to text fields and other views that implement the NSEditor protocol. Nope. Despite the docs, you can't send commitEditing to a textfield. See also:

Re: [iPhone] weird crash (aren't they all?): ivar seems to be dynamically changing its type

2009-11-20 Thread Paul Archibald
Son of a gun, I think you got it. I was wondering about whether properties were somehow involved, but I had not declared any like that in my classes, and didn't think of the inherited ones. Good call. Oh, I guess I will have to actually fix the code now, but I am willing to bet this is

Re: Core Data: rules for custom managed object setter implementations

2009-11-20 Thread Jerry Krinock
Well, maybe if I give a wrong answer at least we'll get a discussion started. On 2009 Nov 20, at 08:32, Sean McBride wrote: If I implement a custom setter for an NSManagedObject attribute, what can I do? I do lots of stuff -- in particular, sending notifications to implement business logic

2 Problems with setAnimationTransition

2009-11-20 Thread David
I'm having two problems with UIView setAnimationTransition. I have a single image that I am flipping (a UIImageVIew). The effect I am aiming for is flipping the image over such that when it is flipped over there is a resulting blank (black) space where the image should be. Also, in

Re: tableView:setObjectValue:forTableColumn:row: not called when button pressed

2009-11-20 Thread Kyle Sluder
On Nov 20, 2009, at 6:38 PM, Sean McBride cwat...@cam.org wrote: Quincey Morris (quinceymor...@earthlink.net) on 2009-11-20 6:34 PM said: ...the window controller could send 'commitEditing:' messages directly to text fields and other views that implement the NSEditor protocol. Nope.

Re: tiffs on pasteboard

2009-11-20 Thread Kyle Sluder
On Nov 20, 2009, at 3:59 PM, Chris Idou idou...@yahoo.com wrote: Well... now that in 10.6 the pasteboard types are UTI types, I'm not sure that one can say anymore that there is no mapping from files to pasteboard types. And 10.6 Finder puts a public.tiff into the pasteboard in this case,

Best approach to write an uninstaller for osx

2009-11-20 Thread Parimal Das
Hello All I want to write a uninstaller for my app. What this un-installer need to do is- delete some files an the main app, and then delete itself. Steps what i found are 1. Un-install app will run a shell script to delete all. 2. It will use launchd to delete itself. How access permissions

Re: [SOLVED] CoreData/NSPersistentDocument initialization

2009-11-20 Thread Jerry Krinock
On 2009 Nov 20, at 12:04, Oftenwrong Soong wrote: However, initWithType:error is never called for new document creation (or any document creation for that matter). I placed a breakpoint inside the method and execution does not pause there. Instead, -(id)init gets called. It's not 'instead'.

Re: Best approach to write an uninstaller for osx

2009-11-20 Thread Jens Alfke
On Nov 20, 2009, at 11:03 PM, Parimal Das wrote: I want to write a uninstaller for my app. Are you sure it needs one? Most Mac apps don't have or need uninstallers. If you want to remove an app, you just drag its icon to the Trash. (There might be some preference files left behind, but

NSFetchedResultsController with fetch predicate

2009-11-20 Thread Rick Mann
I have a UITableView that displays a list of message subjects. When a message is deleted, it is marked as deleted, rather than actually removed from the MOC. The list is backed by an NSFetchedResultsController. I initializes the FRC with a predicate: NSEntityDescription* entity =