Hello list,
I'm looking for something similar to UITableView for Mac development.
NSCollectionView seems a little like what I'd want, but the API on
UITableView is much cleaner and easier to use (and I'm only really
interested in a single column rather than a grid). I've also looked at
st
From the perspective of efficiency, I speculate that hiding/showing
views would be a better approach, given that adding/removing subviews
has to traverse and manipulate the view hierarchy, which could be
potentially an expensive proposition (unless all the subviews are
siblings of one super
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
URLWi
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
On Wed, Apr 1, 2009 at 9:55 PM, Rua Haszard Morris
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 title, no indication
> of a cur
On Thu, Apr 2, 2009 at 12:33 AM, Ryan Joseph
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 first test was to use CFGe
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 retur
Thank you very much I will do my homework...
Sincerely,
Rick
From: I. Savant
To: Jo Phils
Cc: Jens Miltner ; Cocoa List
Sent: Thursday, April 2, 2009 12:02:29 AM
Subject: Re: disable row highlighting NSTableView
On Wed, Apr 1, 2009 at 11:54 AM, Jo Phils
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.
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
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:
1
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 listens
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) setUs
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 an
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 do
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 o
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 iPho
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 sligth
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 startup
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 perman
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:
e
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 sligth
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
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 incredibl
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
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
___
On Tue, Mar 31, 2009 at 6:21 PM, Steve Cronin 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 fine)
>
> Wit
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" wrote:
> On Wed, Apr 1, 2009 at 10:33 AM, Pierce Freeman
> wrote:
>
>> Yeah, I finally figured that out. ;) It now works like a charm.
>
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
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 shou
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 initial
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?
-Jef
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
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 I
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
+
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 t
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 coordinates.
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 t
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
http://www.met
2009/4/1 Ammar Ibrahim
> On Wed, Apr 1, 2009 at 10:21 PM, Luca C. 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.
>>
>> ScriptingBridge seems not to be thre
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
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 [LOG_P
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 M
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 the
On Wed, Apr 1, 2009 at 10:21 PM, Luca C. wrote:
> 2009/4/1 Michael Ash
> >
> >
> > 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
> > A
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 ID:0x186569
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 access
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=-1920y
2009/4/1 Michael Ash
>
>
> 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 ScriptingBridge.
On Wed, Apr 1, 2009 at 2:25 PM, has wrote:
> Michael Ash wrote:
>
> On Tue, Mar 31, 2009 at 3:57 PM, Luca C.
>> wrote:
>>
>>> 2009/3/31 Ammar Ibrahim
>>>
If I want to add a track to iTunes, I need to make sure iTunes is
responsive.
Are you sure it is that important? Actual
On Wed, Apr 1, 2009 at 12:15 AM, Nate Weaver wrote:
> 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 a
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
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
di
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 wrote:
> On Wed, Apr 1, 2009 at 1:54 PM, Mark Suman wrote:
>
>> The part that's tripping me up is launch System Preferences and then
>> open
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 sourc
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 wrote:
>
> On Apr 1, 2009, at 2:04 PM, Shawn Erickson wrote:
>
> On Wed, Apr 1, 2009 at 7:28 AM, Eric Gorr wrote:
>>
>> In the real application, there are some cu
On Apr 1, 2009, at 2:04 PM, Shawn Erickson wrote:
On Wed, Apr 1, 2009 at 7:28 AM, Eric Gorr
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 s
On Wed, Apr 1, 2009 at 1:54 PM, Mark Suman 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 sharedWorkspace] ope
On Wed, Apr 1, 2009 at 7:28 AM, Eric Gorr 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
> shouldn't happen.
On Apr 1, 2009, at 11:54 AM, Mark Suman wrote:
I would like to pass in something like "set the current pane to pane
id \"com.foo.prefpane\" to the event to tell System Preferences to
change to my pane.
Can anyone tell me how to pass that in?
You're making this way too complicated. Try t
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] launchAppWithBundleIdenti
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 devi
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
> 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
> ha
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 [LOG_P
On Wed, Apr 1, 2009 at 11:54 AM, Jo Phils 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. Is
> there a tu
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 me
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
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
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
On Wed, Apr 1, 2009 at 10:33 AM, Pierce Freeman
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'."
NSMutableArray * globalVariable;
...
On Wed, Apr 1, 2009 at 10: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.
>
> Howev
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
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
rapi
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.
Hey Graham :
Yeah, I finally figured that out. ;) It now works like a charm.
On 3/31/09 7:20 PM, "Graham Cox" 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 declaring does
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:]
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 check
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 li
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 entity
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 th
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 lis
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 w
Hi there, I have to parse a xml & return the values for val & id
(attribute). I have pasted a sample xml below.
Alabama . . . Wyoming
Australia . . . ZambiaI am able to retrieve
the val(Alabama, Austalia...) & display it in a table view. I need to get
the attribute values (AL, 1) - to k
Michael Ash wrote:
On Tue, Mar 31, 2009 at 3:57 PM, Luca C.
wrote:
2009/3/31 Ammar Ibrahim
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 wich,
say, opens with the Finder some mp3 files wh
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
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 a
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 ID:0x
> 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,
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
89 matches
Mail list logo