• 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: Warning in error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warning in error


  • Subject: Re: Warning in error
  • From: "Hank Heijink (Mailinglists)" <email@hidden>
  • Date: Tue, 22 Dec 2009 13:42:06 -0500

On Dec 22, 2009, at 1:24 PM, Charlie Dickman wrote:

> In MyView.h I have the following code...
>
> @interface MyView : UIView {
> .
> .
> .
> 	id controller;
> }
>
> @property (nonatomic, assign) id controller;
>
> In MyView.m I have...
>
> @implementation MyView
> .
> .
> .
> @synthesize controller;
>
> And when I try to set it's value in MyViewController thusly...
>
> 	[[self view] setController: self];
>
> This last line gets flagged with "UIView may not respond to setController. Even if I explicitly declare "setController" in the MyView.h file I still get the erroneous warning and, yes, I have #import'ed the .h file.

Check the documentation for UIViewController:

@property(nonatomic, retain) UIView *view

Indeed, UIView doesn't respond to setController:. You need to cast it to the appropriate class:

[(MyView *)[self view] setController:self];

Best,
Hank

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Warning in error (From: Charlie Dickman <email@hidden>)

  • Prev by Date: Re: Utilizing OTHER_CFLAGS properly?
  • Next by Date: Re: Utilizing OTHER_CFLAGS properly?
  • Previous by thread: Re: Warning in error
  • Next by thread: Re: Warning in error
  • Index(es):
    • Date
    • Thread