I have an application designed for iPhone OS 2.x.
At some point I have this code
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
But since the initWithFrame selector is deprecated in 3.0, I need to convert this code with responseToSelector and execute a Selector ... like this ...
if ( [cell respondsToSelector:@selector(initWithFrame:)] ) { // iphone 2.0 // [cell performSelector:@selector(initWithFrame:) ... ???? what? }
My problem: how can I break the call of A into preformSelector if I need to pass two parameters: initWithFrame: CGRectZero and "reuseIdentifier: myIdentifier" ???
EDIT - As fbrereto said, I did it
[cell performSelector:@selector(initWithFrame:reuseIdentifier:) withObject:CGRectZero withObject:myIdentifier]
I have an "incompatible type error for argument 2 of 'performSelector: withObject: withObject' .
myIdentifier is declared as follows
static NSString *myIdentifier = @"Normal";
I tried to change the call
[cell performSelector:@selector(initWithFrame:reuseIdentifier:) withObject:CGRectZero withObject:[NSString stringWithString:myIdentifier]];
without success ...
Another point: CGRectZero is not an object ...
source share