Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 13, 2010, 08:39 AM   #1
srinivas.be88
macrumors newbie
 
Join Date: Aug 2010
hello events

Code:
#import <UIKit/UIKit.h>
#import "HelloEvents.h" 
 
enum 
{
	kTagSprite = 1,
};

@implementation HelloEvents
 
-(id) init
{
        if( (self=[super init] )) {
               self.isTouchEnabled = YES;
                self.isAccelerometerEnabled = YES;
                 CCLabel* label = [CCLabel labelWithString:@"Hello Events"      fontName:@"Marker Felt" fontSize:64];
 
               CGSize size = [[CCDirector sharedDirector] winSize];
 
                label.position =  ccp( size.width /2 , size.height/2 );
 
              [self addChild: label];
            CCSprite *sprite = [CCSprite spriteWithFile:@"grossini.png"];
                sprite.position = ccp( 50, 50);
                [self addChild:sprite z:1 tag:kTagSprite];              
        }
        return self;
}
 
- (void) dealloc
{
        [super dealloc];
}
hi to all ,
i am new to this. please explain the enum tag why we put this and the [self addChild:sprite z:1 tag:kTagSprite];

Last edited by SilentPanda; Aug 13, 2010 at 08:43 AM. Reason: code tags
srinivas.be88 is offline   0 Reply With Quote
Old Aug 13, 2010, 12:59 PM   #2
chown33
macrumors 603
 
Join Date: Aug 2009
The enum keyword means the same thing as in plain C.

Look it up in a C reference book or online article.
chown33 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhoto - Creating 'Events' within 'Events'? Big Stevie Mac Applications and Mac App Store 47 Aug 26, 2013 03:30 PM
Apple Events jmsimpso Community Discussion 0 May 14, 2013 12:23 PM

Forum Jump

All times are GMT -5. The time now is 12:11 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC