Can't use method from class in other file

Posted by user1833848 on Stack Overflow See other posts from Stack Overflow or by user1833848
Published on 2012-11-18T16:56:03Z Indexed on 2012/11/18 16:59 UTC
Read the original article Hit count: 137

Filed under:
|
|
|

I am not able to use one of my methods that i implemented in my tableviewcell file in my tableview controller implementation. I tried searching the web and xcode help with no luck. My codes looks like this:

TableViewController.h:

    #import TableViewCell.h

    @interface TableViewController : UITableViewController


    @property (nonatomic, strong) IBOutlet UIBarButtonItem *A1Buy;
    @property (nonatomic, getter = isUserInteractionEnabled) BOOL userInteractionEnabled;

    - (IBAction)A1Buy:(UIBarButtonItem *)sender;

TableViewController.m:

    @implementation A1ViewController

    @synthesize A1Buy = _A1Buy;
    @synthesize userInteractionEnabled;

    - (IBAction)A1Buy:(UIBarButtonItem *)sender {
   [TableViewCell Enable]; //this is where it gives an error

    }

TableViewCell.h:

    @interface TableViewCell : UITableViewCell {
    BOOL Enable;
    BOOL Disable;
    }
    @property (nonatomic, getter = isUserInteractionEnabled) BOOL userInteractionEnabled;

TableViewCell.m:

    @implementation TableViewCell;

    @synthesize userInteractionEnabled;

    - (BOOL) Enable {
    return userInteractionEnabled = YES;
    }
    - (BOOL) Disable {
    return userInteractionEnabled = NO;
    }

As you can see i am trying to enable user interaction with a button, but Xcode only gives me errors like "class does not have this method" and stuff like that. All files are importet correctly so thats not why. Would appreciate any help. Thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c