views:

48

answers:

2

Ok, here is the deal, I keep on getting this warning :

'AppDelegate' may not respond to '-setViewMovedUp:'

This is my implementation file :

- (IBAction)viewUp {

    AppDelegate *moveUp = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    [moveUp setViewMovedUp:YES]; //move Shot View
    [self setViewMovedUp:YES];

}

and this is my AppDelegate Implementation file :

- (void)setViewMovedUp:(BOOL)movedUp {

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];

    CGRect rect = shotView.frame;
    if (movedUp)
    {
        rect.size.height -= 200;
    }
    shotView.frame = rect ;

    CGRect rect2 = pageControl.frame;
    if (movedUp)
    {
        rect2.size.height -= 395;
    }
    pageControl.frame = rect2 ; 

    [UIView commitAnimations];


}

I'm gessing that I get a warning because the AppDelegate is not a view, but inside the method I`m calling a view, is there a way I can code differently and better to get this annoying warning go away ? ( the method still works by the way ... )

Thanks !

+1  A: 

Warning should go away if you declare method in app delegate header file:

//AppDelegate.h
...
- (void)setViewMovedUp:(BOOL)movedUp;
Vladimir
A: 

You need to declare the method in your interface (.h) file. Put this in your AppDelegate.h:

- (void)setViewMovedUp:(BOOL)movedUp;

That should do it.

Greg Sexton
Did the trick, thanks !
Julz