Bindings and MenuItems

2009-04-01 Thread Ben Lachman
I have a menu item that is bound to a target. The menu is resides in has Auto Enables Items checked which means that it should call - validateMenuItem on a items target if it is available. However validate is never called on the target. If I remove the binding and set the target to one

Re: Shortcut handling in different keyboard layouts

2009-04-01 Thread Rimas M.
In that case, you'd want to use the virtual keycode - available as [event keyCode] - rather than the character code. I thought when you'd posted your original question, though, you said that you wanted your keyboard event matching to be dependent on the keyboard layout, so that if you used,

Persistent store removal throwing invalidated NSManagedObject exceptions

2009-04-01 Thread Drew McCormack
I've setup a temporary managed object context to export data to an external XML file (persistent store). When I remove the persistent store from the context, I am getting errors like this: Exception raised during posting of notification. Ignored. exception: 'The NSManagedObject with

Re: Persistent store removal throwing invalidated NSManagedObject exceptions

2009-04-01 Thread Jonathan Dann
On 1 Apr 2009, at 11:20, Drew McCormack wrote: I've setup a temporary managed object context to export data to an external XML file (persistent store). When I remove the persistent store from the context, I am getting errors like this: [...] This has been included to remove the object

Re: Bindings and MenuItems

2009-04-01 Thread Andy Lee
On Apr 1, 2009, at 3:34 AM, Ben Lachman wrote: I have a menu item that is bound to a target. The menu is resides in has Auto Enables Items checked which means that it should call - validateMenuItem on a items target if it is available. However validate is never called on the target. If I

Re: Best Strategy to Control iTunes

2009-04-01 Thread has
Michael Ash wrote: On Tue, Mar 31, 2009 at 3:57 PM, Luca C. luca.pazzere...@gmail.com wrote: 2009/3/31 Ammar Ibrahim ammar.ibra...@gmail.com If I want to add a track to iTunes, I need to make sure iTunes is responsive. Are you sure it is that important? Actually, if you run an AS script

xml parsing

2009-04-01 Thread developers mac
Hi there, I have to parse a xml return the values for val id (attribute). I have pasted a sample xml below. response field values val id=AL Alabama/val . . . val id=WYWyoming/val /values /field field values val id=1Australia/val . . . val id=150Zambia/val /values /field /response I am able to

Saving Address Book for more than 1000 recrods

2009-04-01 Thread Vijay Kanse
Hello list, I tried simple program that add first name and last name to address book. I just loop it to 3000 times. I am saving the address book outside the loop. but when it executes its [book save] command, my application goes in to Not responding mode for few seconds. Then i tried to save it

disable row highlighting NSTableView

2009-04-01 Thread Jo Phils
Hello everyone, This seems it should be easy enough but I can't quite figure it out. Normally when selecting an item in a table view it gets highlighted blue. How do you disable this highlighting? Thank you, Rick ___ Cocoa-dev mailing

Re: How to know when a UISwitch is being touched

2009-04-01 Thread Brian Slick
We may be able to combine forces here. What I was doing gets the correct answer from the switch, but what I was finding is that certain circumstances do not result in a message being sent from the switch. I forget just now which circumstance it was, but I believe it was a direct tap on

Re: Delayed Undo Problem

2009-04-01 Thread Richard Somers
On Mar 30, 2009, at 5:55 AM, Richard Somers wrote: I have a basic core data document based application (Hillegass 3rd Edition, Chapter 11, CarLot). With a single primary window every thing works. Then a second window is added with a generic master detail interface using the core data

Re: disable row highlighting NSTableView

2009-04-01 Thread Jens Miltner
Am 01.04.2009 um 15:58 schrieb Jo Phils: Hello everyone, This seems it should be easy enough but I can't quite figure it out. Normally when selecting an item in a table view it gets highlighted blue. How do you disable this highlighting? This was answered just a few days ago on this

Re: [BUG] Cursor Flicker

2009-04-01 Thread Eric Gorr
On Mar 31, 2009, at 9:18 PM, Graham Cox wrote: On 01/04/2009, at 4:46 AM, Eric Gorr wrote: There is a bug when changing from [[NSCursor arrowCursor] set] to a NSCursor based on a 64x64 PNG. Basically, there is some horrible cursor flickering. For a demonstration of this bug, please

Re: Persistent store removal throwing invalidated NSManagedObject exceptions

2009-04-01 Thread Drew McCormack
Hi Drew, When writing a custom to-many accessor in an NSManagedObject subclass, you need to invoke the correct KVO -will/didChange methods These are: -[NSManagedObject willChangeValueForKey:withSetMutation:usingObjects:] -[NSManagedObject didChangeValueForKey:withSetMutation:usingObjects:]

Re: NSMutableArray is null?

2009-04-01 Thread Pierce Freeman
Hey Graham : Yeah, I finally figured that out. ;) It now works like a charm. On 3/31/09 7:20 PM, Graham Cox graham@bigpond.com wrote: On 01/04/2009, at 1:16 PM, Pierce Freeman wrote: The global variable is in the Controller.h... Is this what you are asking for? No. Just

Re: Shortcut handling in different keyboard layouts

2009-04-01 Thread Peter Castine
Matching on keycode will almost always confuse your users. There are at least 9 different Cyrillic keyboard layouts supported by OS X. If you write code that matches the virtual keycode for 2nd rank 11th key, it will match з (ze) for half or those layouts and п (pe) for the other half.

Handling List of Hardware Devices in NSTableView w/ Asynchronous Updates

2009-04-01 Thread Grant Erickson
I've a list of hardware devices in an NSTableView. The contents of the table view are updated accordingly using the device model (C++) getters in objectValueForTableColumn and using the device model setters in setObjectValue. However, the device model can also asynchronously create (sometimes

Re: Best Strategy to Control iTunes

2009-04-01 Thread Sean McBride
On 4/1/09 12:25 PM, has said: ObjC-appscript is almost entirely thread-safe. You'll need to watch when using methods that rely on the Carbon Process Manager (some initializers, -isRunning) as the PM APIs don't appear to be thread- safe itself Looking through Processes.h, it would appear that all

Re: Handling List of Hardware Devices in NSTableView w/ Asynchronous Updates

2009-04-01 Thread Michael Ash
On Wed, Apr 1, 2009 at 10:51 AM, Grant Erickson erick...@umn.edu wrote: I've a list of hardware devices in an NSTableView. The contents of the table view are updated accordingly using the device model (C++) getters in objectValueForTableColumn and using the device model setters in

Re: NSMutableArray is null?

2009-04-01 Thread I. Savant
On Wed, Apr 1, 2009 at 10:33 AM, Pierce Freeman piercefreema...@comcast.net wrote: Yeah, I finally figured that out. ;) It now works like a charm. Just for completeness, the plain-language concept to remember is: // Let there be an NSMutableArray pointer named 'globalVariable'.

Re: Bindings and MenuItems

2009-04-01 Thread Keary Suska
On Apr 1, 2009, at 3:34 AM, Ben Lachman wrote: I have a menu item that is bound to a target. The menu is resides in has Auto Enables Items checked which means that it should call - validateMenuItem on a items target if it is available. However validate is never called on the target. If I

Re: Best Strategy to Control iTunes

2009-04-01 Thread has
On Apr 1, 2009, at 3:57 PM, Sean McBride wrote: On 4/1/09 12:25 PM, has said: ObjC-appscript is almost entirely thread-safe. You'll need to watch when using methods that rely on the Carbon Process Manager (some initializers, -isRunning) as the PM APIs don't appear to be thread- safe itself

Re: Saving Address Book for more than 1000 recrods

2009-04-01 Thread Nick Zitzmann
On Apr 1, 2009, at 7:17 AM, Vijay Kanse wrote: is This a behavior of address book for more than 1000 records ? if it is, how can i fix it? You can't. As you've discovered, the AddressBook framework is rather slow when it comes to large batch operations, and has been since they

Re: disable row highlighting NSTableView

2009-04-01 Thread Jo Phils
Thank you for your reply and my apologies for asking what had been answered a few days ago. :-) It does lead me to another question though...I'm still a beginner and I have never overridden a method via subclassing before. Is there a tutorial you might be able to point me to that could show

Re: disable row highlighting NSTableView

2009-04-01 Thread I. Savant
On Wed, Apr 1, 2009 at 11:54 AM, Jo Phils jo_p...@yahoo.com wrote: Thank you for your reply and my apologies for asking what had been answered a few days ago. :-)  It does lead me to another question though...I'm still a beginner and I have never overridden a method via subclassing before.  

Re: user access privileges to plist in /library/preferences

2009-04-01 Thread Memo Akten
Hi Greg, actually /Users/Shared didn't work either. If I am logged in as admin it works, but if I am logged in as a normal user it doesn't. My code is: #define LOG_PATH_FOLDER @/Users/Shared/Library/Preferences/ #define LOG_FILENAME@MyLog.plist #define LOG_PATH

Re: Shortcut handling in different keyboard layouts

2009-04-01 Thread Rimas M.
Matching on keycode will almost always confuse your users. There are at least 9 different Cyrillic keyboard layouts supported by OS X. If you write code that matches the virtual keycode for 2nd rank 11th key, it will match з (ze) for half or those layouts and п (pe) for the other half. Your

Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?

2009-04-01 Thread James Montgomerie
This is not doing exactly what you think it is. You are certainly right that UIKit calls should /always/ be made from the main thread, but the performSelector:withObject:AfterDelay method actually performs the selector on the same thread that you call it from, not a separate thread. This

Re: Handling List of Hardware Devices in NSTableView w/ Asynchronous Updates

2009-04-01 Thread Steve Christensen
On Apr 1, 2009, at 7:51 AM, Grant Erickson wrote: I've a list of hardware devices in an NSTableView. The contents of the table view are updated accordingly using the device model (C++) getters in objectValueForTableColumn and using the device model setters in setObjectValue. However, the

Re: Launching a preference pane from inside a Cocoa app

2009-04-01 Thread Mark Suman
The part that's tripping me up is launch System Preferences and then opening a certain pane. In Apple Script, I'd say: *tell* application System Preferences activate *set* *the* current pane *to* pane id com.foo.prefpane *end* *tell* [[NSWorkspace sharedWorkspace]

Re: [BUG] Cursor Flicker

2009-04-01 Thread Shawn Erickson
On Wed, Apr 1, 2009 at 7:28 AM, Eric Gorr mail...@ericgorr.net wrote: In the real application, there are some cursors based on 64x64 images. When switching to these cursors, one sees the cursor quickly jump to a different position and then back to where it should be. This is very jarring and

Re: Launching a preference pane from inside a Cocoa app

2009-04-01 Thread Sherm Pendley
On Wed, Apr 1, 2009 at 1:54 PM, Mark Suman mwsu...@gmail.com wrote: The part that's tripping me up is launch System Preferences and then opening a certain pane. Just open the .prefPane bundle itself - System Preferences.app knows how to handle the rest. For instance: [[NSWorkspace

Re: [BUG] Cursor Flicker

2009-04-01 Thread Eric Gorr
On Apr 1, 2009, at 2:04 PM, Shawn Erickson wrote: On Wed, Apr 1, 2009 at 7:28 AM, Eric Gorr mail...@ericgorr.net wrote: In the real application, there are some cursors based on 64x64 images. When switching to these cursors, one sees the cursor quickly jump to a different position and

Re: [BUG] Cursor Flicker

2009-04-01 Thread Eric E. Dolecki
A quick question - why are you using a 64x64 image? Couldn't you use a smaller image? E. On Wed, Apr 1, 2009 at 2:09 PM, Eric Gorr mail...@ericgorr.net wrote: On Apr 1, 2009, at 2:04 PM, Shawn Erickson wrote: On Wed, Apr 1, 2009 at 7:28 AM, Eric Gorr mail...@ericgorr.net wrote: In the

Re: Bindings and MenuItems

2009-04-01 Thread Ben Lachman
I mean a Cocoa bindings kind of binding. e.g. the target binding of the menu item is bound in IB. The action field of the binding is set to print:. I'm not talking about the traditional way of connecting a button/menu item to another object through the basic control drag from source to

Re: Launching a preference pane from inside a Cocoa app

2009-04-01 Thread Mark Suman
I have a tendency to overcomplicate things. Thanks for the simple solution. That worked like a charm. Mark On Wed, Apr 1, 2009 at 12:07 PM, Sherm Pendley sherm.pend...@gmail.comwrote: On Wed, Apr 1, 2009 at 1:54 PM, Mark Suman mwsu...@gmail.com wrote: The part that's tripping me up is

Re: [BUG] Cursor Flicker

2009-04-01 Thread Andy Lee
On Apr 1, 2009, at 2:09 PM, Eric Gorr wrote: On Apr 1, 2009, at 2:04 PM, Shawn Erickson wrote: On Wed, Apr 1, 2009 at 7:28 AM, Eric Gorr mail...@ericgorr.net wrote: In the real application, there are some cursors based on 64x64 images. When switching to these cursors, one sees the cursor

Re: Best Strategy to Control iTunes

2009-04-01 Thread Ammar Ibrahim
On Wed, Apr 1, 2009 at 12:15 AM, Nate Weaver natewea...@xtechllc.comwrote: On Mar 30, 2009, at 5:44 PM, Ammar Ibrahim wrote: - It's known that if any dialog is open in iTunes it freezes any communication through the scriptable interface, how can I detect that and put all my messages in

Re: Best Strategy to Control iTunes

2009-04-01 Thread Ammar Ibrahim
On Wed, Apr 1, 2009 at 2:25 PM, has hengist.p...@virgin.net wrote: Michael Ash wrote: On Tue, Mar 31, 2009 at 3:57 PM, Luca C. luca.pazzere...@gmail.com wrote: 2009/3/31 Ammar Ibrahim ammar.ibra...@gmail.com If I want to add a track to iTunes, I need to make sure iTunes is responsive.

Re: Best Strategy to Control iTunes

2009-04-01 Thread Luca C.
2009/4/1 Michael Ash michael@gmail.com No, don't do this. AppleScript is not safe to use outside the main thread. If you must run AppleScript asynchronously, either spawn a subprocess to run it or, better yet, don't use AS at all but send Apple Events in some other way, such as with

Re: NS - CG Rect Conversion and screen coordinates

2009-04-01 Thread Peter Ammon
On Mar 31, 2009, at 9:34 PM, Trygve Inda wrote: Using these two calls: NSRect nsRect = [screen frame]; CGRect cgRect = CGDisplayBounds (displayID); I get for my two screens: NSx=0y=0 w=2560h=1600 // screen A CGx=0y=0 w=2560h=1600 NSx=-1920

Re: Persistent store removal throwing invalidated NSManagedObject exceptions

2009-04-01 Thread Jonathan Dann
Thanks Jonathan. You're absolutely right. However, when I made the appropriate changes, I have the same issue: with my new custom remove... accessor, I get the exception, and without the custom accessor, there is no exception. So something strange is still going on. Here is the new

re:Persistent store removal throwing invalidated NSManagedObject exceptions

2009-04-01 Thread Ben Trumbull
I've setup a temporary managed object context to export data to an external XML file (persistent store). When I remove the persistent store from the context, I am getting errors like this: Exception raised during posting of notification. Ignored. exception: 'The NSManagedObject with

Re: Best Strategy to Control iTunes

2009-04-01 Thread Ammar Ibrahim
On Wed, Apr 1, 2009 at 10:21 PM, Luca C. luca.pazzere...@gmail.com wrote: 2009/4/1 Michael Ash michael@gmail.com No, don't do this. AppleScript is not safe to use outside the main thread. If you must run AppleScript asynchronously, either spawn a subprocess to run it or, better

How to synchronize two managedObjectContexts...

2009-04-01 Thread Jon C. Munson II
Namaste! I'm having trouble with an implementation of drag-and-drop for a core-data-based application. Scenario: I'm implementing the drag destination for file names coming from an application (like Finder). The receiving window will take the filenames and create the appropriate records for

Re: Saving Address Book for more than 1000 recrods

2009-04-01 Thread Ben Trumbull
On Apr 1, 2009, at 7:17 AM, Vijay Kanse wrote: is This a behavior of address book for more than 1000 records ? if it is, how can i fix it? You can't. As you've discovered, the AddressBook framework is rather slow when it comes to large batch operations, and has been since they switched from

Re: user access privileges to plist in /library/preferences

2009-04-01 Thread Greg Guerin
Memo Akten wrote: Hi Greg, actually /Users/Shared didn't work either. If I am logged in as admin it works, but if I am logged in as a normal user it doesn't. My code is: #define LOG_PATH_FOLDER @/Users/Shared/Library/Preferences/ #define LOG_FILENAME @MyLog.plist #define LOG_PATH

Re: Bindings and MenuItems

2009-04-01 Thread Keary Suska
On Apr 1, 2009, at 12:31 PM, Ben Lachman wrote: I mean a Cocoa bindings kind of binding. e.g. the target binding of the menu item is bound in IB. The action field of the binding is set to print:. I'm not talking about the traditional way of connecting a button/menu item to another

Re: Best Strategy to Control iTunes

2009-04-01 Thread Luca C.
2009/4/1 Ammar Ibrahim ammar.ibra...@gmail.com On Wed, Apr 1, 2009 at 10:21 PM, Luca C. luca.pazzere...@gmail.com wrote I didn't realize the unsafety of NSAppleScript - so I have been quite lucky, because my usage of applescript in non-main threads haven't caused me any problems.

Re: XMLParser

2009-04-01 Thread Marcel Weiher
If you like that type of higher-level, more Objective-C-like approach, you might want to have a look at Objective-XML, and more specifically the MAX parser ( MAX = Message oriented API for XML): http://www.metaobject.com/blog/2009/01/iphone-xml-performance.html

Re: Best Strategy to Control iTunes

2009-04-01 Thread Bill Bumgarner
On Apr 1, 2009, at 2:04 PM, ammar.ibrahim wrote: Right now, I'm more confused than I was, hehe. My question is: Why would I care about thread safety? Assuming that everytime I communicate with iTunes I create a thread and have the communication happen from there, even if it's blocking and

Re: NS - CG Rect Conversion and screen coordinates

2009-04-01 Thread Jesper Storm Bache
Forgive me for being dense. Where is the subtle bug? The code is using CGMainDisplayID (not [NSScreen mainScreen] which would be the display with the key window) CGMainDisplayID is documented as: === The main display is the display with its screen location at (0,0) in global

Re: NS - CG Rect Conversion and screen coordinates

2009-04-01 Thread Peter Ammon
My mistake, I saw mainScreenRect and assumed it was the frame of what Cocoa calls the main screen. -Peter On Apr 1, 2009, at 2:52 PM, Jesper Storm Bache wrote: Forgive me for being dense. Where is the subtle bug? The code is using CGMainDisplayID (not [NSScreen mainScreen] which would be

NSAccessibilityLinkedUIElementsAttributes

2009-04-01 Thread Rich Collyer
Are there any samples of using NSAccessibilityLinkedUIElementsAttribute? Specifically, I need to do something like what iTunes does where it links the outline view in the left navigation with the content view in the middle. +++ Rich Collyer - Senior Software Engineer

Cocoa Access to iPhone info

2009-04-01 Thread Jeff Laing
My boss has just discovered the iPhone Field Test mode (described here: http://www.wirelessinfo.com/content/inside-the-iphone-field-test-mode.ht m) and was wondering whether there is a mechanism for a regular Cocoa app to get at that Cell information. I'm guessing the answer is no, but I figured

Re: NS - CG Rect Conversion and screen coordinates

2009-04-01 Thread Jesper Storm Bache
Good (otherwise I would have had to change a few things on my side). The term main is very confusing and I did log the following radar a while back. 6392495 Confusing documentation for NSScreen It looks like it has been fixed (and is ready to be included in a future documentation

Re: Why does -[NSURLConnection start] crash?

2009-04-01 Thread Jeff Johnson
Thanks, Dave. The first link does seem to have a workaround for the crash. (Not sure the second link is the same problem, though.) Bug filed: rdar://problem/6747757 The question is whether this is a framework bug or just a documentation bug. Can anyone from Apple please clarify this?

Double Clicks in an NSTextView.

2009-04-01 Thread Тимофей Даньшин
Hello. I would like to be able to intercept double clicks on the text in an NSTextView even if the text is not a link and is not in an NSTextAttachmentCell. I did try to do this by implementing the textView: willChangeSelectionFromCharacterRange: toCharacterRange and comparing the

Line height of drawWithRect:options: seems a bit messed up

2009-04-01 Thread Yung-Luen Lan
Hi, I have some code that draws attributed string to a given location using given fonts/sizes/styles with [NSAttributedString drawWithRect:options:]. However, I found that the string were not aways aligned to top on some fonts when I supply NSStringDrawingUsesLineFragmentOrigin option, which

Re: Double Clicks in an NSTextView.

2009-04-01 Thread Martin Wierschin
I would like to be able to intercept double clicks on the text in an NSTextView even if the text is not a link and is not in an NSTextAttachmentCell. I did try to do this by implementing the textView: willChangeSelectionFromCharacterRange: toCharacterRange and comparing the initial and the

Re: NSMutableArray is null?

2009-04-01 Thread Pierce Freeman
Yeah, it helps a lot... And hopefully anyone that has this problem will look at this before writing to any support site. :) On 4/1/09 8:06 AM, I. Savant idiotsavant2...@gmail.com wrote: On Wed, Apr 1, 2009 at 10:33 AM, Pierce Freeman piercefreema...@comcast.net wrote: Yeah, I finally

Re: How to detect curly quotes

2009-04-01 Thread John Engelhart
On Tue, Mar 31, 2009 at 6:21 PM, Steve Cronin steve_cro...@mac.com wrote: Folks; I'm reading input from a text file (stringWithContentsOfFile) I have no control over. Testing is going well until a I encounter a phrase is wrapped in curly quotes. (Note phrases wrapped in straight quotes are

App icon

2009-04-01 Thread fawad shafi
Dear All, i m developing one application, my requirement is that when the user opens the application first time in simulator, i want to display 1.icn file as an app icn, and if not the first time. then i wana display 2.icn. is it possible? Regards, Fawad Shafi

Re: How to know when a UISwitch is being touched

2009-04-01 Thread Joan Lluch-Zorrilla
Using isOn gives you whether the switch is on of off. I'm not sure if this is what you are looking for. In my case I wanted to know whether the user is manipulating (touching) the switch, regardless of its state. I found a way to do it. The code is as follows: Add this upon creation of the

Re: How to detect curly quotes

2009-04-01 Thread Dave DeLong
Just to chime in The RegexKit linked below is absolutely FANTASTIC. I use it pretty much any time I need to do beyond-basic text manipulation. RegexKitLite is some NSString categories, allowing you to do things like [myString isMatchedByRegex:@some regex] and so on. It's incredibly

Re: App icon

2009-04-01 Thread Dave DeLong
Not without hacking something, no. The bundle directory is write- protected, which means you can't alter Info.plist (which is where the icon is specified). Dave On Apr 1, 2009, at 9:44 AM, fawad shafi wrote: Dear All, i m developing one application, my requirement is that when the user

Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?

2009-04-01 Thread WT
Indeed. I actually already knew that - performSelector:withObject:afterDelay: executes in the caller's thread but, in n my haste to throw together a quick test, succumbed to my thread-safety obsession (thanks to years of Java programming). No harm, though. I ended up doing something

Re: How to know when a UISwitch is being touched

2009-04-01 Thread Brian Slick
For my case, I just needed to know when the value changed. So I adapted what you came up with to look like this: [switchView addTarget:self action:@selector(switchTouched:) forControlEvents:UIControlEventValueChanged]; UIControlEventAllTouchEvents was sending 3 messages to switchTouched:

Re: App icon

2009-04-01 Thread Kiel Gillard
NSApplication provides the instance method setApplicationIconImage: At startup (say, the applicationDidFinishLaunching: method) you could determine what icon you need to display and set it, using the above method, to the appropriate icns file from your bundle. Note that this will not

Re: App icon

2009-04-01 Thread Dave DeLong
Given that he mentioned running it in the simulator, I was guessing that he was asking about an iPhone application (upon which assumption I based my answer). Dave On Apr 1, 2009, at 6:24 PM, Kiel Gillard wrote: NSApplication provides the instance method setApplicationIconImage: At

Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?

2009-04-01 Thread WT
Indeed. I actually already knew that - performSelector:withObject:afterDelay: executes in the caller's thread but, in n my haste to throw together a quick test, succumbed to my thread-safety obsession (thanks to years of Java programming). No harm, though. I ended up doing something

Re: App icon

2009-04-01 Thread Kiel Gillard
That's ok, his original question said first time in simulator so I figured his app had some sort of simulator mode for its first launch. Kiel On 02/04/2009, at 11:26 AM, Dave DeLong wrote: Given that he mentioned running it in the simulator, I was guessing that he was asking about an

Re: Looking for [NSNumber numberWithString:]

2009-04-01 Thread Bryan Henry
There is no -numberWithString:, no. You'd need to do something like [NSNumber numberWithDouble:[someStr doubleValue]]. - Bryan On Apr 1, 2009, at 9:17 PM, Greg Robertson wrote: I would like to convert an NSString to an NSNumber. Is there a direct method for this or should I go NSString to

Re: Looking for [NSNumber numberWithString:]

2009-04-01 Thread Kiel Gillard
As far as I know, this is the simplest way: NSNumber *number = [NSNumber numberWithDouble:[@3.14159 doubleValue]]; Kiel On 02/04/2009, at 12:17 PM, Greg Robertson wrote: I would like to convert an NSString to an NSNumber. Is there a direct method for this or should I go NSString to double and

Looking for [NSNumber numberWithString:]

2009-04-01 Thread Greg Robertson
I would like to convert an NSString to an NSNumber. Is there a direct method for this or should I go NSString to double and then double to NSNumber? Thanks Greg ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

NSPopUpButton pullsDown:YES and dummy first item - normal?

2009-04-01 Thread Rua Haszard Morris
I am using a pull-down NSPopUpButton for a little button which displays a little menu. The menu has some commands in it, i.e. it's not a selection menu, the title of the button just displays an icon, no title, no indication of a current item from the menu. I am calling (ahem, sending)

Obj-C equivalent to Python generator functions

2009-04-01 Thread Sam Krishna
Does anyone here know of any Obj-C functional equivalent to Python generator functions? These are *categorically* different that the Spotlight API generator functions. Here's a link in case you're not familiar with them: http://is.gd/qcYt Any ideas? Live Playfully, Sam - If he

Seeking advice on best practice for managing visibility of many subviews

2009-04-01 Thread Stuart Malin
I have a view that has hundreds of subviews. The user can control filters which causes different of the subviews to be presented; the collection of selected-for-presentation subviews are repositioned in the super view. I can think of two ways to handle this, and am not sure which is best:

Re: Obj-C equivalent to Python generator functions

2009-04-01 Thread Andrew Farmer
On 01 Apr 09, at 19:04, Sam Krishna wrote: Does anyone here know of any Obj-C functional equivalent to Python generator functions? These are *categorically* different that the Spotlight API generator functions. Depends on what you're after. If all you need is to be able to iterate over an

Re: Cocoa Access to iPhone info

2009-04-01 Thread Andrew Farmer
On 01 Apr 09, at 15:58, Jeff Laing wrote: My boss has just discovered the iPhone Field Test mode (described here: http://www.wirelessinfo.com/content/inside-the-iphone-field-test-mode.ht m) and was wondering whether there is a mechanism for a regular Cocoa app to get at that Cell information.

Re: disable row highlighting NSTableView

2009-04-01 Thread Jo Phils
Thank you very much I will do my homework... Sincerely, Rick From: I. Savant idiotsavant2...@gmail.com To: Jo Phils jo_p...@yahoo.com Cc: Jens Miltner j...@mac.com; Cocoa List cocoa-dev@lists.apple.com Sent: Thursday, April 2, 2009 12:02:29 AM Subject: Re:

Toll-free bridge type at runtime

2009-04-01 Thread Ryan Joseph
I'm trying to determine at runtime if a type is CoreFoundation or Cocoa, for example NSArray/CFArray. I must use Carbon API however to determine this before I attempt to use Cocoa methods for introspection. My first test was to use CFGetTypeID and CFCopyTypeIDDescription but they both

Re: Toll-free bridge type at runtime

2009-04-01 Thread Michael Ash
On Thu, Apr 2, 2009 at 12:33 AM, Ryan Joseph thealchemistgu...@gmail.com wrote: I'm trying to determine at runtime if a type is CoreFoundation or Cocoa, for example NSArray/CFArray. I must use Carbon API however to determine this before I attempt to use Cocoa methods for introspection. My

Re: NSPopUpButton pullsDown:YES and dummy first item - normal?

2009-04-01 Thread Michael Ash
On Wed, Apr 1, 2009 at 9:55 PM, Rua Haszard Morris r.haszardmor...@adinstruments.com wrote: I am using a pull-down NSPopUpButton for a little button which displays a little menu. The menu has some commands in it, i.e. it's not a selection menu, the title of the button just displays an icon, no

Re: Bindings and MenuItems

2009-04-01 Thread Ben Lachman
On Apr 1, 2009, at 5:01 PM, Keary Suska wrote: On Apr 1, 2009, at 12:31 PM, Ben Lachman wrote: I mean a Cocoa bindings kind of binding. e.g. the target binding of the menu item is bound in IB. The action field of the binding is set to print:. I'm not talking about the traditional way

How to download images for a contact in Cocoa?

2009-04-01 Thread albert jordan Mobility
I'm trying to implement code that downloads contact image from the net. I thought the following would do... NSString* mapURL = [currentStringValue stringByReplacingPercentEscapesUsingEncoding: NSASCIIStringEncoding]; NSData* imageData = [[NSData alloc]initWithContentsOfURL:[NSURL