Your question is very confusingly phrased and incomplete (please include code that has errors and the exact error message(s)), but I'll answer the three things I think you might be asking about.
If your problem is that you want to have the same code in both methods, extract the common part of the two methods into a third method, and have them both call that.
- (IBAction) button {
stuff
[self commonPart];
}
- (void) viewDidAppear {
stuff
[self commonPart];
}
- (void) commonPart {
stuff they both do
}
If your problem is that you need to know something about the state of your UI in your viewDidAppear method, you can use an IBOutlet to reference the controls in question.
- (void) viewDidAppear {
if (self.findMeButton.someThingYouWantToCheck) {
self.mapView.showsUserLocation = YES;
[mapView setCenterCoordinate:mapView.userLocation.coordinate animated:YES];
}
}
If your problem is that you need to store whether a button has been pressed so that you can do different actions based on it later, just add a BOOL instance variable to your object and set it to YES in the button pressed IBAction.
Were any of those what you were trying to do?