One way is to pass parameters in the set selector method.
I find it more OO to create a new object which derive from UIButton, and add the button needed properties to it.
Example:
//
// MenuButton.h
// Trivia
//
// Created by Eylon Steiner on 1/23/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MenuButton : UIButton {
int customVal;
}
@property int customVal;
@end
–
//
// MenuButton.m
// Trivia
//
// Created by Eylon Steiner on 1/23/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import “MenuButton.h”
@implementation MenuButton
@synthesize customVal;
@end
—–
Set it like:
a1 = [MenuButton buttonWithType:UIButtonTypeCustom];
[a1 setCustomVal:cnt];
—
And use it like:
- (void)networkAdminButtonPressed:(UIButton *)button {
DebugLog (@”button : %d”, [(MenuButton*) button customVal]);