Re: CFMutableDictionary Capacity

2011-08-10 Thread Wade Tregaskis
According the doc, the parameter capacity in function CFDictionaryCreateMutable() sets the *maximum number* of key-value pairs which can be inserted into the container. That is, it's not an *initial* capacity. I think that was a mistake in the docs. The comment in CFDictionary.h in the

Saving a rotated image

2011-08-10 Thread charisse napeÿfffff1as
Hello All, Anybody knows how to save a rotated image to the Documents folder in iphone? Given a variable number of degrees, how to save that rotated image in file, keeping its current rotation angle? thanks, Charisse ___ Cocoa-dev mailing list

Font in TextFieldCell in Matrix

2011-08-10 Thread Gerriet M. Denkmann
NSTextField does NOT accept my font. NSTextFieldCell *cell = [ matrix selectedCell ]; NSLog(@%s cell %@,__FUNCTION__, cell); cell NSTextFieldCell: 0x10017cc60 NSFont *font = [ NSFont fontWithName: @Osaka-Mono size: 14 ]; NSLog(@%s font %@,__FUNCTION__, font); font Osaka-Mono 14.00

Re: blocks and retaining CoreFoundation objects

2011-08-10 Thread Fritz Anderson
On 9 Aug 2011, at 12:05 PM, David Duncan wrote: On Aug 8, 2011, at 11:43 PM, Roland King wrote: After a bit of googling I came across some posts which explained Block_Copy() would treat a variable adorned with __attribute__((NSObject)) similarly to NSObjects and retain them. So changing

Lion autosave: Undefined st_flags 0x40 bit being set, causing errors

2011-08-10 Thread Benjamin Rister
Our application copies files in response to filesystem events, and in some cases that seem correlated with Lion’s autosave system (e.g. in TextEdit and Pages), the undefined 0x40 bit is being set in the files’ st_flags fields. When trying to set these flags on the destination copy over AFP, we

Re: blocks and retaining CoreFoundation objects

2011-08-10 Thread Wade Tregaskis
The ARC specification defines a retainable pointer as including those pointers that have the __attribute__((NSObject)) decoration, so this should behave as expected under ARC. http://clang.llvm.org/docs/AutomaticReferenceCounting.html#objects I am curious, though, in that CGImageRef is

Re: Opening a file read-only?

2011-08-10 Thread Wade Tregaskis
Try running fs_usage while your app is running, and you’ll be able to see what files it opens and in which modes. (Or there’s probably an Instrument for that now?) There's half a dozen related to file I/O, which unfortunately makes it very awkward to use for even simple tasks like this. You

Re: NSTableView: move rows through drag and drop?

2011-08-10 Thread Izak van Langevelde
On 2011-08-10, at 10:40 AM, Peter Hudson wrote: I would do this as follows :- At the same time that you write rows to the pasteboard in the source table, store locally ( perhaps in the source table data source ) the row indexes that were written to the pasteboard. Set observation for a

Re: Opening a file read-only?

2011-08-10 Thread Douglas Davidson
On Aug 10, 2011, at 8:10 AM, Wade Tregaskis wrote: Note also that initWithContentsOfMappedFile: is deprecated in 10.7. There doesn't appear to be a replacement; I presume you're supposed to use initWithContentsOfFile:, but that really does read the entire file in at init time (into a

Re: Saving a rotated image

2011-08-10 Thread Mike Abdullah
Break the problem up. Which bits don't you know how to do? On 10 Aug 2011, at 07:37, charisse napeÿf1as wrote: Hello All, Anybody knows how to save a rotated image to the Documents folder in iphone? Given a variable number of degrees, how to save that rotated image in file, keeping

Re: Optimizing a loop

2011-08-10 Thread Wade Tregaskis
//This takes about 6 seconds each search for song* for (id key in songsDictionary) { NSString *thisSong = key; int suppliedCount = [stringValue length]; int keyCount = [thisSong length]; //Fuzzy matching

Re: Optimizing a loop

2011-08-10 Thread Eric E. Dolecki
Thanks for the reply. I've since broken up the songs into buckets depending on the title length and I use a Dictionary to retrieve arrays based on the length, then I am only searching a subset. It's WAY faster than searching the entire collection of songs. I just pre-build this during app start up

Re: Lingering windows

2011-08-10 Thread Quincey Morris
On Aug 9, 2011, at 22:34 , Shane Stanley wrote: In my document class's -makeWindowControllers I'm setting a property to the window controller; could that be the problem? A property of the document? Could be, but you'd have to track through the gc info-roots to find out what's keeping what

Re: NSTableView: move rows through drag and drop?

2011-08-10 Thread Quincey Morris
On Aug 10, 2011, at 08:12 , Izak van Langevelde wrote: On 2011-08-10, at 10:40 AM, Peter Hudson wrote: I would do this as follows :- At the same time that you write rows to the pasteboard in the source table, store locally ( perhaps in the source table data source ) the row indexes

Re: NSTableView: move rows through drag and drop?

2011-08-10 Thread Jens Alfke
On Aug 9, 2011, at 8:43 PM, Izak van Langevelde wrote: Now I want to allow drag and drop from one document to another, and my first guess was to write the row data to the pasteboard. What puzzles me, is how to delete the row data from the source data, in case of a move. That is, my

Re: Font in TextFieldCell in Matrix

2011-08-10 Thread Jens Alfke
On Aug 10, 2011, at 2:21 AM, Gerriet M. Denkmann wrote: Where is my Osaka font gone? What am I doing wrong? The only thing I can think of is that the text system is deciding that Osaka doesn’t have glyphs for the Roman alphabet, and substituting a font that does instead (which will happen

Main menu update problem

2011-08-10 Thread Michael Domino
Hi, My app sometimes runs by being started by a launch agent. When that happens, the app in minimized in the Dock by calling the NSApplication method miniaturizeAll. That works fine. When the operation is complete, I want to again show the app, so I call the NSWindowController method

Re: NSTableView: move rows through drag and drop?

2011-08-10 Thread Izak van Langevelde
On 2011-08-10, at 5:11 PM, Jens Alfke wrote: On Aug 9, 2011, at 8:43 PM, Izak van Langevelde wrote: Now I want to allow drag and drop from one document to another, and my first guess was to write the row data to the pasteboard. What puzzles me, is how to delete the row data from the

Re: NSTableView: move rows through drag and drop?

2011-08-10 Thread Mark Munz
Docs say draggedImage:endedAt:operation: has been around since 10.0 In 10.7, NSDraggingSource became a formal protocol, but the informal protocol has been around a while. On Wed, Aug 10, 2011 at 2:30 PM, Izak van Langevelde eezac...@xs4all.nl wrote: On 2011-08-10, at 5:11 PM, Jens Alfke wrote:

Re: NSTableView: move rows through drag and drop?

2011-08-10 Thread Jens Alfke
On Aug 10, 2011, at 2:30 PM, Izak van Langevelde wrote: I considered it, but it seems to have been available since Lion, and am looking for something which works on older systems. No, Lion just added a new equivalent method -draggingSession:endedAtPoint:operation:, which will eventually

Re: Main menu update problem

2011-08-10 Thread Laurent Daudelin
On Aug 10, 2011, at 14:25, Michael Domino wrote: Hi, My app sometimes runs by being started by a launch agent. When that happens, the app in minimized in the Dock by calling the NSApplication method miniaturizeAll. That works fine. When the operation is complete, I want to again show

NSImage mouse events

2011-08-10 Thread Nial Giacomelli
I have a number of NSImages that I'm rendering in a custom NSView subclass. I'm looking to enlarge theses images as and when the user places their mouse over them and am wondering about the best way to go about doing this. Currently I'm using the NSView's drawRect: method to composite the images,

Re: NSTableView: move rows through drag and drop?

2011-08-10 Thread Izak van Langevelde
On 2011-08-10, at 5:37 PM, Jens Alfke wrote: On Aug 10, 2011, at 2:30 PM, Izak van Langevelde wrote: I considered it, but it seems to have been available since Lion, and am looking for something which works on older systems. No, Lion just added a new equivalent method

Re: NSImage mouse events

2011-08-10 Thread Seth Willits
On Aug 10, 2011, at 2:46 PM, Nial Giacomelli wrote: Currently I'm using the NSView's drawRect: method to composite the images, but also free to render them via NSImageView instances, if that will make things easier. My initial instinct was to setup NSTrackingArea's for each NSImage instance

Re: NSImage mouse events

2011-08-10 Thread Seth Willits
On Aug 10, 2011, at 3:48 PM, Seth Willits wrote: Currently I'm using the NSView's drawRect: method to composite the images, but also free to render them via NSImageView instances, if that will make things easier. My initial instinct was to setup NSTrackingArea's for each NSImage instance but

Re: Using #define a good way for String constants, like enums for NSIntegers?

2011-08-10 Thread Daniel DeCovnick
The disadvantage is if you need to use string constants across binaries (such as constants used by plugins). If you strip symbols, you can't use them at all (whereas you can use #defines from an imported header file). If you don't strip symbols, you still need to declare them as follows:

Re: NSImage mouse events

2011-08-10 Thread Graham Cox
On 11/08/2011, at 7:46 AM, Nial Giacomelli wrote: I have a number of NSImages that I'm rendering in a custom NSView subclass. I'm looking to enlarge theses images as and when the user places their mouse over them and am wondering about the best way to go about doing this. Currently I'm

getting a unique ID to store IAPs in keychain

2011-08-10 Thread Lou Zell
Hi Devs, I'm storing non-consumable In-App Purchases in the Keychain. I would like to query the Keychain using a key that is specific to the iTunes account that was used to make the purchase. It doesn't have to be the exact iTunes account name, just something that is unique per account. Does

Re: Lingering windows

2011-08-10 Thread Shane Stanley
On Aug 10, 2011, at 4:20 PM, Quincey Morris wrote: f you're setting this property just for convenience (after all, you can find the window controller later by examining [document windowControllers]), then maybe you really want this property to be a weak reference? Thanks for the suggestion.

[MEET] CocoaHeadsNYC this Thursday (tomorrow)

2011-08-10 Thread Andy Lee
When: Thu Aug 11, 2011, 6:30-8:00 PM, followed by pizza at Patsy's. Who: Avi Drissman, a developer on Google Chrome for Mac, will be our guest speaker. What: Avi's working title is Allocators Gonna Allocate: An unchecked allocation is an unfortunately popular security hole. Untrustworthy data

Re: Using #define a good way for String constants, like enums for NSIntegers?

2011-08-10 Thread Chris Hanson
If you're exporting symbols, you could have the visibility attribute be part of the macro you wrap around 'extern' anyway: #if defined(__cplusplus) #define MY_EXTERN extern C #else #define MY_EXTERN extern #endif #define MY_EXPORT MY_EXTERN __attribute__((visibility(default))) (The

how to get response code on HTTP request synchronous

2011-08-10 Thread Wilker
I'm trying to get the response code from an synchronous http request, Im trying the following code: NSURLResponse *response = nil; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:response error:err] But I can't find any method on NSURLRespond that has

Re: how to get response code on HTTP request synchronous

2011-08-10 Thread Andy Lee
I think instead of NSURLResponse you want to use NSHTTPURLResponse, which has a statusCode method. --Andy On Aug 10, 2011, at 11:40 PM, Wilker wrote: I'm trying to get the response code from an synchronous http request, Im trying the following code: NSURLResponse *response = nil;

Re: how to get response code on HTTP request synchronous

2011-08-10 Thread Wilker
Thanks Andy :) --- Wilker Lúcio http://about.me/wilkerlucio/bio Kajabi Consultant +55 81 82556600 On Thu, Aug 11, 2011 at 12:46 AM, Andy Lee ag...@mac.com wrote: I think instead of NSURLResponse you want to use NSHTTPURLResponse, which has a statusCode method. --Andy On Aug 10, 2011, at

CALayer opacity property type

2011-08-10 Thread Graham Cox
CALayer's 'opacity' property is defined thus: /* The opacity of the layer, as a value between zero and one. Defaults * to one. Specifying a value outside the [0,1] range will give undefined * results. Animatable. */ @property float opacity; Why is this a 'float' and not a 'CGFloat'?

UINavigationBar button look?

2011-08-10 Thread Rick Mann
Is there any way to make a UIButton that looks like the rectangular buttons with rounded corners, and text titles, that appear in a UINavigationBar? I have a need to add an extra button to a UINavigationBar, but I can't just add a UIButton or a UIBarButtonItem if there's already one there. So I

Flipped horizontal NSRulerView?

2011-08-10 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have a scroll view containing a view with plotted data (previously mentioned in my emails regarding plotting with NSBezierPath). I am considering using NSRulerViews as axis scales. I was able to configure the rulers to have the appropriate

Re: Flipped horizontal NSRulerView?

2011-08-10 Thread Graham Cox
On 11/08/2011, at 2:33 PM, Conrad Shultz wrote: However, this does not seem to have any effect in the horizontal dimension (which would be consistent with the documentation, which rather cryptically notes that horizontal rulers always assume a flipped coordinate system). Is there a way to

Re: Flipped horizontal NSRulerView?

2011-08-10 Thread Quincey Morris
On Aug 10, 2011, at 21:33 , Conrad Shultz wrote: I am considering using NSRulerViews as axis scales. I was able to configure the rulers to have the appropriate point-to-unit conversion factors, etc., but the one obstacle I have encountered is that the desired scales increment in opposite

Re: UINavigationBar button look?

2011-08-10 Thread Luther Baker
http://touchthatfruit.posterous.com/multiple-uibarbuttonitems-in-uinavigationbar On Wed, Aug 10, 2011 at 11:33 PM, Rick Mann rm...@latencyzero.com wrote: Is there any way to make a UIButton that looks like the rectangular buttons with rounded corners, and text titles, that appear in a

Re: Flipped horizontal NSRulerView?

2011-08-10 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/10/11 9:54 PM, Quincey Morris wrote: Did you try using negative scale factors in the custom ruler scale definition? If the rulers accept that, then you might also have to change the sign on your data values too, for drawing purposes. Yeah,

Re: UINavigationBar button look?

2011-08-10 Thread Rick Mann
Huh. Not sure how I feel about that approach, but I guess I'll give it a try. Thanks! On Aug 10, 2011, at 22:10 , Luther Baker wrote: http://touchthatfruit.posterous.com/multiple-uibarbuttonitems-in-uinavigationbar On Wed, Aug 10, 2011 at 11:33 PM, Rick Mann rm...@latencyzero.com wrote: Is

Re: Font in TextFieldCell in Matrix

2011-08-10 Thread Gerriet M. Denkmann
On 10 Aug 2011, at 23:17, Jens Alfke wrote: On Aug 10, 2011, at 2:21 AM, Gerriet M. Denkmann wrote: Where is my Osaka font gone? What am I doing wrong? The only thing I can think of is that the text system is deciding that Osaka doesn’t have glyphs for the Roman alphabet, and