• C

how to differentiate events from methods

hi guys, apologies if this is a silly question but i'm trying to learn more about Xcode so pardon me if you will = )

how do i tell if a method is an event that will be called as part of the lifecycle or a custom defined method?

e.g.

-(void)iamdoingsomething
{

}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    [self configureView];
}

Open in new window


viewDidLoad is an iOS event whilst iamdoingsomething is my own custom method.

other than click on it whilst holding option, is there any other way i can differentiate? and can i sort all the events at the bottom and all my custom methods at the top? thanks!
developingprogrammerAsked:
Who is Participating?
 
satsumoConnect With a Mentor Software DeveloperCommented:
There isn't any particular distinction, they are both methods of that class. In the example above, viewDidLoad is a method inherited from the super class but thats the only real difference. iamdoingsomething cannot call [super iamdoingsomething] but that not every inherited method calls its super class method.

I do the same thing, keep the specific methods separated from the inherited ones. Did you know that in Obj-C, as in C, you don't have to declare the methods in the interface unless you want them to be externally visible. If the inherited methods are going to call an instance method in the same file the compiler only has to see it first. Same goes for class methods.
0
 
developingprogrammerAuthor Commented:
hi satsumo, thanks for your help and apologies for the late reply! ah it's good to know that i'm thinking down the same track as you and i will definitely need to organise my code properly so it's easily readable / maintainable. thanks once again satsumo!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.