• 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: Overriding target and action of backBarButtonItem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding target and action of backBarButtonItem


  • Subject: Re: Overriding target and action of backBarButtonItem
  • From: charisse napeÿfffff1as <email@hidden>
  • Date: Fri, 14 Jan 2011 19:02:15 -0800 (PST)

Hello Matt,

Yeah. that's what I also thought. I just needed somebody who knows more to
actually confirm it.

Anyway, So how can I customize what happens when the user presses the back
button?



THanks,
Charisse


________________________________
From: Matt Neuburg <email@hidden>
To: charisse nape?fffff1as <email@hidden>
Cc: email@hidden
Sent: Friday, January 14, 2011 23:47:12
Subject: Re: Overriding target and action of backBarButtonItem

On Fri, 14 Jan 2011 01:17:58 -0800 (PST), charisse nape?fffff1as
<email@hidden> said:
>Hello Guys,
>
>I have trouble setting the action for my backbarbutton item. No matter how I set
>
>it, my selector does not get called.
>Here is my code below:
>
>
>        UIBarButtonItem *backB = [[UIBarButtonItem alloc] init];
>backB.title = @"Back";
>backB.action = @selector(disconnect:);
>    self.navigationItem.backBarButtonItem = backB;
>    [backB release];
>
>Assume I created a disconnect() function already.
>
>But if I use leftBarButtonItem my function gets called. Is this because the
>backBarButton item already has its function to dismiss the view? Can't I
>override it somehow?

No, you really can't. A backBarButton item should have a nil select and target,
allowing it to perform its standard function, namely to go back. However, you
can perform other trickery that allows you to customize what happens at that
moment. You can change beforehand what the user will go back *to*, and you can
hear through a notification when the user does go back. Any further advice would
depend upon your explaining what you are really trying to accomplish. m.

--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings


_______________________________________________

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

References: 
 >Re: Overriding target and action of backBarButtonItem (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: NSSegmentedControl Label
  • Next by Date: Re: Determining whether a dictionary is mutable or not
  • Previous by thread: Re: Overriding target and action of backBarButtonItem
  • Next by thread: Mutable to-many relationship not observable
  • Index(es):
    • Date
    • Thread