• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: noob: Question about senders and views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: noob: Question about senders and views


  • Subject: Re: noob: Question about senders and views
  • From: "Eric E. Dolecki" <email@hidden>
  • Date: Wed, 8 Apr 2009 15:00:14 -0400

I have the method being called now in SecondViewController, but suddenly my
UILabel there is (null). ??

// Called from the FirstViewController

-(void)populateTextFieldWithString:(id)string {

[commandText2 setText:string];

NSLog(@"populateTextFieldWithString: %@, %@", string, commandText2 ); //
string is okay but the UILabel is (null)

}

A scope issue?


On Wed, Apr 8, 2009 at 2:12 PM, I. Savant <email@hidden> wrote:

> On Wed, Apr 8, 2009 at 1:58 PM, Eric E. Dolecki <email@hidden>
> wrote:
> > How can I make FirstViewController aware of the method in the second
> class?
> > I tried import and still got a warning.
> ...
> > [SecondViewController populateTextFieldWithString:@"hey there"];
> ...
> > As soon as I call that method the app bombs... it has no idea what that
> > method in the SecondViewController is...
>
>   You're missing some very basic Objective-C concepts. Give this
> entire document a *thorough* read:
>
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html
>
>  Essentially, you're sending an "instance method" message to a class.
> You need to understand the difference between a class and an instance
> of a class. With that understanding, you need to read about the MVC
> design pattern:
>
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html#//apple_ref/doc/uid/TP40002974-CH6-SW1
>
>  ... then consider your application's architecture. This is how you
> decide where the best place is (some main controller in your case) to
> hold the reference (or outlet) to an instance of your
> SecondViewController.
>
> --
> I.S.
>



--
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

  • Follow-Ups:
    • Re: noob: Question about senders and views
      • From: "I. Savant" <email@hidden>
References: 
 >noob: Question about senders and views (From: "Eric E. Dolecki" <email@hidden>)
 >Re: noob: Question about senders and views (From: Craig Williams <email@hidden>)
 >Re: noob: Question about senders and views (From: "Eric E. Dolecki" <email@hidden>)
 >Re: noob: Question about senders and views (From: "I. Savant" <email@hidden>)

  • Prev by Date: Cocoaheads Lake Forest (92630) meeting 4/8/2009 (tonight!) at 7 pm on "Online courses for Mac and iPhone development"
  • Next by Date: Re: noob: Question about senders and views
  • Previous by thread: Re: noob: Question about senders and views
  • Next by thread: Re: noob: Question about senders and views
  • Index(es):
    • Date
    • Thread