Jump to content

Basic's of Objective-C (for beginner Flex Hacks)


12 posts in this topic

Recommended Posts

Updated (edited)

Basic's of Objective-C 

 

 

Object Creation

 

Object creation basically explains itself in it's name, it creates 'objects' that you can use in your app ( or in our case hack/edit )

 

A template would be as followed:

MyClass *objectName = [[MyClass alloc]init] ;
 
The "objectName" as seen in the example code above is the name of the code, and the MyClass is the name of your project and your basically creating a stem from it to thus create something amazing (or hack/edit in our case)
 
 
 

Methods-A method is a code block that contains a series of statements

Method is declared in Objective C as follows −

- (returnType)methodName:(typeName)variable1 argument1:(typeName)variable2;

An example is shown:

-(void)calculateAreaForRectangleWithLength CGfloat)length
andBreadth CGfloat)breadth;

  Instance Methods-When no static modifier is present, the method is said to be an instance method

 

Instance methods can be accessed only after creating an object for the class. Memory is allocated to the instance variables. An example instance method is shown below.

-(void)simpleInstanceMethod;

It can be accessed after creating an object for the class as follows −

MyClass *objectName = [[MyClass alloc]init] ;
[objectName simpleInstanceMethod];

Important Data Types in Objective C

 

 

Data Type

 

1 NSString

Used for representing a string.

2 CGfloat

Used for representing a floating point value (normal float is also allowed but it's better to use CGfloat).

3 NSInteger

Used for representing integer.

4 BOOL

Used for representing Boolean (YES or NO are BOOL types allowed).

You can further your knowledge with Objective-C and start making flex hacks (and maybe converting to .deb) here: https://iosgods.com/topic/904-tutorialvideo-hack-games-with-flex-and-convert-it-to-deb-tweak/

 

 

 

~MightySquad

Updated by MightySquad
  • Like 1
Posted (edited)

Nice

 

I have to change forum theme..

Please use code because  appears as emoji
Updated by Basmal121
Posted

Change font man , not very readable makes you're tutorial look horrible , I don't even care what it's about as you're choice of font made me leave the thread , if you want people to stay and read I suggest you choose another font , prefebly just the default font.

Posted

Not understanding what your saying, seems you quoted the code from above.

 

 

It's actually: 

- (returnType)methodName:(typeName)variable1 argument1:(typeName)variable2;

Your Example:

- (void)calculateAreaForRectangleWithLength:(CGfloat)length andBreadth:(CGfloat)breadth;
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines