• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSInteger compare - Help Needed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSInteger compare - Help Needed


  • Subject: Re: NSInteger compare - Help Needed
  • From: Steve Wetzel <email@hidden>
  • Date: Sun, 18 Jul 2010 12:21:35 -0500

Thanks guys, that was the problem,  There are so many little things to learn with Objective C.

Steve
Steve’s daily photo blog





On Jul 17, 2010, at Jul 17:3:04 PM, Carter Allen wrote:

> Steve,
>
> Have you tried changing "<<" in your code to simply "<"? That may work.
>
> - Carter Allen
>
> On Jul 17, 2010, at 1:58 PM, Steve Wetzel wrote:
>
>> Hi all,
>>
>> I am new to Cocoa programming and am trying to do something that I thought was straightforward but not working.  I am using the tag field of a button to tell me what button is pushed.  This code does not work
>>
>> - (IBAction) numberPressed:(id)sender {
>> 	NSLog(@"Sender tag is:%d", [sender tag]);
>> 	if ([sender tag] << 10) {
>> 		displayValues.rawNumber = [displayValues.rawNumber stringByAppendingString:[NSString stringWithFormat:@"%d", [sender tag]]];
>> 	}
>>
>> buttons with tags 1-9 work great but the button with tag 0 does not.  When I pass tag 0 the if statement is evaluated as false.
>>
>> When I press button with tag 1 I get "Sender tag is:1" and the if statement is evaluated as true.
>> When I press button with tag 0 I get "Sender tag is:0" and the if statement is evaluated as false.
>>
>> What is going wrong here?
>>
>> Steve
>> Steve’s daily photo blog
>>
>>
>>
>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSInteger compare - Help Needed
      • From: Sherm Pendley <email@hidden>
    • Re: NSInteger compare - Help Needed
      • From: Dave Carrigan <email@hidden>
References: 
 >NSInteger compare - Help Needed (From: Steve Wetzel <email@hidden>)
 >Re: NSInteger compare - Help Needed (From: Carter Allen <email@hidden>)

  • Prev by Date: Re: Initializing unichar variable with a human readable letter
  • Next by Date: Re: NSInteger compare - Help Needed
  • Previous by thread: Re: NSInteger compare - Help Needed
  • Next by thread: Re: NSInteger compare - Help Needed
  • Index(es):
    • Date
    • Thread