Re: text field question

2012-02-24 Thread Keary Suska
On Feb 22, 2012, at 5:59 PM, Rick C. wrote: I have a panel with a number of text fields where a user should enter numeric values. These text fields are setup with Sent on End Editing so that if the user presses enter or tabs or changes text fields the value will be entered. The problem

Re: Was: Re: NSStepper - useless?

2012-02-24 Thread Gregory Weston
William Squires wrote: Why didn't they just make the NSStepper a custom view that draws two arrows, and has two sent actions that you can connect? Or even a variation of NSMatrix with two button cells that look like arrows. That would avoid the problem entirely, and be more intuitive to

Crash when scroll down UITableView

2012-02-24 Thread Vavelin Kevin
Hi all, I'm Vavelin Kevin and i'm student at Supinfo International University. I try to develop an application for my uni and i have something wrong on my app. When i scroll down my tableView, it doesn't bounce, my app just crash with Thread 1: Program received signal: EXC_BAD_ACCESS . I don't

Re: iCal Integration

2012-02-24 Thread Gideon King
I don't see anything in the API to detect it - I have encountered calendars that don't support tasks, and if I try to save a task to them, I get an error with code 1025 (CalCalendarNotEditableError), and deal with that in my code. isEditable returns YES for a calendar which only supports

Re: Dumb question about radio buttons

2012-02-24 Thread Gideon King
Not sure about your number of items in your matrix, but you are wanting [sender selectedTag] to get the user's choice. Regards Gideon On 23/02/2012, at 11:58 PM, William Squires wrote: -(IBAction)baseChanged:(id)sender { int choice = [sender tag]; } I always get, user chose

Re: NSView mouseDown truncated coordinates

2012-02-24 Thread Quincey Morris
On Feb 23, 2012, at 14:15 , Markus Spoettl wrote: Mouse movement highlighting must happen when the mouse moves. At that time, only the mouse move coordinates are known. They correspond with what happens on the screen, so highlighting works as expected. Now a mouse-down comes along with

Re: Loading existing NIB file from Cocoa?

2012-02-24 Thread Howard Moon
On Feb 23, 2012, at 2:17 PM, Fritz Anderson wrote: ... You know best, but do you really have to support Carbon any more? — F Yes, as long as a significant portion of our customer base uses audio hosts that are carbon-based. Heck, we still supported PowerPC until last year... and we

Re: text field question

2012-02-24 Thread Rick C.
Thanks to all for the replies. In my case there is a certain process that takes place (initiated by the user) that will read these values. Currently if the user enters a value but does not click enter or tab, etc. when the process starts and I read the text field string it is empty. In my

Re: text field question

2012-02-24 Thread Rick C.
Thanks Jan. What method do you call to make it accept the text? That's maybe what I'm looking for... On Feb 23, 2012, at 11:32 PM, Jan E. Schotsman wrote: On Feb 23, 2012, at 7:56 AM, Rick C. wrote: I have a panel with a number of text fields where a user should enter numeric

Re: Dumb question about radio buttons

2012-02-24 Thread William Squires
That's what I was looking for - now, back to my project... tomorrow! :) On Feb 23, 2012, at 2:04 PM, Seth Willits wrote: On Feb 23, 2012, at 5:58 AM, William Squires wrote: I have a custom view with an NSBox containing an NSMatrix of button cells (radio buttons) When I created the

feature request: implement a true checkbox in iOS

2012-02-24 Thread William Squires
Ever since the first release of iOS (then called iPhone OS), the UISwitch has really bothered me: 1) It takes up too much valuable screen real-estate compared with a checkbox 2) The On/Off text can't even be customized - the checkbox NSButton in Mac OS X at least allows you to change its

Re: App Crashing in ARC !!

2012-02-24 Thread KappA
Based on this line: -[NSPanel release]: message sent to deallocated instance 0x111c74a60* And this from the stack trace: *#2 0x7fff8ff49ca0 in CFRelease ()* Looks like you're over releasing. Perhaps ensure that the object is declared as strong so that you keep a reference of it

[Moderator] Obvious, but lists are back up

2012-02-24 Thread Scott Anguish
This may be obvious since you’re reading this, but the lists are back up after a brief technical issue. Thanks for your patience and a big thanks to those who fixed the issue. -- Moderator *Scott=[Moderator alloc]; ___ Cocoa-dev mailing list

Re: I added an exception breakpoint to my app...

2012-02-24 Thread R
I created a single view application in Xcode 4, no additions, just the boilerplate template. The same exception was noted. Maybe an Xcode bug? thanks --R On Feb 22, 11:17 pm, Kyle Sluder kyle.slu...@gmail.com wrote: On Wed, Feb 22, 2012 at 7:53 AM, R r4eem...@gmail.com wrote: and now see:

Re: I added an exception breakpoint to my app...

2012-02-24 Thread R
Note that the exception was resolved... nothing to continue or log as far as I can tell On Feb 22, 11:17 pm, Kyle Sluder kyle.slu...@gmail.com wrote: On Wed, Feb 22, 2012 at 7:53 AM, R r4eem...@gmail.com wrote: and now see: Catchpoint 2 (throw)Pending breakpoint 1 - objc_exception_throw

What to use instead of operatingSystemVersionString

2012-02-24 Thread Gerriet M. Denkmann
The documentation says of NSProcessInfo operatingSystemVersionString: This string is not appropriate for parsing. But if fails to mention what to use instead. So what should I use? Gestalt? Or is there some more convenient Cocoa alternative? (I need this info for a bug workaround which occurs

Re: ImageCapture + ImageKit problem...

2012-02-24 Thread Eric Matecki
Hi Fritz, On 23/02/12 21:26, Fritz Anderson wrote: On 23 Feb 2012, at 2:12 AM, Eric Matecki wrote: Oh, something that may be part of the problem (or of the solution...): I don't call run on my app for multiplatform portability reasons. Instead I call this in a customized event loop: Alas,

Re: Crash when scroll down UITableView

2012-02-24 Thread Mike Abdullah
What's the backtrace? http://whathaveyoutried.com/ ? Instruments? On 19 Feb 2012, at 15:50, Vavelin Kevin wrote: Hi all, I'm Vavelin Kevin and i'm student at Supinfo International University. I try to develop an application for my uni and i have something wrong on my app. When i scroll

Re: Semi-Transient NSPopover disappearing when it shouldn't (10.7.3)

2012-02-24 Thread Antonio Nunes
On 23 Feb 2012, at 21:52, Seth Willits wrote: I have a few popovers that, as far as I'm aware of, were working fine up to 10.7.2. Now, in 10.7.3, when the popover appears, if a user clicks on it, it often disappears, whether the click is on the background or on a UI item. Can you

Re: iCal Integration

2012-02-24 Thread Jeremy Matthews
Awesome, I'll check it out! Thanks Jeremy Sent from my iPhone On Feb 24, 2012, at 4:42 AM, John Maisey j...@nhoj.co.uk wrote: I also don't think this is in the API. The relevant information is stored in the Info.plist file for each calendar. The keys are 'EventContainer' and

Re: feature request: implement a true checkbox in iOS

2012-02-24 Thread Joshua Tidsbury
On 2012-02-23, at 9:44 PM, William Squires wrote: Ever since the first release of iOS (then called iPhone OS), the UISwitch has really bothered me: 1) It takes up too much valuable screen real-estate compared with a checkbox 2) The On/Off text can't even be customized - the checkbox

Re: feature request: implement a true checkbox in iOS

2012-02-24 Thread Mike Abdullah
This really isn't the place for feature requests. File a radar instead. On 24 Feb 2012, at 02:44, William Squires wrote: Ever since the first release of iOS (then called iPhone OS), the UISwitch has really bothered me: 1) It takes up too much valuable screen real-estate compared with a

Re: Crash when scroll down UITableView

2012-02-24 Thread Eric Dolecki
We need to see code for your data provider and your cell ode for the table. Sent by Eric's faithful iPad. On Feb 19, 2012, at 10:50 AM, Vavelin Kevin kevinvave...@yahoo.fr wrote: Hi all, I'm Vavelin Kevin and i'm student at Supinfo International University. I try to develop an

Re: I added an exception breakpoint to my app...

2012-02-24 Thread Ken Thomases
Kyle misunderstood what you were asking. The debugger is simply reporting that it found the proper place to set the breakpoint. It resolved from a symbol to an address. Nothing has actually happened. No exception was raised or caught. The breakpoint has not yet been hit. The debugger is

Re: What to use instead of operatingSystemVersionString

2012-02-24 Thread Stephane Sudre
If this is an AppKit related bug then you could check the NSAppKitVersionNumber if a newer version was released for 10.6.1 that solved the issue. On Fri, Feb 24, 2012 at 7:56 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: The documentation says of NSProcessInfo operatingSystemVersionString:

Re: ImageCapture + ImageKit problem...

2012-02-24 Thread Eric Matecki
Hi Fritz, On 23/02/12 21:26, Fritz Anderson wrote: On 23 Feb 2012, at 2:12 AM, Eric Matecki wrote: Oh, something that may be part of the problem (or of the solution...): I don't call run on my app for multiplatform portability reasons. Instead I call this in a customized event loop: Alas,

[Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Oleg Krupnov
An interesting question. The following samples are equivalent in terms of compiled code, but which one is more correct from the language's point of view? self = [super init]; if (self) { } return self; self = [super init]; if (self != nil) { } return self; The Xcode samples promote the first

Re: What to use instead of operatingSystemVersionString

2012-02-24 Thread Jean-Daniel Dupas
Le 24 févr. 2012 à 07:56, Gerriet M. Denkmann a écrit : The documentation says of NSProcessInfo operatingSystemVersionString: This string is not appropriate for parsing. But if fails to mention what to use instead. So what should I use? Gestalt? Or is there some more convenient Cocoa

Re: text field question

2012-02-24 Thread Kyle Sluder
On Feb 23, 2012, at 5:38 PM, Rick C. rickcort...@gmail.com wrote: Thanks Jan. What method do you call to make it accept the text? That's maybe what I'm looking for... As I mentioned before, and is explained in the documentation, you use -[NSWindow makeFirstResponder:] or

Re: What to use instead of operatingSystemVersionString

2012-02-24 Thread Gerriet M. Denkmann
On 24 Feb 2012, at 22:11, Jean-Daniel Dupas wrote: Le 24 févr. 2012 à 07:56, Gerriet M. Denkmann a écrit : The documentation says of NSProcessInfo operatingSystemVersionString: This string is not appropriate for parsing. But if fails to mention what to use instead. So what should I

Re: I added an exception breakpoint to my app...

2012-02-24 Thread R
Thanks Ken On Feb 24, 6:04 am, Ken Thomases k...@codeweavers.com wrote: Kyle misunderstood what you were asking. The debugger is simply reporting that it found the proper place to set the breakpoint.  It resolved from a symbol to an address. Nothing has actually happened.  No exception was

Recommendation: Turn on NSApplicationShowExceptions on your development machines

2012-02-24 Thread Corbin Dunn
Hi Cocoa Developers, I really recommend turning on this new default that was introduced in Lion: defaults write NSGlobalDomain NSApplicationShowExceptions YES It will let you catch exceptions in your app even when not running under the debugger. See the AppKit release notes for more

Re: Semi-Transient NSPopover disappearing when it shouldn't (10.7.3)

2012-02-24 Thread Corbin Dunn
On Feb 23, 2012, at 9:28 AM, Antonio Nunes devli...@sintraworks.com wrote: I have a few popovers that, as far as I'm aware of, were working fine up to 10.7.2. Now, in 10.7.3, when the popover appears, if a user clicks on it, it often disappears, whether the click is on the background or on

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Howard Moon
Really, this belongs in the Objective-C mailing list, but... If the language provides a feature, then it is correct in terms of the language. That said, I always use the long form, just to be sure I'm always specifying a boolean condition. This helps me when I'm combining or separating

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread David Duncan
On Feb 24, 2012, at 6:50 AM, Oleg Krupnov wrote: So basically, nil is of type void*, so the expression self != nil compares two pointers and the result is boolean, which is perfect for testing in the if statement. But the self alone is of type pointer and so when it is tested by the if

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Fritz Anderson
On 24 Feb 2012, at 8:50 AM, Oleg Krupnov wrote: An interesting question. The following samples are equivalent in terms of compiled code, but which one is more correct from the language's point of view? self = [super init]; if (self) { } return self; self = [super init]; if (self !=

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Keary Suska
On Feb 24, 2012, at 7:50 AM, Oleg Krupnov wrote: An interesting question. The following samples are equivalent in terms of compiled code, but which one is more correct from the language's point of view? self = [super init]; if (self) { } return self; self = [super init]; if (self !=

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Thomas Davie
Neither is more correct. The main distinction is whether you are happy with C's (very weak) type system or not. If you are satisfied that if simply checks if some integer typed value is equal to 0 or not, and uses the first branch if it isn't, then the former is more concise and better for

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Scott Ribe
On Feb 24, 2012, at 7:50 AM, Oleg Krupnov wrote: I also heard that generally speaking NULL is not necessarily always equal to 0 on all architectures. Thoughts? Yeah, don't worry about it. The if(self) form is idiomatic C, by which I mean it's the way that C code has been written since the

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Wade Tregaskis
self = [super init]; if (self) { } return self; self = [super init]; if (self != nil) { } return self; The Xcode samples promote the first variant, but I'm wondering if the second one is more correct? No. The more common convention in (Apple's) ObjC is to use implicit boolean

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread David Rowland
I usually prefer the more explicit form (of any expression) because it more obviously describes what is happening. That is your second example. However, anyone who works with any variant of C quickly becomes comfortable with the first form, so I consider it quite acceptable. There is another

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Kyle Sluder
On Fri, Feb 24, 2012 at 6:50 AM, Oleg Krupnov oleg.krup...@gmail.com wrote: An interesting question. The following samples are equivalent in terms of compiled code, but which one is more correct from the language's point of view? self = [super init]; if (self) { } return self; self =

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Kyle Sluder
Also, this question is much more appropriate for the objc-language list than it is for cocoa-dev. --Kyle Sluder On Fri, Feb 24, 2012 at 6:50 AM, Oleg Krupnov oleg.krup...@gmail.com wrote: An interesting question. The following samples are equivalent in terms of compiled code, but which one is

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Oleg Krupnov
Yes, I'm aware that in practice it doesn't matter, but when I code, I have to choose one or the other way, anyway. My current choice is (self != nil) for the sake of explicitness. Thanks everyone for an interesting discussion, especially Kyle for such an exhaustive reference :) P.S. Sorry

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Nick Zitzmann
On Feb 24, 2012, at 7:50 AM, Oleg Krupnov wrote: An interesting question. The following samples are equivalent in terms of compiled code, but which one is more correct from the language's point of view? self = [super init]; if (self) { } return self; self = [super init]; if (self

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Erik Stainsby
And what does the list feel about the following form (which I think I picked up from a Wil Shipley article): if(nil != (self = [super init])) Myself I find it elegantly brief and imminently readable. Time Dwarf, Roaring Guy On 2012-02-24, at 9:30 AM, David Duncan david.dun...@apple.com

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Greg Parker
On Feb 24, 2012, at 6:50 AM, Oleg Krupnov oleg.krup...@gmail.com wrote: I also heard that generally speaking NULL is not necessarily always equal to 0 on all architectures. In practice, NULL is always 0. Any exceptions were ancient historical oddities that you can ignore. In principle, the C

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Sean McBride
On Fri, 24 Feb 2012 10:36:51 -0700, Keary Suska said: I don't believe this is the case. There can be funny issues with BOOL types, such that BOOL == YES is an inadvisable construct, since your BOOL could be an integer of any value. Indeed, and it's extremely frustrating. I encourage you to file

Re: Semi-Transient NSPopover disappearing when it shouldn't (10.7.3)

2012-02-24 Thread Antonio Nunes
On 24 Feb 2012, at 16:55, Corbin Dunn wrote: I have a few popovers that, as far as I'm aware of, were working fine up to 10.7.2. Now, in 10.7.3, when the popover appears, if a user clicks on it, it often disappears, whether the click is on the background or on a UI item. I haven't figured

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Scott Ribe
On Feb 24, 2012, at 10:36 AM, Keary Suska wrote: I also heard that generally speaking NULL is not necessarily always equal to 0 on all architectures. I don't believe this is the case. Actually it is--in fact there can even be multiple representations that are null, but again the language

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Marco S Hyman
I also heard that generally speaking NULL is not necessarily always equal to 0 on all architectures. I don't believe this is the case. There can be funny issues with BOOL types, such that BOOL == YES is an inadvisable construct, since your BOOL could be an integer of any value. In the

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Ben Kennedy
On 24 Feb 2012, at 9:52 am, Scott Ribe wrote: Now there is one style that is worth defending, which is when comparing a variable to a constant, put the constant first. Consider the following: if(self == nil)... if(self = nil)... if(nil == self)... if(nil = self)... The 1st 3rd are

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Scott Ribe
On Feb 24, 2012, at 2:47 PM, Ben Kennedy wrote: Fortunately the compiler (nowadays) warns in these situations, and suggests that one either fix the operator or enclose the expression in extra parentheses to clarify the intent. Sometimes. I've found that various warnings come go with Xcode

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Scott Ribe
On Feb 24, 2012, at 10:52 AM, Wade Tregaskis wrote: Though technically speaking it's true, and is thus an argument for actually using NULL rather than 0 No, it's not such an argument at all. The compiler guarantees that null pointers converted to int become 0, that constant 0 assigned to a

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Scott Ribe
On Feb 24, 2012, at 12:47 PM, Kyle Sluder wrote: But I'm not sure the integer conversion is necessarily relevant. The semantics of the if statement are defined by §6.8.4.1 ¶2: the first substatement is executed if the expression compares unequal to 0. It is left unspecified if '0' is an

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Wade Tregaskis
if(self == nil)... if(self = nil)... if(nil == self)... if(nil = self)... The 1st 3rd are the correct conditions, the 2nd 4th are typos. But the 2nd compiles and gives incorrect behavior, while the 4th fails to compile. Of course if(self) is not subject to that kind of typo, but if

Delaying touchesMoved

2012-02-24 Thread Eric E. Dolecki
I've built a iOS simulation and I have been asked to provide a variable delay between touchesMoved and it's actual code running - to simulate latency. I imagine I'll be asked to provide this system wide - all touches and interactions. Since the delays would be anywhere from 5-30ms, I think I