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 cou
> 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
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
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
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 Xc
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 & 3
>> 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.
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 la
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 f
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 fi
On Feb 24, 2012, at 6:50 AM, Oleg Krupnov 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 language says that NU
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 wrote:
> On Feb 24, 20
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];
>
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 fo
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 wrote:
> An interesting question. The following samples are equivalent in terms
> of compiled code, but which one is more correct from the
On Fri, Feb 24, 2012 at 6: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];
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 fo
> 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 implici
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 t
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 y
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];
>
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];
> i
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 b
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 multip
On Fri, 24 Feb 2012 13:56:08 +0700, Gerriet M. Denkmann said:
>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
On Feb 23, 2012, at 9:28 AM, Antonio Nunes 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'
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 inform
Thanks Ken
On Feb 24, 6:04 am, Ken Thomases 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 raised or caug
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 w
On Feb 23, 2012, at 5:38 PM, "Rick C." 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 -[NSObject(NSEditor) commitEditing].
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 Coco
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 var
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, y
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
wrote:
> The documentation says of NSProcessInfo operatingSystemVersionString:
> "This string is n
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 jus
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 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
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
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
Awesome, I'll check it out!
Thanks
Jeremy
Sent from my iPhone
On Feb 24, 2012, at 4:42 AM, John Maisey 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 'TaskContainer', bot
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 r
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 scro
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, y
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
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 wrote:
> On Wed, Feb 22, 2012 at 7:53 AM, R wrote:
> > and now see:
>
> > Catchpoint 2 (throw)Pending breakpoint 1 - "objc_exception_throw"
> > resolved
>
> > No further de
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 wrote:
> On Wed, Feb 22, 2012 at 7:53 AM, R wrote:
> > and now see:
>
> > Catchpoint 2 (throw)Pending bre
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 (Cocoa-
On Feb 23, 2012, at 12:09 PM, Markus Spoettl wrote:
> 1) On -mouseMoved: locate object under the cursor and highlight it so the
> user knows which one of them will be operated on when the mouse goes down.
>
> 2) On -mouseDown: locate object under the cursor and prepare it for dragging
> (by rem
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 arou
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 capti
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 NSM
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
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 cas
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 w
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 wit
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 h
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 events
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 do
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
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 proble
59 matches
Mail list logo