Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
UICalloutView - iPhone Development Wiki


From iPhone Development Wiki
Revision as of 09:14, 22 November 2009 by KennyTM~ (talk | contribs) (→‎UICalloutView delegate)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
UICalloutView in action

UICalloutView is a "callout" view which looks like a dialog box. It was used in

Using UICalloutView

UICalloutView* callout = [UICalloutView sharedCalloutView];
[callout setTitle:@"Title"];
[callout setSubtitle:@"subtitle"];
[callout addTarget:self action:@selector(closeCalloutView:)];
[window addSubview:callout];
[callout setAnchorPoint:CGPointMake(80, 40) boundaryRect:[UIScreen mainScreen].applicationFrame animate:YES];


-(void)closeCalloutView:(UIButton*)sender {
  [(UICalloutView*)sender.superview fadeOutWithDuration:1];

UICalloutView delegate

Signature @property(assign,nonatomic) id delegate;
Available in 2.0 –

One could assign a delegate to a UICalloutView. The delegate must conform to the informal protocol:

@protocol UICalloutViewDelegate
-(void)calloutView:(UICalloutView*)calloutView willMoveToAnchorPoint:(CGPoint)newPoint animated:(BOOL)animated;
-(void)calloutView:(UICalloutView*)calloutView didMoveToAnchorPoint:(CGPoint)newPoint animated:(BOOL)animated;