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: odd behavior with NSError?

2009-10-15 Thread Nathan Vander Wilt
On Oct 2, 2009, at 7:45 AM, Bill Bumgarner wrote: In either case, assuming the undefined reference is nil would be a bug. Initializing the variables to nil prior to the call isn't going to change anything in that regard. (And, yes, there are methods that modify their error parameter on

Re: creating registration codes

2009-08-27 Thread Nathan Vander Wilt
On Aug 27, 2009, at 9:18 PM, Rick C. wrote: hello, my apologies if this is a bit off-topic, but once an app is done does anyone have a recommendation on how to go about setting up a registration code system for the created app. i guess it needs some programming in partner with some

Re: Why I have a leak? I am unable to understand

2009-08-24 Thread Nathan Vander Wilt
On Aug 24, 2009, at 5:20 PM, Agha Khan wrote: HI: I know the leak is in next 2 lines I have commented all the code except these 2 lines. // NSTimeInterval NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; unsigned unitFlags = NSYearCalendarUnit

Layer-backed view confused by bounds transformation

2009-08-19 Thread Nathan Vander Wilt
An NSView's bounds can be set to a different size than its frame, which results in a transform being applied to the graphics context as the view is drawn. How is this supposed to affect subviews if the view is layer backed? If I set my view's bounds to have half the width of its frame, all

Re: When do I need to override hash?

2009-08-19 Thread Nathan Vander Wilt
On Aug 19, 2009, at 4:28 PM, Gideon King wrote: So do I need to override hash too? If so, are there any recommendations as to how to determine the hash easily? If you need to override -isEqual: to provide something besides pointer comparison, you should also override -hash. If objects are

Re: When do I need to override hash?

2009-08-19 Thread Nathan Vander Wilt
On Aug 19, 2009, at 4:28 PM, Gideon King wrote: So do I need to override hash too? If so, are there any recommendations as to how to determine the hash easily? Sorry, just came across this thread that has some more tips:

Re: Outline View DnD

2009-08-08 Thread Nathan Vander Wilt
On Aug 7, 2009, at 6:56 AM, bryscomat wrote: ... Now the dilemma comes when I want to get the drag and drop to work in a specific way. I want the playlists to be able to be dragged and placed in any order, but not above the separator. I have achieved this using the delegate method

Add same object/key to NSMapTable

2009-06-17 Thread Nathan Vander Wilt
The following (simplified test case) code will crash with NSZombieEnabled: NSMapTable* testTable = [NSMapTable mapTableWithStrongToStrongObjects]; NSString* o = [@test_object mutableCopy]; NSString* k = @test_key; [testTable setObject:o forKey:k]; [o release]; [testTable setObject:o forKey:k];

Re: Add same object/key to NSMapTable

2009-06-17 Thread Nathan Vander Wilt
On Jun 17, 2009, at 6:44 PM, Kyle Sluder wrote: On Wed, Jun 17, 2009 at 6:33 PM, Nathan Vander Wiltnate-li...@calftrail.com wrote: I could find no documentation to the effect that re-assigning an object is not allowed, so can I assume this is indeed unintentional? If so, I've got this

Re: When init returns nil does it cause a leak

2009-05-19 Thread Nathan Vander Wilt
On May 19, 2009, at 9:37 AM, Jean-Daniel Dupas wrote: Le 19 mai 09 à 18:24, Reza Farhad a écrit : Hi all we have an object that gets initialized like most other objects -(id)init { self = [ super init ]; if ( self ){ ...do something; } return

Re: Getting NSDate from EXIF of a image

2009-03-03 Thread Nathan Vander Wilt
On Mar 2, 2009, at 8:48 PM, Jushin wrote: I found that in order to convert NSString format of date to NSDate, we need timezone. But, EXIF doesn't support timezone unless GPS tags exist. Yes, this is an unfortunate fact. Depending on what you need the date for, you may need to let the user

Re: mergeChangesFromContextDidSaveNotification effects

2009-01-19 Thread Nathan Vander Wilt
them if they come across my original post. -natevw On Jan 16, 2009, at 2:02 PM, Nathan Vander Wilt wrote: My application imports into an NSManagedObjectContext created on a background thread. As the last stage of this import, I save the background context to the persistent store. All my UI

mergeChangesFromContextDidSaveNotification effects

2009-01-16 Thread Nathan Vander Wilt
My application imports into an NSManagedObjectContext created on a background thread. As the last stage of this import, I save the background context to the persistent store. All my UI code uses a managed object context on the main thread, and expects to be notified via

Re: NSCalendar/NSDate - generating all months/days in a year

2008-12-22 Thread Nathan Vander Wilt
On Dec 22, 2008, at 4:53 AM, Keith Blount wrote: Hi, Apologies in advance for what I think must be a basic question. It's something I've never had cause to do before, assumed must be fairly straightforward, and then seemed a lot more complicated than it should be which leads me to think

Re: warning: unused parameter '_value'

2008-12-22 Thread Nathan Vander Wilt
On Dec 22, 2008, at 4:42 AM, Gerriet M. Denkmann wrote: When I use [GCC_WARN_UNUSED_PARAMETER, -Wunused-parameter] I get (in Release build, not in Development) for every @synthesize statement a warning: warning: unused parameter '_value' There is no value nor _value in the source to be

Core Data binary data optimization(s)

2008-12-15 Thread Nathan Vander Wilt
Thanks to some patient help from this list, I now have a working Core Data model. One object in the model is basically a glorified vector polygon — an array of point structures that contain a about a dozen doubles each. I insert a lot of these polygon objects, and often need to draw all of

Re: Drag Drop: PREVENT file move

2008-12-11 Thread Nathan Vander Wilt
On Dec 11, 2008, at 3:11 PM, Houdah - ML Pierre Bernard wrote: Hi! My application shows a list of files in a table view. I have implemented drag and drop so that users may drag files from the list. I could envision them dragging the files onto other applications for viewing or dragging

Re: Core Data warning: to-many relation does not have an inverse

2008-12-11 Thread Nathan Vander Wilt
Sorry if this ends up showing twice, but the original message has been moderator-queued for length since early this morning. Being several steps behind in even *asking* Core Data questions has been frustrating me all day, as I try to press on in no less ignorance than yesterday. On Dec 11,

Re: NSKeyedArchiever and XML Format

2008-12-11 Thread Nathan Vander Wilt
On Dec 11, 2008, at 1:01 AM, Patrick Mau wrote: Good morning For the last day I have pulled my hair over NSKeyedArchiever and friends to load and save small data objects. I mainly use this feature for debugging, so the output format is set to XML. Normally, one would write an object 'p'

Re: NSKeyedArchiever and XML Format

2008-12-11 Thread Nathan Vander Wilt
On Dec 11, 2008, at 5:34 PM, Martin Wierschin wrote: [a encodeObject:p forKey:@root]; Does using: [a encodeRootObject:p]; instead of the line above make it work as expected? A good idea, but IIRC that did not work. In fact, I think it produced an archive that silently failed to be read

Core Data warning: to-many relation does not have an inverse

2008-12-10 Thread Nathan Vander Wilt
I'm trying to port my model code to use Core Data. My model is something like this: I have a Company. It has two to-many relationships, currentEmployees and previousEmployees which are naturally both to Employees. Employees have a to-one relationship to the Company that is the inverse of

Re: Problem setting a Core Data Document Icon

2008-12-10 Thread Nathan Vander Wilt
On Dec 10, 2008, at 5:38 PM, vince wrote: I can't seem to set a default icon for my supported docs in a Core Data project. The .icns file is in my Bundle and placed in the Resources bin. I manually inserted the file name in the Target's Supported Document field. I rebooted my system a few

Re: Shouldn't NSOpenPanel media browser aliases be resolved before type check?

2008-12-05 Thread Nathan Vander Wilt
On Dec 2, 2008, at 8:06 AM, Corbin Dunn wrote: Le Dec 1, 2008 à 5:32 PM, Nathan Vander Wilt a écrit : My Leopard-only application needs to be able to import any image supported by CGImageSource, so I create an NSOpenPanel and pass the array obtained from CGImageSourceCopyTypeIdentifiers

Shouldn't NSOpenPanel media browser aliases be resolved before type check?

2008-12-01 Thread Nathan Vander Wilt
My Leopard-only application needs to be able to import any image supported by CGImageSource, so I create an NSOpenPanel and pass the array obtained from CGImageSourceCopyTypeIdentifiers() to runModalForTypes. This makes the Media Photos sidebar to show up automatically in the Open panel,

Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?

2008-10-30 Thread Nathan Vander Wilt
buried in the release notes?!? bug on the documentation: rdar://problem/6332711. thanks, -natevw On Oct 1, 2008, at 2:27 PM, Nathan Vander Wilt wrote: I am initiating a promise drag by adding an array of strings to my pasteboard using for the NSFilesPromisePboardType. The documentation states

Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?

2008-10-04 Thread Nathan Vander Wilt
On Oct 1, 2008, at 3:09 PM, Jim Correia wrote: On Oct 1, 2008, at 5:27 PM, Nathan Vander Wilt wrote: I am initiating a promise drag by adding an array of strings to my pasteboard using for the NSFilesPromisePboardType. The documentation states that the types can be specified as filename

Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?

2008-10-04 Thread Nathan Vander Wilt
On Oct 4, 2008, at 8:31 PM, Jim Correia wrote: On Oct 4, 2008, at 10:45 PM, Nathan Vander Wilt wrote: HFS types seem to be well deprecated in nearly every other area, the drag destination guides don't encourage checking the types anyway Can you post a reference? You generally should

Can I put UTIs in NSFilesPromisePboardType promise drag array?

2008-10-01 Thread Nathan Vander Wilt
I am initiating a promise drag by adding an array of strings to my pasteboard using for the NSFilesPromisePboardType. The documentation states that the types can be specified as filename extensions or as HFS file types encoded [as strings]. Is there any reason to not build an array of UTIs

Changing slide back destination during drag

2008-09-26 Thread Nathan Vander Wilt
I have a view that allows users to drag copies of the items it contains. I'd like to add autoscrolling to the view, which will move the drag's source item. However, I can find no way to change the drag properties so that upon failure the image will slide back to where the item *is* rather

Re: Hard calculation crashes after 60Minutes

2008-08-31 Thread Nathan Vander Wilt
On Aug 30, 2008, at 8:08 PM, Mr. Gecko wrote: Hello I am making a program that does a really hard calculation and it seems to crash after 60 Minutes. I don't really know why it does, I am guessing it is because I am using a for loop that takes awhile to run If you can't find any leaks, it

Undocumented Leopard support for overlapping sibling views

2008-08-28 Thread Nathan Vander Wilt
According to two list postings (http://lists.apple.com/archives/cocoa-dev/2007/Nov/msg01760.html , http://lists.apple.com/archives/cocoa-dev/2007/Nov/msg01764.html) both by Apple employees, overlapping sibling subviews are fully supported in Leopard (and presumably beyond). However, the

Re: Undocumented Leopard support for overlapping sibling views

2008-08-28 Thread Nathan Vander Wilt
On Aug 28, 2008, at 2:40 PM, Corbin Dunn wrote: Please do log bugs requesting the documentation to be enhanced. Overlapping views do work in Leopard+, with or without layers. However, a sibling layered view will always be on top of a sibling non-layered view. I will do so, as well as a

Re: Convert unicode string into ascii

2008-08-28 Thread Nathan Vander Wilt
On Aug 28, 2008, at 3:48 PM, I. Savant wrote: On Aug 28, 2008, at 6:36 PM, Deborah Goldsmith wrote: I should point out that you can only write English with a-z, so I don't know if I'd consider the other characters weird. Not to mention characters like ¥, ©, and so on. Here's an

Re: Obtaining rotation from CTM

2008-08-21 Thread Nathan Vander Wilt
On Aug 21, 2008, at 6:56 AM, Tilman Bender wrote: Hi there, Is it possible to obtain the angle of rotation from a tranformation- matrix created with CGAffineTransfrom? If you haven't applied any other transforms to your CGAffineTransform, you could determine the rotation (in radians)

Re: Memory Leaks Instruments Questions

2008-08-11 Thread Nathan Vander Wilt
On Aug 10, 2008, at 12:37 PM, Michael Kaye wrote: I've ben running my app with leaks in Instruments and it is reporting a fair number of leaks. On analyzing these leaks, they all appear to be related to apple frameworks methods/code and never as a direct result of any objects I've

Re: Rotate NSString... I give up :( [SOLVED]

2008-08-06 Thread Nathan Vander Wilt
On Aug 6, 2008, at 2:08 PM, Vitaly Ovchinnikov wrote: Yes, you right, but I expected what I need to move text to the zero point, rotate it and move it back. But NSAffineTransform works quite the contrary and requires to move the zero point to the text and then back. That was a big surprise for

Re: Storing values in dictionary with their address as the key

2008-07-29 Thread Nathan Vander Wilt
What about using CFDictionary ? You can create a dicitonary with a callback that support address (NULL for example). I'll echo this; it's a really handy technique that I use frequently (you can even use integers as keys!). WARNING: Just in case, there is a major warning here. You should

Re: Storing values in dictionary with their address as the key

2008-07-29 Thread Nathan Vander Wilt
On Jul 29, 2008, at 8:58 AM, Nathan Vander Wilt wrote: Right, -[NSDictionary setObject:forKey:] on a CFDictionary created with a custom retain callback will invoke copyWithZone: before calling your retain callback. Apple claims this is not a bug. Getting/removing values with objectForKey

Re: Handling key equivalents in a controller class?

2008-07-21 Thread Nathan Vander Wilt
Jens – I've been wanting to do similar key handling in my controller class (rather than view classes), so I'm glad I'm not the only one not fully grokking the responder chain. I got some helpful responses to my more specific question, but without loss of generality. Especially:

Re: Delete action from variety of key presses

2008-07-08 Thread Nathan Vander Wilt
On Jul 7, 2008, at 5:07 PM, Graham Cox wrote: The view that is first responder needs to override -keyDown: and do this: [self interpretKeyEvents:[NSArray arrayWithObject:event]]; which hooks the event into the standard dispatcher for these methods. (One thing that has long puzzled

Delete action from variety of key presses

2008-07-07 Thread Nathan Vander Wilt
I want to be able to delete the items selected in a view, but am struggling finding a best way to turn the different key presses into a -delete: action that my controller can handle. I think I want (it seems expected functionality anyway) the delete key, the forward delete key, as well as

Re: Delete action from variety of key presses

2008-07-07 Thread Nathan Vander Wilt
The Cocoa Text Bindings system already translates keys and key combinations into invocations of NSResponder methods. http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/chapter_9_section_1.html So, what you need to do is determine which methods those

Re: Delete action from variety of key presses

2008-07-07 Thread Nathan Vander Wilt
By overriding -keyDown: and not calling [super keyDown:keyEvent], you have stopped your view from actually processing the keys any further. That's why you aren't getting to either of the delete methods. Hmm, the flowchart I mentioned

Re: Good mouse tracking design for dynamic view?

2008-07-02 Thread Nathan Vander Wilt
So it seems I need to do more bookwork myself, but I'm wondering which direction others would recommend: a) Set up a single tracking area for the whole view, and perform all my own hit testing every time the mouse moves. b) Keep the per-item tracking areas, but perform my own testing in

Re: Cocoa says not KVC compliant

2008-07-02 Thread Nathan Vander Wilt
On Jul 2, 2008, at 10:13 AM, Milen Dzhumerov wrote: I've run into a something I find strange. I've got a property declared as: @property(readwrite, assign, nonatomic) CGImageRef image; ... When I try to set it using KVC (e.g. [obj setValue:[NSValue valueWithPointer:image]

Layer hosting view not redisplaying under PPC

2008-07-02 Thread Nathan Vander Wilt
Today I took some time again to test my app on more architectures than just i386, and I'm encountering a strange problem on PowerPC with a custom view that hosts Core Animation layers. While other built-in views like NSButton are redrawing fine, none of my custom layer- hosting view's

Re: How is Apple + Ctrl + D implemented?

2008-04-30 Thread Nathan Vander Wilt
On Apr 28, 2008, at 5:35 AM, John Joyce wrote: Graham, Thanks for your reply! But how can I find the range of the word given the glyph index? I just can not find an API doing so. [snip] The range of the word is up to you to find and depends on the language. If it is any common language

Re: warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

2008-04-14 Thread Nathan Vander Wilt
On Apr 14, 2008, at 6:12 AM, yang younker wrote: /* com.apple.ibtool.document.notices */ /* com.apple.ibtool.document.warnings */ /Users/younker/Developer/Example1/English.lproj/MainMenu.xib:460: warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread Nathan Vander Wilt
On Apr 13, 2008, at 7:15 AM, Carter R. Harrison wrote: CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; CGContextDrawLayerInRect(context, CGRectMake([self frame].origin.x, [self frame].origin.y, [self frame].size.width, [self frame].size.height), cgback); cgback

Re: some questions about creating image thumbnails

2008-04-09 Thread Nathan Vander Wilt
On Apr 9, 2008, at 8:32 AM, Jesse Grosjean wrote: I've heard (or maybe imagined) that some image file formats will already embed their own thumbnails. Is that a better way to do things... what image formats support that if any? This I do know a bit better. TIFF images can indeed store

Re: some questions about creating image thumbnails

2008-04-09 Thread Nathan Vander Wilt
On Apr 9, 2008, at 8:32 AM, Jesse Grosjean wrote: 1. If I don't care about on disk size is NSTIFFCompressionNone a fast way to write? (assuming that compression would take more time). Or maybe compression will actually save me time since the disk write will be faster? I am by no means a

Re: Getting the mouse location in a CAlayer's coordinates

2008-04-08 Thread Nathan Vander Wilt
On Apr 8, 2008, at 9:15 AM, douglas a. welton wrote: Hi All, Would someone provide me a pointer for how to get the mouse location in the coordinate system of a transformed layer that is underneath the mouse. I thought I could do something like this: Mouse_Location = [Target_Layer

Fixing my massive memory leak with NSImage/CALayer

2008-04-01 Thread Nathan Vander Wilt
I want to pop up photographs inside their own Core Animation layers, but I get huge real memory usage that never goes down. I have an FRPhoto class whose instances manage other metadata for the image, and also have a convenience method to get an NSImage* as follows: - (NSImage*)image {

yearly NSDraggingInfo -draggedImage question (BEWARE!)

2008-03-20 Thread Nathan Vander Wilt
I implemented a dragging destination, and only get nil from [sender draggedImage]. Why? thanks, -natevw p.s. IMPORTANT NOTE! No one has lived to answer this question: http://www.cocoabuilder.com/archive/message/cocoa/2004/8/19/114978

Re: yearly NSDraggingInfo -draggedImage question (BEWARE!)

2008-03-20 Thread Nathan Vander Wilt
[sending to the list this time, I might maybe someday eventually get used to the reply-to policy here.] On Mar 20, 2008, at 3:00 PM, Sherm Pendley wrote: On Thu, Mar 20, 2008 at 5:19 PM, Nathan Vander Wilt [EMAIL PROTECTED] wrote: I implemented a dragging destination, and only get nil from

Re: yearly NSDraggingInfo -draggedImage question (BEWARE!)

2008-03-20 Thread Nathan Vander Wilt
better! Maybe this would be a better way of asking: What is the NSDraggingInfo protocol's -draggedImage method supposed to return, and under what circumstances? thanks, -natevw On Mar 20, 2008, at 6:15 PM, Nathan Vander Wilt wrote: ... I subclassed an NSImageView to turn it into a dropbox

NSDate from xsd:dateTime / ISO 8601

2008-03-17 Thread Nathan Vander Wilt
I'm trying to convert a date formatted as a valid xsd:dateTime format, which is a subset of ISO 8601. I though I had it when I saw that that -[NSDate dateWithString:] takes an international string representation format. But when I feed it a string like @2007-07-01T01:33:01Z, I get back nil. Does

Re: NSDate from xsd:dateTime / ISO 8601

2008-03-17 Thread Nathan Vander Wilt
Does -dateWithString: really not support the international [standard!] string representation of ISO 8601?? What's the right way to convert such an xsd:dateTime to an NSDate? +[NSDate dateWithString:] is, I think, configured to recognize one particular date format, which depends on your system

Re: Core Animation - Modifying CAConstraints

2008-03-13 Thread Nathan Vander Wilt
I have a situation where I want to re-order sublayers of a layer which are positioned using CAConstraints. Is this at all possible? Not sure what you mean by re-order, whether z-order or sibling order, or if you mean re-layout? Using CAConstraints will help with the last option. The

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: 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 whatever

[self setLayer:] in initWithFrame:

2008-02-21 Thread Nathan Vander Wilt
I provide an initWithFrame: for my NSView subclass, and as it is a stand-in for a Custom View in IB the method is called. It does initialize all my instance variables as expected. However, when I try to turn my view into a layer-hosting view with: CALayer* rootLayer = [CALayer layer];

Re: [self setLayer:] in initWithFrame:

2008-02-21 Thread Nathan Vander Wilt
If you don't have layer backing turned on in the nib file the view loading machinery turns off layer backing after initWithFrame: is called. Ah, that explains it! From my understanding (and the docs don't elaborate on this much at all), I *don't* want to do that, since I need to provide