I have created an iOS binding project, add my static library which created the following linkwith.cs content with some added frameworks and linker flags I need
[assembly: LinkWith ("libMyLibrary-iOS.a", LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator,Frameworks = "CoreTelephony SystemConfiguration UIKit Foundation CoreGraphics", LinkerFlags = "-ObjC -all_load -lz -lstdc++", ForceLoad = true )]
In the ApiDefinition.cs file I copied what tthe Objective-Sharpie created with some corrections and addition that missed. Also moved all enums to the StructsAndEnums.cs.
I noticed something strange too, intelisense is not working for some attributes, specifically BaseType and Static are red and not recognized, with the enums in the StructsAndEnums.cs file. Build is successful the second time, if I clean and try to build I get error in the autogenerated file or if I try to rebuild I get the error always, second build is fine.
The static library file is 12.5MB but the result .dll release build is only 4kb which I find really strange, and since it's not the first binding library I create I know that the .a library should be merged into the .dll library.
Checking the build action of the files looks correct.
libMyLibrary-iOS.a -> ObjcBindingNativeLibrary
ApiDefinition.cs -> ObjcBindingDefinition
StructsAndEnums.cs -> ObjcBindingCoreSource
No project properties are modified or added, just new binding project of Xamarin Studio 5.3 (build 441).
In the solution I created a single view application, added the binding project library as a reference but there is no namespace visible to use the interface contracts.
Are there any actions I could take to resolve or debug the issue?
[EDIT]
The compile error I get when rebuilding the project is about a block I set like this
public delegate string SPLJSONModelKeyMapBlock (string keyName);
and use it in this interface
[BaseType (typeof (NSObject))]
public partial interface SPLJSONKeyMapper {
[Export ("JSONToModelKeyBlock")]
SPLJSONModelKeyMapBlock JSONToModelKeyBlock { get; }
[Export ("modelToJSONKeyBlock")]
SPLJSONModelKeyMapBlock ModelToJSONKeyBlock { get; }
[Export ("initWithJSONToModelBlock:modelToJSONBlock:")]
IntPtr Constructor (SPLJSONModelKeyMapBlock toModel, SPLJSONModelKeyMapBlock toJSON);
[Export ("initWithDictionary:")]
IntPtr Constructor (NSDictionary map);
[Static, Export ("mapperFromUnderscoreCaseToCamelCase")]
SPLJSONKeyMapper MapperFromUnderscoreCaseToCamelCase { get; }
[Static, Export ("mapperFromUpperCaseToLowerCase")]
SPLJSONKeyMapper MapperFromUpperCaseToLowerCase { get; }
}
A screenshot of the errors in Trampolines.g.cs
Update
Try returning NSString
from the delegate instead of string:
public delegate NSString SPLJSONModelKeyMapBlock (string keyName);
First answer
It looks like the second rebuild isn't done correctly (if it fails the first time it should fail the second).
In other words you need to fix (or report to us) the build errors you're getting in the autogenerated files.