On Oct 9, 2010, at 3:12 PM, Ariel Feinerman wrote:
> 2010/10/9 Kyle Sluder
>
>>
>> In fact, I can't think of a situation when it *ever* makes sense to
>> type something as id rather than NSObject.
>>
>> Because you can wish to use your own root class, there is difference
> between these. I d
2010/10/9 Kyle Sluder
>
> In fact, I can't think of a situation when it *ever* makes sense to
> type something as id rather than NSObject.
>
> Because you can wish to use your own root class, there is difference
between these. I dont know, but maybe it is why the delegates is always has:
id , it
On Sat, Oct 9, 2010 at 10:38 AM, Ariel Feinerman wrote:
> NSObject *kit;
>> kit = [[kits selectedObjects] objectAtIndex:0];
>>
>
> // it is more convenience
> id kit;
Why would you do this? It is not more convenient. It is actually a
hell of a lot less convenient, because now the co
NSObject *kit;
>kit = [[kits selectedObjects] objectAtIndex:0];
>
// it is more convenience
id kit;
--
best regards
Ariel
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments t
Kyle Sluder wrote:
> Just wanted to confirm that this is a repost of the previous thread?
>
> http://lists.apple.com/archives/cocoa-dev/2010/Oct/msg00117.html
>
> --Kyle Sluder
>
> On Tue, Oct 5, 2010 at 2:07 AM, Amy Heavey
> wrote:
>> ...
It is. Notice that it came through on Oct 8, dated O
Just wanted to confirm that this is a repost of the previous thread?
http://lists.apple.com/archives/cocoa-dev/2010/Oct/msg00117.html
--Kyle Sluder
On Tue, Oct 5, 2010 at 2:07 AM, Amy Heavey wrote:
> I've got two float values (x and y) that I'm using to change the coordinates
> of a drawing act
A stripped down version of your code works as expected here.
- (IBAction) test:(id) sender
{
//set coordinates to x,y -> 0,0 to start
float x = 0;
float y = 0;
while (YES) {
NSLog(@"x = %f, y = %f", x, y);
x = x+100;
//if coordinates are too
I've got two float values (x and y) that I'm using to change the
coordinates of a drawing action that is being looped through. I can
add a value to x and it draws the next image along, but I want to test
the value of x and if it is out of bounds I want to reset it to zero
and increase y, so
On 10/5/10 10:18 AM, thus spake "Amy Heavey" :
>I'm googling Fast Enumeration, but I'm compiling for 10.5,
>
>
Fast enumeration is present in 10.5. m.
--
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 2
On Oct 5, 2010, at 11:18 AM, Amy Heavey wrote:
> I changed it to > 299 and voila it worked. I did also have to (is the term
> cast?) the 299 to a float.
Yes, the term is "cast".
No you didn't need to cast 299 to a float. It's not wrong to do so, just
unnecessary. (And, if you care, you could
Got it working, Part of my issue seemed to be my logic.
300 is the bounds of my target image, and I have planned it so images
fit inside this, so x would end up being 300. In a stupid moment, I
set the if statement to run if x>300, which initially it wouldn't be
as it would actually equal 3
On Oct 5, 2010, at 9:32 AM, Shawn Bakhtiar wrote:
> However, for clarity of the OP, x = x + y where y is an int, should be
> typecast correctly as x = x + (float)y
Why? The two are exactly equivalent.
Now if you want to do so as a stylistic preference, that's fine, but there's no
"should" abo
loat)y
>
> Personally when I am writing code, I always write as x = x + 1.0 for clarity
> as well.
>
> Sorry for not understanding the rebuttal :*)
>
>
>> Subject: Re: Confused about floats
>> From: scott_r...@killerbytes.com
>> Date: Tue, 5 Oct 2010 09:24
Thanks for all the help everyone, I'll take a look at it all, and
release where I need to!
Many Thanks
Amy
On 5 Oct 2010, at 4:17PM, Matt Neuburg wrote:
On Tue, 5 Oct 2010 10:17:31 +0100, Amy Heavey >
said:
//select all images for kit
NSArray* kitImages = [kit
valueForKeyPath:@"kitI
)y
Personally when I am writing code, I always write as x = x + 1.0 for clarity as
well.
Sorry for not understanding the rebuttal :*)
> Subject: Re: Confused about floats
> From: scott_r...@killerbytes.com
> Date: Tue, 5 Oct 2010 09:24:13 -0600
> CC: cocoa-dev@lists.apple.com
&
On Oct 5, 2010, at 2:17 AM, Amy Heavey wrote:
> I've got two float values (x and y) that I'm using to change the coordinates
> of a drawing action that is being looped through. I can add a value to x and
> it draws the next image along, but I want to test the value of x and if it is
> out of b
t;
> Can you please explain?
>
> I have plenty of C code, in *.c files that would disagree with you.
>
> You may be correct in that in Objective-C this may no longer be an issue, as
> the compiler does your work for you, but that was not an assumption I was
> making.
>
&g
On Oct 5, 2010, at 9:16 AM, Shawn Bakhtiar wrote:
> Did you just call typecasting "*completely* unnecessary and pointless"...
No, I called typecasting an int type to a floating type, in order to add it to
a floating type, unnecessary and pointless.
> You may be correct in that in Objective-C t
On Tue, Oct 5, 2010 at 8:20 AM, Kyle Sluder wrote:
> The arithmetic conversion rules say that the integer literals will be
> promoted to the appropriate floating point type. So this is perfectly
> fine and does exactly what you expect:
P.S. The promotion doesn't only apply to literals but to othe
On Tue, Oct 5, 2010 at 8:16 AM, Shawn Bakhtiar wrote:
>
>
> Eh?
>
> Did you just call typecasting "*completely* unnecessary and pointless"...
No, he called the specific casting you were performing unnecessary and
pointless, which it is.
The arithmetic conversion rules say that the integer liter
On Tue, 5 Oct 2010 10:17:31 +0100, Amy Heavey
said:
>//select all images for kit
> NSArray* kitImages = [kit
>valueForKeyPath:@"kitItems.kitItemProduct.productImage"];
>
>//set coordinates to x,y -> 0,0 to start
>float x = 0;
>float y = 0;
>//for each image
>NSEnume
r you, but that was not an assumption I was
making.
> Subject: Re: Confused about floats
> From: scott_r...@killerbytes.com
> Date: Tue, 5 Oct 2010 08:56:45 -0600
> CC: cocoa-dev@lists.apple.com
> To: shashan...@hotmail.com
>
> On Oct 5, 2010, at 8:51 AM, Shawn Bakhtiar wro
On Oct 5, 2010, at 8:51 AM, Shawn Bakhtiar wrote:
> Also if x is a float, make sure you use the proper type cast, or values, ie
> ( x = x + 120.00) or (x = y + (double)z , where x and y are double and z is
> an int).
That is *completely* unnecessary and pointless.
--
Scott Ribe
scott_r...@e
5 Oct 2010 09:27:31 -0400
> To: cocoa-dev@lists.apple.com
> Subject: Re: Confused about floats
>
> Amy Heavey wrote:
>
> > I've got two float values (x and y) that I'm using to change the
> > coordinates of a drawing action that is being looped through. I
Amy Heavey wrote:
> I've got two float values (x and y) that I'm using to change the
> coordinates of a drawing action that is being looped through. I can
> add a value to x and it draws the next image along, but I want to test
> the value of x and if it is out of bounds I want to reset it t
I've got two float values (x and y) that I'm using to change the
coordinates of a drawing action that is being looped through. I can
add a value to x and it draws the next image along, but I want to test
the value of x and if it is out of bounds I want to reset it to zero
and increase y, so
26 matches
Mail list logo