Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Objective-c > Creating a Obje...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 902 of 1009
Post > Topic >>

Creating a Object

by franciscsimon@[EMAIL PROTECTED] Sep 16, 2007 at 02:53 PM

Hi @[EMAIL PROTECTED]
'm new to Objective C and i tried to write a class and implement a
new Object but it does not work:

******************************************************************************************************************************

Runtime.h->file:

******************************************************************************************************************************

@[EMAIL PROTECTED]
 Runtime{

int *test;


}

-( void )sayHello;

@[EMAIL PROTECTED]
 -> file:

******************************************************************************************************************************

#im****t "Runtime.h";
#im****t <stdio.h>;

@[EMAIL PROTECTED]
 Runtime{

}

-(void)sayHello{

	printf( "Hello my World !!!" );

}

@[EMAIL PROTECTED]
 -> file:

******************************************************************************************************************************

#im****t "Runtime.m";


int main( int argc, const char *argv[] ){

	Runtime *r = [ Runtime alloc ];

	[ r sayHello ];

	return 0;

}

******************************************************************************************************************************

When I try to compile the main file gcc -c main.m

i get this errors:

main.m: In function 'main':
main.m:6: warning: 'Runtime' may not respond to '+alloc'
main.m:6: warning: (Messages without a matching method signature
main.m:6: warning: will be assumed to return 'id' and accept
main.m:6: warning: '...' as arguments.)

******************************************************************************************************************************

Can somebody help me please ?

THX a lot !

Frank

:-)
 




 8 Posts in Topic:
Creating a Object
franciscsimon@[EMAIL PROT  2007-09-16 14:53:34 
Re: Creating a Object
Gregory Weston <uce@[E  2007-09-16 11:09:03 
Re: Creating a Object
franciscsimon@[EMAIL PROT  2007-09-16 18:24:02 
Re: Creating a Object
Michael Ash <mike@[EMA  2007-09-16 13:29:53 
Re: Creating a Object
franciscsimon@[EMAIL PROT  2007-09-16 18:54:56 
Re: Creating a Object
Graham J Lee <info.tha  2007-09-16 22:34:41 
Re: Creating a Object
franciscsimon@[EMAIL PROT  2007-09-17 02:07:09 
Re: Creating a Object
franciscsimon@[EMAIL PROT  2007-09-17 03:13:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 0:40:09 CDT 2008.