Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6621221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:14:03+00:00 2026-05-25T21:14:03+00:00

I’m attempting to do what is shown on the MonoTouch binding page and add

  • 0

I’m attempting to do what is shown on the MonoTouch binding page and add some methods to a bound class. It says that all I have to do is include these in a partial class defined in a separate file that is included in the generation process with the -s option. The problem is that the generated class is not a partial class and when I run btouch I get the following errors:

$ /Developer/MonoTouch/usr/bin/btouch -v Node.cs -s:Extensions.cs
/Developer/MonoTouch/usr/bin/smcs -unsafe -target:library Node.cs -nowarn:436 -out:/var/folders/cy/g71b7mr91rn4slbpq5cm39140000gn/T/u983s550.k1k/temp.dll -r:/Developer/MonoTouch/usr/lib/btouch/btouch.exe Extensions.cs -r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll
Node.cs(7,19): error CS0260: Missing partial modifier on declaration of type NodeNameSpace.Node'. Another partial declaration of this type exists
Extensions.cs(5,30): (Location of the symbol related to previous error)
Extensions.cs(5,30): error CS0261: Partial declarations of
NodeNameSpace.Node’ must be all classes, all structs or all interfaces
Node.cs(7,19): (Location of the symbol related to previous error)
Extensions.cs(7,29): error CS0106: The modifier public' is not valid for this item
Extensions.cs(10,25): error CS0531:
NodeNameSpace.Node.IsExpanded.get’: interface members cannot have a definition
Extensions.cs(14,25): error CS0531: `NodeNameSpace.Node.IsExpanded.set’: interface members cannot have a definition
Compilation failed: 5 error(s), 0 warnings
btouch: API binding contains errors.

According to the MonoTouch page on binding:

Each class produced by the generator from the API definition file is a partial class

Node.cs

using System;
using MonoTouch.Foundation;

namespace NodeNameSpace
{
    [BaseType (typeof (NSObject))]
    interface Node
    {
        [Export ("expanded")]
        NSNumber Expanded { get; set; }
    }
}

Extensons.cs

using MonoTouch.Foundation;

namespace NodeNameSpace 
{
    public partial class Node
    {
        public bool IsExpanded
        {
            get
            {
                return Expanded.BoolValue;
            }
            set
            {
                Expanded = NSNumber.FromBool(value);
            }
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:14:04+00:00Added an answer on May 25, 2026 at 9:14 pm

    It’s a long documentation page, but this should do what you want:

    $ /Developer/MonoTouch/usr/bin/btouch Node.cs -x:Extensions.cs  
    $ ls -l Node.dll 
    -rwxr-xr-x  1 sebastienpouliot  staff  5120 30 Sep 13:30 Node.dll
    

    Your issue was using -s which is used when compiling your interface to a partial class (too early for extensions methods) and to compile the bindings to a .dll.

    What you wanted is -x where the source file would only be used for the second compilation (source to .dll). The -s option is most useful for enums since you’ll need them in both your interfaces and in the final assembly (.dll).

    To get further help do:

    /Developer/MonoTouch/usr/bin/btouch --help
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.