Mapping APIs for use in Cocoa app

2010-10-26 Thread Darren Wheatley
Hi, I'm building a Mac / iPad app that displays simple maps to the user (map with location pin, allowing the user to pan and zoom). This is pretty easy to do with Google Maps, but AFAIK the API Ts&Cs prevent use in a commercial application unless a Google Premier API licence is purchased (£Ks)

Re: [NSImage] Bug in System Preferences? [solved]

2010-10-26 Thread Gregory Weston
Iceberg-Dev wrote: >> When working with NSBitmapImageRep, calling -bitmapData is a signal >> that you may be editing the data. It is not repackaged until the >> bitmap is drawn, or somesuch. It's illegal to just stash a pointer >> to the data and use it arbitrarily later - that won't necessa

What causes NSFileManager's stringWithFileSystemRepresentation to return nil?

2010-10-26 Thread G S
Hi all. I'm giving this function what appears to be a perfectly good path: /Users/me/Library/Application Support/iPhone Simulator/4.2/Applications/58BD5465-FD47-49E3-83AC-242961559F48/Library/Caches/4320_th.jpg and it returns nil. If I call UIImage's imageWithContentsOfFile with the same path,

Re: What causes NSFileManager's stringWithFileSystemRepresentation to return nil?

2010-10-26 Thread Graham Cox
Docs say: "Use this method if your code receives paths as C strings from system routines." Is that the case? If you're just building this string yourself, you can do so directly using NSString methods and this method isn't needed. However, NSURL is the up-and-coming way to represent paths anyw

Re: What causes NSFileManager's stringWithFileSystemRepresentation to return nil?

2010-10-26 Thread Andy Lee
On Oct 26, 2010, at 7:29 AM, G S wrote: > Hi all. I'm giving this function what appears to be a perfectly good path: > > /Users/me/Library/Application Support/iPhone > Simulator/4.2/Applications/58BD5465-FD47-49E3-83AC-242961559F48/Library/Caches/4320_th.jpg > > and it returns nil. Using the ex

Choosing a correct font size when resizing

2010-10-26 Thread Alexander Cohen
Hi, I have a specific layout that has known font sizes for certain page dimensions. I need to take that layout and resize it to fit it in multiple different places in my app. I can't just apply that resize ratio to the fonts, it just does not work. Is there a known way in cocoa to figure out th

Re: Choosing a correct font size when resizing

2010-10-26 Thread Ross Carter
On Oct 26, 2010, at 10:29 AM, Alexander Cohen wrote: > I have a specific layout that has known font sizes for certain page > dimensions. I need to take that layout and resize it to fit it in multiple > different places in my app. I can't just apply that resize ratio to the > fonts, it just does

Re: Choosing a correct font size when resizing

2010-10-26 Thread Alexander Cohen
Thats an interesting take, let me try that. thx AC On Oct 26, 2010, at 11:07 AM, Ross Carter wrote: > On Oct 26, 2010, at 10:29 AM, Alexander Cohen wrote: > >> I have a specific layout that has known font sizes for certain page >> dimensions. I need to take that layout and resize it to fit it

Re: Mapping APIs for use in Cocoa app

2010-10-26 Thread Conrad Shultz
Can you show where in the iOS API agreement this is stated? There would be many apps that violate it by using MapKit, I would think, if that is the case. While certain activities (e.g. geocoding and route finding) have special restrictions, the controlling section would appear to be 10.4: "Exc

QTMovieLayer performance

2010-10-26 Thread Jeff Schindler
Hello, We have a QTMovieLayer within a layer-backed view and are seeing stuttering issues when text is overlayed onto the video in another CALayer. The stutter happens when we change the text in the text layer (we are cutting between different blocks of text while a single movie plays in the b

Re: Choosing a correct font size when resizing

2010-10-26 Thread Jason Swain
For iOS what I do is use sizeWithFont:minFontSize:actualFontSize:forWidth: on NSString. What it does is gives you a font size that will fit the entire string within the width you specify given some constraints such as a minimum font size. Jason On 26 Oct 2010, at 15:29, Alexander Cohen wrote:

Re: Mapping APIs for use in Cocoa app

2010-10-26 Thread Darren Wheatley
Hi, Since my original posting I have found (as you note) that there are two sets of Ts&Cs: one for (iPhone / Map Kit) and one for other apps. The restrictions appear different, and so I have emailed the Google Premier API team for guidance. My interpretation of the terms for non-iphone apps

Make NSTextField register changes immediately

2010-10-26 Thread James Walker
I have an NSTextField with its value bound to a numeric property, and I'd like that value to change as soon as any typing occurs, without forcing the user to type enter or tab. Here's what I've tried: Check the "Continuous" control attribute. No effect. Check "Validates Immediately" on the b

Re: Make NSTextField register changes immediately

2010-10-26 Thread Keary Suska
On Oct 26, 2010, at 1:14 PM, James Walker wrote: > I have an NSTextField with its value bound to a numeric property, and I'd > like that value to change as soon as any typing occurs, without forcing the > user to type enter or tab. Here's what I've tried: > > Check the "Continuous" control att

Re: Thread not registered mystery under GC

2010-10-26 Thread Andy O'Meara
Thanks for your help, Bill -- your suggestion (plus an extern "C" declaration) causes the error to go away! Radar filed -- 8595912 Many Thanks, Andy P.S. It's in the radar, but the doc URL is http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/GarbageCollection/GarbageColl

Re: Thread not registered mystery under GC

2010-10-26 Thread Sean McBride
On Mon, 25 Oct 2010 15:19:45 -0700, Bill Bumgarner said: >Yes. Call objc_registerThreadWithCollector() from the thread. And presumably objc_unregisterThreadWithCollector() at the end of your thread's function... yes? Andy, also beware that those two functions are not properly marked as weak, an

Re: Make NSTextField register changes immediately

2010-10-26 Thread James Walker
On 10/26/2010 12:24 PM, Keary Suska wrote: On Oct 26, 2010, at 1:14 PM, James Walker wrote: I have an NSTextField with its value bound to a numeric property, and I'd like that value to change as soon as any typing occurs, without forcing the user to type enter or tab. Here's what I've tried:

Re: Thread not registered mystery under GC

2010-10-26 Thread Bill Bumgarner
On Oct 26, 2010, at 12:42 PM, Sean McBride wrote: > And presumably objc_unregisterThreadWithCollector() at the end of your > thread's function... yes? Yes; it'll happen automatically on thread death, effectively. Registering/unregistering a thread on the fly isn't really something that is

Re: Thread not registered mystery under GC

2010-10-26 Thread Greg Parker
On Oct 26, 2010, at 1:07 PM, Bill Bumgarner wrote: > On Oct 26, 2010, at 12:42 PM, Sean McBride wrote: >> And presumably objc_unregisterThreadWithCollector() at the end of your >> thread's function... yes? > > Yes; it'll happen automatically on thread death, effectively. > > Registering/unregis

Re: [NSImage] Bug in System Preferences? [solved]

2010-10-26 Thread Stephane Sudre
On Tue, Oct 26, 2010 at 4:14 AM, Gregory Weston wrote: > Iceberg-Dev wrote: > >>> When working with NSBitmapImageRep, calling -bitmapData is a signal >>> that you may be editing the data. It is not repackaged until the >>> bitmap is drawn, or somesuch. It's illegal to just stash a pointer >>> to t

Basic Q: reading properties from nil

2010-10-26 Thread Rick Mann
Hi. I've run into a bug, and I'm wondering if I'm expecting the wrong behavior. If I do this: UIWindow* win = nil;// In reality, it's coming from somewhere else, but it's nil CGRect frame = win.bounds; Should I expect frame to be all zero? That's what I thought was the case, but I'm getti

Re: Basic Q: reading properties from nil

2010-10-26 Thread Nick Zitzmann
On Oct 26, 2010, at 3:13 PM, Rick Mann wrote: > Hi. I've run into a bug, and I'm wondering if I'm expecting the wrong > behavior. If I do this: > > UIWindow* win = nil; // In reality, it's coming from somewhere else, but > it's nil > CGRect frame = win.bounds; > > Should I expect frame to b

Re: Basic Q: reading properties from nil

2010-10-26 Thread Rick Mann
On Oct 26, 2010, at 14:31:11, Nick Zitzmann wrote: > > On Oct 26, 2010, at 3:13 PM, Rick Mann wrote: > >> Hi. I've run into a bug, and I'm wondering if I'm expecting the wrong >> behavior. If I do this: >> >> UIWindow* win = nil; // In reality, it's coming from somewhere else, but >> it's n

Re: Basic Q: reading properties from nil

2010-10-26 Thread Sean McBride
On Tue, 26 Oct 2010 14:13:23 -0700, Rick Mann said: >Hi. I've run into a bug, and I'm wondering if I'm expecting the wrong >behavior. If I do this: > >UIWindow* win = nil; // In reality, it's coming from somewhere else, >but it's nil >CGRect frame = win.bounds; > >Should I expect frame to be al

Re: Basic Q: reading properties from nil

2010-10-26 Thread Greg Parker
On Oct 26, 2010, at 2:33 PM, Rick Mann wrote: > Sure seems like a conceptual inconsistency, but I guess whoever designed the > language thought it was too expensive to return a zeroed struct. It's an artifact of C compatibility. On each architecture, Objective-C messages follow the same paramete

Re: Basic Q: reading properties from nil

2010-10-26 Thread Rick Mann
On Oct 26, 2010, at 15:47:09, Greg Parker wrote: > On Oct 26, 2010, at 2:33 PM, Rick Mann wrote: >> Sure seems like a conceptual inconsistency, but I guess whoever designed the >> language thought it was too expensive to return a zeroed struct. > > It's an artifact of C compatibility. On each a

Re: [NSImage] Bug in System Preferences? [solved]

2010-10-26 Thread Gregory Weston
On Oct 26, 2010, at 16:29, Stephane Sudre wrote: > On Tue, Oct 26, 2010 at 4:14 AM, Gregory Weston wrote: >> Iceberg-Dev wrote: >> When working with NSBitmapImageRep, calling -bitmapData is a signal that you may be editing the data. It is not repackaged until the bitmap is drawn,

Unrecognized selector

2010-10-26 Thread koko
I do this in a .mm file: Str ext = bfn.GetExtension(); if(!ext.CompareNoCase("pcm")) { Str path = bfn.GetPath(); NSString *nspath = [NSString stringWithCString:(const char*)path encoding:NSUTF8StringEncoding];

Re: Unrecognized selector

2010-10-26 Thread Stephen J. Butler
On Tue, Oct 26, 2010 at 7:42 PM, wrote: > dictionaryWithObjects:[NSArray arrayWithObjects:@"PCS",@"PCDA",nil] > forKeys:[NSArray > arrayWithObjects:NSFileHFSTypeCode,NSFileHFSCreatorCode,nil]]; > -[NSCFString unsignedLongValue]: unrecognized selector sent to instance > 0x446990 NSFileHFSTypeCod

Re: Unrecognized selector

2010-10-26 Thread koko
Great, that worked for me! Thanks. -koko On Oct 26, 2010, at 6:55 PM, Stephen J. Butler wrote: On Tue, Oct 26, 2010 at 7:42 PM, wrote: dictionaryWithObjects:[NSArray arrayWithObjects:@"PCS",@"PCDA",nil] forKeys:[NSArray arrayWithObjects:NSFileHFSTypeCode,NSFileHFSCreatorCode,nil]]; -[NSCF

NSFileManager and Resource Forks

2010-10-26 Thread koko
Is there a way to write a resource fork for a file at a path? -koko ___ 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.

Re: NSFileManager and Resource Forks

2010-10-26 Thread Steve Christensen
On Oct 26, 2010, at 7:26 PM, k...@highrolls.net wrote: > Is there a way to write a resource fork for a file at a path? I don't believe that NSFileManager knows about resource files, either in the resource or data fork. You can use Resource Manager routines FSCreateResourceFile() or FSCreateRes

Programmatically adjusting NSValueTransformer of a bound NSTextField

2010-10-26 Thread Kiel Gillard
Hi all, Can you please look at this very small and rough reproduction of my problem . I want to present measured values of my model with respect to the user's locale. For example, I want to present a distance in imperial units of measure

No Driver Dependencies

2010-10-26 Thread kirankumar
Hi All, I am using 64-bit MacBookPro.My question is i open the terminal and type kextstat i saw the below kpi.xxx,but there is no com.apple.kernel.bsd, com.apple.kernel.iokit, com.apple.kernel.libkern, com.apple.kernel.mach. For that i need to install any other file. 2 23 0x00x0

Re: Programmatically adjusting NSValueTransformer of a bound NSTextField

2010-10-26 Thread Kiel Gillard
Hey guys, Please ignore my post. It's been a long day and I had one very bad return value in one of my value transformers. It always helps to take a break and return to the problem with a fresh perspective! Kiel On 27/10/2010, at 3:45 PM, Kiel Gillard wrote: > Hi all, > > Can you please look

WebView in NSTabView

2010-10-26 Thread Ivan C Myrvold
My application has an NSTabView with three tabs. The second tab, EPG, has an ordinary NSTableView: http://www.myrvold.org/cocoa/myrdream/images/epgbefore.jpg The third tab, WebTV, has a WebView, which fetches content from a local Linux satellite box: http://www.myrvold.org/cocoa/myrdream/images

Re: NSFileManager and Resource Forks

2010-10-26 Thread Charles Srstka
On Oct 26, 2010, at 9:26 PM, k...@highrolls.net wrote: > Is there a way to write a resource fork for a file at a path? If you want to read/write individual resources, you’ll have to use the Carbon Resource Manager. However, if you want to read/write the resource map directly to/from the file, y