Bug 2575 - UIBarButtonItems do not work
Summary: UIBarButtonItems do not work
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-12-19 15:47 UTC by Jörg Schanko
Modified: 2013-09-13 08:12 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

xib, designer and cs file (4.60 KB, application/zip)
2011-12-19 15:47 UTC, Jörg Schanko

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jörg Schanko 2011-12-19 15:47:44 UTC
Created attachment 1070 [details]
xib, designer and cs file

I'm updating an older project now with MonoTouch 5.0.3 and MonoDevelop 
Everything works - except UIBarButtonItems. 
In XCode, the .h file looks like: 

@interface vcTimerChoose : UIViewController { 
        UITableView *_myTableView; 

@property (retain, nonatomic) IBOutlet UIBarButtonItem *BarButton; 

@property (nonatomic, retain) IBOutlet UITableView *myTableView; 

- (IBAction)BarButton_Click:(id)sender; 

(pretty much the same as in the older VC in my project), but it doesn't work. 
When I try to compile the project 
partial void BarButton_Click (MonoTouch.UIKit.UIBarButtonItem sender) 
gives a "A partial method 'ShoCoIP.vcTimerChoose.BarButton_Click((MonoTouch.UIKit.UIBarButtonItem)' implementation is missing a partial declaration" error and 
BarButton.Title=NSBundle.MainBundle.LocalizedString("Settings","Timer Settings"); 
throws a "System.NullReferenceException: Object reference not set to an instance of an object" exception, though the exct same code works in other viewController in the same project (created with an older version of MonoTouch).
Comment 1 Sebastien Pouliot 2012-01-20 15:55:26 UTC
-> monotouch

If your application was made before Xcode 4.x then it likely needs to be updated to use [Outlet]s attributes. In this case the following document should help you:

Comment 2 Marius Ungureanu 2013-09-13 08:12:52 UTC