Creating Aviary SDK Binding for Xamarin iOS - ios

I have fair enough knowledge of Xamarin iOS but I am naive to Monotouch Bindings.
I need to use Aviary SDK in my project and I understood by reading through that I need to follow below steps:
Create a Static project in Xcode, linking the Aviary SDK.
Create a Fat Binary file
Create a Binding Project in Xamarin
Add ApiDefinition.cs and StructsAndEnums.cs
Add static library (the fat binary) in Binding Project
And so on.
But the problem is, I am stuck at the very initial step.
I followed this Setup Guide but the issue is, thought I followed the steps, while Importing, I get this error:
AviarySDK/AviarySDK.h file not found
I have downloaded the AviarySDK 4.0.1 which I downloaded from here.
EDIT
Thank you Jonathan Peppers, I have followed your steps, but for ApiDefinition.cs, as per the steps in followed from I understood that I need to generate the ApiDefinition.cs from Objective Sharpie, but I get this error.
Can you help me on this?
In file included from /Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:8:
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:17:8: error: unknown type name 'NSString'
static NSString *const kAFProductEffectsGrunge = #"com.aviary.effectpack.01";
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:22:8: error: unknown type name 'NSString'
static NSString *const kAFProductEffectsNostalgia = #"com.aviary.effectpack.02";
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:27:8: error: unknown type name 'NSString'
static NSString *const kAFProductEffectsViewfinder = #"com.aviary.effectpack.03";
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:37:35: error: cannot find interface declaration for 'NSObject', superclass of 'AFPhotoEditorProduct'
#interface AFPhotoEditorProduct : NSObject
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:44:39: error: unknown type name 'NSString'
#property (nonatomic, copy, readonly) NSString *productName;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:44:1: error: property with 'copy' attribute must be of object type
#property (nonatomic, copy, readonly) NSString *productName;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:52:39: error: unknown type name 'NSString'
#property (nonatomic, copy, readonly) NSString *productDescription;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:52:1: error: property with 'copy' attribute must be of object type
#property (nonatomic, copy, readonly) NSString *productDescription;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:64:39: error: unknown type name 'NSString'
#property (nonatomic, copy, readonly) NSString *internalProductIdentifier;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:64:1: error: property with 'copy' attribute must be of object type
#property (nonatomic, copy, readonly) NSString *internalProductIdentifier;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:16:8: error: unknown type name 'NSString'
extern NSString *const kAFPhotoEditorEffectsIAPEnabledKey;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:21:43: error: cannot find protocol declaration for 'NSObject'
#protocol AFInAppPurchaseManagerDelegate <NSObject>
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:40:4: error: expected a type
- (NSString *)inAppPurchaseManager:(id<AFInAppPurchaseManager>)manager productIdentifierForProduct:(AFPhotoEditorProduct *)product DEPRECATED_ATTRIBUTE;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:40:152: error: expected ':'
- (NSString *)inAppPurchaseManager:(id<AFInAppPurchaseManager>)manager productIdentifierForProduct:(AFPhotoEditorProduct *)product DEPRECATED_ATTRIBUTE;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:51:35: error: cannot find protocol declaration for 'NSObject'
#protocol AFInAppPurchaseManager <NSObject>
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:62:72: error: expected ';' at end of declaration list
#property (nonatomic, weak) id<AFInAppPurchaseManagerDelegate> delegate DEPRECATED_ATTRIBUTE;
^
;
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:62:73: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
#property (nonatomic, weak) id<AFInAppPurchaseManagerDelegate> delegate DEPRECATED_ATTRIBUTE;
^~~~~~~~~~~~~~~~~~~~
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:70:73: error: unknown type name 'BOOL'
#property (nonatomic, assign, readonly, getter=isObservingTransactions) BOOL observingTransactions;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h:62:73: error: cannot declare variable inside #interface or #protocol
#property (nonatomic, weak) id<AFInAppPurchaseManagerDelegate> delegate DEPRECATED_ATTRIBUTE;
^
1 warning and 18 errors generated.
Error while processing /Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFInAppPurchaseManager.h.
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFOpenGLManager.h:28:30: error: cannot find interface declaration for 'NSObject', superclass of 'AFOpenGLManager'
#interface AFOpenGLManager : NSObject
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFOpenGLManager.h:34:40: error: expected a type
+ (void)setPurgeGPUMemoryWhenPossible:(BOOL)purgeGPUMemory;
^
2 errors generated.
Error while processing /Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFOpenGLManager.h.
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorContext.h:39:35: error: cannot find interface declaration for 'NSObject', superclass of 'AFPhotoEditorContext'
#interface AFPhotoEditorContext : NSObject
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorContext.h:45:41: error: unknown type name 'CGSize'
#property (nonatomic, assign, readonly) CGSize size;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorContext.h:48:60: error: unknown type name 'BOOL'
#property (nonatomic, assign, readonly, getter=isCanceled) BOOL canceled;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorContext.h:51:60: error: unknown type name 'BOOL'
#property (nonatomic, assign, readonly, getter=isModified) BOOL modified;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorContext.h:58:41: error: unknown type name 'BOOL'
#property (nonatomic, assign, readonly) BOOL hasBegunRendering;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorContext.h:75:26: error: unknown type name 'UIImage'
- (void)render:(void (^)(UIImage *result))completion;
^
6 errors generated.
Error while processing /Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorContext.h.
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:14:8: error: unknown type name 'NSString'
extern NSString *const kAFEnhance; /* Enhance */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:15:8: error: unknown type name 'NSString'
extern NSString *const kAFEffects; /* Effects */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:16:8: error: unknown type name 'NSString'
extern NSString *const kAFStickers; /* Stickers */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:17:8: error: unknown type name 'NSString'
extern NSString *const kAFOrientation; /* Orientation */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:18:8: error: unknown type name 'NSString'
extern NSString *const kAFCrop; /* Crop */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:19:8: error: unknown type name 'NSString'
extern NSString *const kAFAdjustments; /* Adjustments */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:20:8: error: unknown type name 'NSString'
extern NSString *const kAFSharpness; /* Sharpness */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:21:8: error: unknown type name 'NSString'
extern NSString *const kAFDraw; /* Draw */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:22:8: error: unknown type name 'NSString'
extern NSString *const kAFText; /* Text */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:23:8: error: unknown type name 'NSString'
extern NSString *const kAFRedeye; /* Redeye */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:24:8: error: unknown type name 'NSString'
extern NSString *const kAFWhiten; /* Whiten */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:25:8: error: unknown type name 'NSString'
extern NSString *const kAFBlemish; /* Blemish */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:26:8: error: unknown type name 'NSString'
extern NSString *const kAFMeme; /* Meme */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:27:8: error: unknown type name 'NSString'
extern NSString *const kAFFrames; /* Frames */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:28:8: error: unknown type name 'NSString'
extern NSString *const kAFFocus; /* TiltShift */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:29:8: error: unknown type name 'NSString'
extern NSString *const kAFSplash; /* ColorSplash */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:31:8: error: unknown type name 'NSString'
extern NSString *const kAFLeftNavigationTitlePresetCancel; /* Cancel */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:32:8: error: unknown type name 'NSString'
extern NSString *const kAFLeftNavigationTitlePresetBack; /* Back */
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h:33:8: error: unknown type name 'NSString'
extern NSString *const kAFLeftNavigationTitlePresetExit; /* Exit */
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Error while processing /Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorCustomization.h.
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:17:8: error: unknown type name 'NSString'
static NSString *const kAFProductEffectsGrunge = #"com.aviary.effectpack.01";
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:22:8: error: unknown type name 'NSString'
static NSString *const kAFProductEffectsNostalgia = #"com.aviary.effectpack.02";
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:27:8: error: unknown type name 'NSString'
static NSString *const kAFProductEffectsViewfinder = #"com.aviary.effectpack.03";
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:37:35: error: cannot find interface declaration for 'NSObject', superclass of 'AFPhotoEditorProduct'
#interface AFPhotoEditorProduct : NSObject
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:44:39: error: unknown type name 'NSString'
#property (nonatomic, copy, readonly) NSString *productName;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:44:1: error: property with 'copy' attribute must be of object type
#property (nonatomic, copy, readonly) NSString *productName;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:52:39: error: unknown type name 'NSString'
#property (nonatomic, copy, readonly) NSString *productDescription;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:52:1: error: property with 'copy' attribute must be of object type
#property (nonatomic, copy, readonly) NSString *productDescription;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:64:39: error: unknown type name 'NSString'
#property (nonatomic, copy, readonly) NSString *internalProductIdentifier;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h:64:1: error: property with 'copy' attribute must be of object type
#property (nonatomic, copy, readonly) NSString *internalProductIdentifier;
^
10 errors generated.
Error while processing /Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorProduct.h.
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h:10:8: error: unknown type name 'NSString'
extern NSString *const AFPhotoEditorSessionCancelledNotification;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h:16:35: error: cannot find interface declaration for 'NSObject', superclass of 'AFPhotoEditorSession'
#interface AFPhotoEditorSession : NSObject
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h:22:56: error: unknown type name 'BOOL'
#property (nonatomic, assign, readonly, getter=isOpen) BOOL open;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h:27:61: error: unknown type name 'BOOL'
#property (nonatomic, assign, readonly, getter=isCancelled) BOOL cancelled;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h:32:60: error: unknown type name 'BOOL'
#property (nonatomic, assign, readonly, getter=isModified) BOOL modified;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h:44:51: error: expected a type
- (AFPhotoEditorContext *)createContextWithImage:(UIImage *)image;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h:55:51: error: expected a type
- (AFPhotoEditorContext *)createContextWithImage:(UIImage *)image maxSize:(CGSize)size;
^
/Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h:55:76: error: expected a type
- (AFPhotoEditorContext *)createContextWithImage:(UIImage *)image maxSize:(CGSize)size;
^
8 errors generated.
Error while processing /Users/ramnathiyer/Documents/Projects/Aviary-iOS-SDK/AviarySDK-4.0.1/AviarySDK/AviarySDK.framework/Versions/A/Headers/AFPhotoEditorSession.h.
sharpie-clang-parser exited with error code: 1
System.Exception: sharpie-clang-parser exited with error code: 1
at Sharpie.ObjC.Parser.Parse (System.IO.TextWriter sexpWriter, System.Collections.Generic.List`1 stderrLines) [0x00000] in <filename unknown>:0
at Sharpie.Mac.MainWindowController+<GenerateBinding>c__AnonStorey3.<>m__B (System.Object o) [0x00000] in <filename unknown>:0

If you download the SDK from their website (instead of Github), steps 1 and 2 are already done for you.
In the zip file, there is a AviarySDK.framework folder. This is where Obj-C libraries reside sometimes. The file in Versions/A/AviarySDK needs to be renamed to AviarySDK.a and added to a Xamarin binding project.
You will also need to add all the files in AviarySDKResources.bundle to your project or the library will probably not work correctly.

Related

public private and protected in objective-c

Hi I am trying to learn Opps concept in Objective C but I know PHP so I took a program in which for public, private and protected mentioned bellow.
<?php
//Public properties and method can be inherited and can be accessed outside the class.
//private properties and method can not be inherited and can not be accessed outside the class.
//protected properties and method can be inherited but can not be accessed outside the class.
class one
{
var $a=20;
private $b=30;
protected $c=40;
}
class two extends one
{
function disp()
{
print $this->c;
echo "<br>";
}
}
$obj2=new two;
$obj2->disp(); //Inheritance
echo"<br>";
$obj1=new one;
print $obj1->c; //Outside the class
?>
So this I am trying to convert in Objective c code mentioned bellow.
#import <Foundation/Foundation.h>
#interface one : NSObject
{
#private int a;
#public int b;
#protected int c;
}
#property int a;
#property int b;
#property int c;
#end
#implementation one
#synthesize a,b,c;
int a=10;
int b=20;
int c=30;
#end
#interface two : one
-(void)setlocation;
#end
#implementation two
-(void)setlocation;
{
// NSLog(#"%d",a);
NSLog(#"%d",b);
// NSLog(#"%d",c);
}
#end
int main(int argc, const char * argv[]) {
#autoreleasepool {
// insert code here...
two *newtwo;
newtwo =[[two alloc]init];
//calling function
[newtwo setlocation];
}
return 0;
}
When I run the above code I am getting
2015-11-03 23:20:16.877 Access Specifier[3562:303] 0
Can some one resolve my problem.
This type of question has been asked before and there's a good explanation in the accepted answer for Private ivar in #interface or #implementation
In general I would recommend you avoid instance variables and use #property instead. Properties have the benefit of read-only/write controls, and free synthesized setters and getters (which if you're learning OOP concepts is a critical concept you should employ).
Properties are declared in the #interface part of an Obj-C file. For access control (according to the link) you have no public/private/protected keywords. All Obj-C methods (and by extension, properties) are public if they're defined in the .h file. If you want them "private" you define them in the the .m file using a class category:
//MyClass.m
#interface MyClass ()
#property(nonatomic, retain) NSString* myString;
#end
#implementation MyClass
#end

How to see Swift object properties in Objective-C project?

I'm having Objective-C project and i'd like to try Swift in it. I was able to configure it to use Swift classes. Anyway i can't see Swift object properties while debugging:
I've even overriden description property to print all the variables:
import Foundation
import ObjectMapper
#objc
public class Mcu : NSObject, Mappable {
var name : String?
var arch : String?
var macro : String?
var libraryName : String?
required public init?(_ map: Map) {
}
// Mappable
public func mapping(map: Map) {
name <- map["name"]
arch <- map["arch"]
macro <- map["macro"]
libraryName <- map["libraryName"]
}
override public var description : String {
return "name=\(name), arch=\(arch), macro=\(macro), libraryName=\(libraryName)"
}
}
If i print object in log (NSLog([mcus[0] description])) i
m getting correct string:
2015-11-01 10:27:19.262 Project[1447:261056] name=Optional("avr2"), arch=Optional("ARCH_AVR2"), macro=nil, libraryName=Optional("\"s8515\"")
It's not the solution to convert to Swift all the project as it's pretty large.. What can i do to provide convenient debugging for both Obj-C and Swift in Obj-C project?
PS. Xcode 7.1
PPS. For Swift class Mcu Xcode generates according Obj-c header and it looks correct (but there is difference for debugger):
SWIFT_CLASS("_TtC17ProjectModule3Mcu")
#interface Mcu : NSObject
#property (nonatomic, copy) NSString * __nullable name;
#property (nonatomic, copy) NSString * __nullable arch;
#property (nonatomic, copy) NSString * __nullable macro;
#property (nonatomic, copy) NSString * __nullable libraryName;
#property (nonatomic, readonly, copy) NSString * __nonnull description;
#end

Objective C Macro append to string

I think this is a very simple thing to do, but since I'm new to iOS development and objective C, I can't figure it out.
#define RESTFUL_PATH_PREFIX #"https://gogch.com/gch-restful";
#define LOGIN RESTFUL_PATH_PREFIX #"/login;
I want the result "https://gogch.com/gch-restful/login"
but I'm getting the result as "https://gogch.com/gch-restful"
other topics in stackoverflow mention only about adding a new string to the beginning of a string like,
#define DOMAIN "example.com"
#define SUBDOMAIN "test." DOMAIN
Remove the trailing semi-colon:
#define RESTFUL_PATH_PREFIX #"https://gogch.com/gch-restful";
^
and then string constants can be concatenated by the compiler:
#"first" #"second"
instead of:
#"first"; #"second"
It is much better practice to use constants instead of define macros.
static NSString *const YourPath = #"https://...";
And then you can concatenate your strings with NSString stringWithFormat: method.
Since I made this answer to a question marked as a dupe, I'll also answer it here
Sure, you can use defines OR you can use NSString constants. It's really a matter of preference ... I have however seen both a #define and an NSString const * const being used before. Defines are easier, and you're probably not going to save that much memory by having constants instead of individual immutable instances of NSString all over the place.
Some advice is to think about how you export the NSString constants. You'll probably want EXTERN_PRIVATE instead of EXTERN, but my sample code will allow all clients of your header to read the string constants you've declared therein.
What you can do:
Create a new .m/.c file with a header in Xcode
In the .m/.c file, declare and initialise your constants
Export the constant as necessary so other compilation units can access it
constants.h
#ifndef constants_h
#define constants_h
// Export the symbol to clients of the static object (library)
#define EXTERN extern __attribute__((visibility("default")))
// Export the symbol, but make it available only within the static object
#define EXTERN_PRIVATE extern __attribute__((visibility("hidden")))
// Make the class symbol available to clients
#define EXTERN_CLASS __attribute__((visibility("default")))
// Hide the class symbol from clients
#define EXTERN_CLASS_PRIVATE __attribute__((visibility("hidden")))
#define INLINE static inline
#import <Foundation/Foundation.h>
EXTERN NSString const * _Nonnull const devBaseUrl;
#endif /* constants_h */
constants.m
#include "constants.h"
NSString const * _Nonnull const devBaseUrl = #"http://127.0.0.1:8000/";
main.m
#import <Foundation/Foundation.h>
#import "constants.h"
int main(int argc, const char * argv[]) {
#autoreleasepool {
NSLog(#"Constant value: %#", devBaseUrl);
// Prints: Constant value: http://127.0.0.1:8000/
}
return 0;
}

Global constants in a static library are nil at run time

I have a static library which contains some constants such as:
// constants.h
NSString* const KDefaultProtocol;
// constants.m
NSString* const kDefaultProtocol = #"https";
// OtherCode.m
NSString *s = kDefaultProtocol;
When I run an app which links to the library the value of kDefaultProtocol is nil. Why is that?
(constants.m is included in the library compile sources section).
// constants.h
NSString* const KDefaultProtocol;
This one is incorrect. You meant:
// constants.h
extern NSString* const KDefaultProtocol;
The reason you're not getting the warning you should is because you've used mismatched the case of the leading K (which raises the question of how OtherCode.m even compiles; I suspect this is not exactly the code in question).
Try it->
// constants.h
static NSString * const KDefaultProtocol = #"https";

How to access to an object inside a C function

I need to get access to an object inside a C function similar to this few code
#interface MixerHostAudio () <UIApplicationDelegate>
#property (readwrite) int *alternativeOutput;
#end
#implementation MyCode
#synthesize alternative
void audioInputAvailable () {
alternative=1;
}
I get this error: " 'Use of undeclared identifier 'alternative' "
Any ideas about how can i solve it ?
You have to make your "MyCode" object available somewhere for your C glue function to pick up. For example, if you have a pointer to your MyCode object...
void audioInputAvailable(MyCode *myCodeObject){
myCodeObject.alternative = 1;
}

Resources