iCal syncing on multiple computers

2012-02-13 Thread Gideon King
Hi, I have some data that is synced with iCal by my application. I get the calendars, and the user selects which one to sync to, and in my data, I save the UID for the calendar we have synced with. Now the user moves to a different computer and can't sync, since the same calendar is not availa

NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-13 Thread Sean McBride
Hi all, The NSEvent locationInWindow docs say: "For non-mouse events the return value of this method is undefined." I've just been bitten by this. Seems it would be easy to detect at runtime and assert, is there any magic environment variable or defaults value that can help me catch such inco

Re: NSReadPixel

2012-02-13 Thread Seth Willits
On Feb 13, 2012, at 9:21 AM, Kyle Sluder wrote: > But I don't think a screen-sized window is necessary. You might be able to > create a transparent 1px-by-1px window that follows the cursor hotspot, then > lock focus on its contentView and call NSReadPixel. It'll lag. -- Seth Willits ___

Re: Odd display of percent character

2012-02-13 Thread Michael Babin
On Feb 13, 2012, at 11:04 AM, Chris Paveglio wrote: > I'm having an issue with the percent character being displayed as random > numbers in an NSAlertPanel (modal). My app has an ivar, "fullString", > including the usual property/synthesize getters and setters, there is nothing > special about

Re: Odd display of percent character

2012-02-13 Thread Chris Paveglio
I was thinking it had something to do with the % formatter, but wasn't sure how to "escape" it, or if there was something different about NSAlert. I totally understand now how it works, as the "informativeTextWithFormat" automatically reads the % as another format placeholder. Thanks Kyle, Ken a

Re: Odd display of percent character

2012-02-13 Thread Keary Suska
On Feb 13, 2012, at 10:04 AM, Chris Paveglio wrote: > I'm having an issue with the percent character being displayed as random > numbers in an NSAlertPanel (modal). My app has an ivar, "fullString", > including the usual property/synthesize getters and setters, there is nothing > special about

Re: Odd display of percent character

2012-02-13 Thread Ken Thomases
On Feb 13, 2012, at 11:04 AM, Chris Paveglio wrote: > I'm having an issue with the percent character being displayed as random > numbers in an NSAlertPanel (modal). My app has an ivar, "fullString", > including the usual property/synthesize getters and setters, there is nothing > special about

Re: Odd display of percent character

2012-02-13 Thread Kyle Sluder
On Mon, Feb 13, 2012 at 9:04 AM, Chris Paveglio wrote: > I'm having an issue with the percent character being displayed as random > numbers in an NSAlertPanel (modal). My app has an ivar, "fullString", > including the usual property/synthesize getters and setters, there is nothing > special abo

Re: Playing Music in Objective C

2012-02-13 Thread Kyle Sluder
On Mon, Feb 13, 2012 at 9:49 AM, Charles Srstka wrote: > On Feb 13, 2012, at 10:03 AM, Kyle Sluder wrote: > >> On Feb 12, 2012, at 11:02 AM, Charles Srstka >> wrote: >> >>> I’d suggest looking at QTMovie — more customizable than NSSound, and just >>> about as simple to use. >>> >> >> If you're

Re: NSDateFormatter not working on iOS 5.

2012-02-13 Thread Peter Edberg
On Feb 2, 2012, at 7:56 AM, John Joyce wrote: > > On Feb 2, 2012, at 2:20 AM, Peter Edberg wrote: > >> >> On Jan 31, 2012, at 2:35 PM, cocoa-dev-requ...@lists.apple.com wrote: >>> -- >>> >>> Message: 1 >>> Date: Tue, 31 Jan 2

Re: Playing Music in Objective C

2012-02-13 Thread Charles Srstka
On Feb 13, 2012, at 10:03 AM, Kyle Sluder wrote: > On Feb 12, 2012, at 11:02 AM, Charles Srstka wrote: > >> I’d suggest looking at QTMovie — more customizable than NSSound, and just >> about as simple to use. >> > > If you're targeting Lion, do not use QTMovie. Use AVFoundation instead. > >

Re: copy & isEqual nightmares

2012-02-13 Thread Quincey Morris
On Feb 13, 2012, at 01:14 , Uli Kusterer wrote: > The hash should be calculated from your object's values. If your object's > ivars (those that are relevant to the hash) can be changed after creation, > you must always recalculate your hash whenever one of them is modified (or > mark it as inva

Re: NSReadPixel

2012-02-13 Thread Kyle Sluder
On Feb 13, 2012, at 8:48 AM, koko wrote: > Hello Kyle - > > What I am trying to accomplish is my own 'eye-droper' color picker (for > reasons I cannot get into). > > Can you point me to the best method as I have done things other than a plain > read pixel to no avail. Well, as long as you're

Odd display of percent character

2012-02-13 Thread Chris Paveglio
I'm having an issue with the percent character being displayed as random numbers in an NSAlertPanel (modal). My app has an ivar, "fullString", including the usual property/synthesize getters and setters, there is nothing special about it. fullString is bound to an NSTextField where a user might

Re: NSReadPixel

2012-02-13 Thread koko
Hello Kyle - What I am trying to accomplish is my own 'eye-droper' color picker (for reasons I cannot get into). Can you point me to the best method as I have done things other than a plain read pixel to no avail. Thanks! -koko On Feb 11, 2012, at 10:09 AM, Kyle Sluder wrote: > On Fri, Fe

Re: Playing Music in Objective C

2012-02-13 Thread John Pannell
Hi all- Another tidbit on NSSound (or perhaps sound in general)… laptops will sleep the sound hardware when possible, and there is a brief delay when waking things back up. I have found that the playing of a silent sound at the launch of my app is helpful to wake things up and avoid the delay

Re: Playing Music in Objective C

2012-02-13 Thread Kyle Sluder
On Feb 13, 2012, at 7:30 AM, Jim McGowan wrote: > As the OP was creating a simple puzzle game I think NSSound is a reasonable > way to go for the sound effects. Might even be reasonable for the music too, > if it is just a looping MP3. AVAudioPlayer is simple enough that I would recommend not

Re: Playing Music in Objective C

2012-02-13 Thread Kyle Sluder
On Feb 12, 2012, at 11:02 AM, Charles Srstka wrote: > I’d suggest looking at QTMovie — more customizable than NSSound, and just > about as simple to use. > If you're targeting Lion, do not use QTMovie. Use AVFoundation instead. --Kyle Sluder ___ Co

Re: Problem assigning NSView bounds from subview.bounds

2012-02-13 Thread Kyle Sluder
On Feb 13, 2012, at 7:02 AM, Michael Crawford wrote: > I'm trying to have a superview resize itself to match the bounds of a subview > when the subview is added. When I do, the superview bounds become NaN. > > Why would this: > > - (void)didAddSubview:(NSView *)view > { >// resize to matc

Re: Playing Music in Objective C

2012-02-13 Thread Jim McGowan
On 13 February, 2012 4:38, Jens Alfke wrote: > > On Feb 12, 2012, at 10:35 AM, Conrad Shultz wrote: > >> The simplest (and therefore least customizable) approach would be to use >> NSSound. But I think it will do everything you stipulate. > > A minor issue with NSSound in games is that, the

Problem assigning NSView bounds from subview.bounds

2012-02-13 Thread Michael Crawford
I'm trying to have a superview resize itself to match the bounds of a subview when the subview is added. When I do, the superview bounds become NaN. Why would this: - (void)didAddSubview:(NSView *)view { // resize to match bounds of given subview NSLog(@"%@ = %@, %@ = %@", self, NSStrin

Re: copy & isEqual nightmares

2012-02-13 Thread James Maxwell
oops, yes. typo (0x%X) J. On 2012-02-13, at 1:21 AM, Uli Kusterer wrote: > On 13.02.2012, at 02:54, James Maxwell wrote: >> NSLog(@"%@", [obj hash]) > > I hope this is a typo. %@ expects an object, while -hash returns an integer. > If you're lucky, this will crash, or just output garbage. Your

Re: How to parse a search string..

2012-02-13 Thread Uli Kusterer
On 13.02.2012, at 00:22, Graham Cox wrote: > If you really have to annoy the user by rejecting their input as they go, > there are delegate methods on the field editor which would allow you to > validate the text as they type - look up "field editor" in the guides. Isn't that what NSFormatter i

Re: copy & isEqual nightmares

2012-02-13 Thread Uli Kusterer
On 13.02.2012, at 02:54, James Maxwell wrote: > NSLog(@"%@", [obj hash]) I hope this is a typo. %@ expects an object, while -hash returns an integer. If you're lucky, this will crash, or just output garbage. Your compiler should be warning you about that line. Cheers, -- Uli Kusterer "The Witn

Re: copy & isEqual nightmares

2012-02-13 Thread Uli Kusterer
On 13.02.2012, at 01:25, James Maxwell wrote: > But what I don't get is how hash plays into all this. I've always read that I > have to override hash when I override isEqual, but I don't exactly understand > what that means or does. What I've done is to make a hash that is equal when > two objec

Re: How to parse a search string..

2012-02-13 Thread Uli Kusterer
On 12.02.2012, at 23:02, David Delmonte wrote: > I have a search box, and need to parse out some special characters (' and \). Do you? In most cases, ignoring some of the user's input just leads to wrong result. Instead, you should determine how to correctly escape the given characters so they