Re: Accessing method from another class
Re: Accessing method from another class
- Subject: Re: Accessing method from another class
- From: "Eric E. Dolecki" <email@hidden>
- Date: Thu, 20 Aug 2009 16:48:42 -0400
I'd like to know how I can get a property from a ViewController class (that
I don't instantiate myself with a pointer) - I've tried importing the view's
.h and I set a getter for the variable (say a BOOL), and when I try to read
it from another viewController's class it tells me it's not part of the
specified class?
On Thu, Aug 20, 2009 at 4:11 PM, Steve Christensen <email@hidden> wrote:
> If your logging code is displaying a message on entry to resetTextAndBar:,
> but nothing after that, it sounds like you're taking an exception. In your
> code snippet below, you're calling [self updateText], but in the last
> sentence of your problem description, you mention a method called
> updateText: (with trailing colon). Which is it?
>
> You might check any warnings you're receiving during compilation because,
> at least for me, if I accidentally reference a method that's not part of the
> specified class, I get a "class foo may not respond to method bar" sort of
> warning.
>
> steve
>
>
> On Aug 20, 2009, at 12:18 PM, PCWiz wrote:
>
> This is going to seem like a complete newbie question, but I can't get
>> this to work. I have a class with a method called "resetTextAndBar:" which
>> just basically resets some text and a progress bar to match up with new data
>> inserted into the table view:
>>
>> - (void)resetTextAndBar:(id)sender {
>> [self updateText];
>> [bar setNeedsDisplay:YES];
>> }
>>
>> I need to call this method from a separate class.
>>
>> I've tried using #import and forward class (@class), and using NSLog I
>> determined that the method IS being called, but the 2 methods (updateText:
>> and setNeedsDisplay:) arent being called
>>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
--
http://ericd.net
Interactive design and development
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden