Hello Everyone,

I am combining cocoa code in Qt, unfortunately a symbol not found error occurred.
I am using MAC OSX 10.8.2 and Qt Creator to build my code.

appcontroller.h
Qt Code:
  1. #ifndef APPCONTROLLER_H
  2. #define APPCONTROLLER_H
  3.  
  4. // Import the Cocoa and ImageCaptureCore headers
  5. #include <Cocoa/Cocoa.h>
  6. #include <ImageCaptureCore/ImageCaptureCore.h>
  7.  
  8. // Create a public interface for the controller
  9. @interface appController : NSObject
  10.  
  11. // Create delegates for the device browser and camera device classes.
  12. <ICDeviceBrowserDelegate, ICCameraDeviceDelegate> {
  13.  
  14. // Create an instance variable for the device browser
  15. // and an array for the cameras the browser finds
  16. ICDeviceBrowser * mDeviceBrowser;
  17. NSMutableArray * mCameras;
  18.  
  19. // Define Interface Builder outlets for two
  20. // array controllers -- one for cameras,
  21. // one for the chosen camera's files
  22. IBOutlet NSArrayController * mCamerasController;
  23. IBOutlet NSArrayController * mMediaFilesController;
  24.  
  25. // Define IB outlets for the tableviews used to
  26. // display the cameras and the chosen camera's contents
  27. IBOutlet NSTableView * mCameraContentTableView;
  28. IBOutlet NSTableView * mCamerasTableView;
  29. }
  30.  
  31. // Cameras are properties of the device browser stored in an array
  32. @property(retain) NSMutableArray* cameras;
  33.  
  34. // Create a boolean to indicate whether the camera has images to download
  35. @property(readonly) BOOL canDownload;
  36. @end
  37.  
  38.  
  39. #endif // APPCONTROLLER_H
To copy to clipboard, switch view to plain text mode 


appcontroller.mm
Qt Code:
  1. #include "appcontroller.h"
  2.  
  3. // The camera device returns core graphics image refs,
  4. // convert them to NSImages for table view
  5. @interface NSImageFromCGImageRef: NSValueTransformer {}
  6. @end
  7. @implementation NSImageFromCGImageRef
  8. + (Class)transformedValueClass { return [NSImage class]; }
  9. + (BOOL)allowsReverseTransformation { return NO; }
  10. - (id)transformedValue:(id)item
  11. {
  12. if ( item )
  13. return [[[NSImage alloc] initWithCGImage:(CGImageRef)item size:NSZeroSize] autorelease];
  14. else
  15. return nil;
  16. } @end
  17. @implementation appController
  18.  
  19. // synthesize the getters and setters for camera properties
  20. @synthesize cameras = mCameras;
  21.  
  22. // Main task -- on launch
  23. - (void)applicationDidFinishLaunching:(NSNotification*)notification
  24. {
  25. mCameras = [[NSMutableArray alloc] initWithCapacity:0];
  26.  
  27. // Get an instance of ICDeviceBrowser
  28. mDeviceBrowser = [[ICDeviceBrowser alloc] init];
  29. // Assign a delegate
  30. mDeviceBrowser.delegate = self;
  31. // Look for cameras in all available locations
  32. mDeviceBrowser.browsedDeviceTypeMask = mDeviceBrowser.browsedDeviceTypeMask
  33. | ICDeviceTypeMaskCamera
  34. | ICDeviceLocationTypeMaskLocal
  35. | ICDeviceLocationTypeMaskShared
  36. | ICDeviceLocationTypeMaskBonjour
  37. | ICDeviceLocationTypeMaskBluetooth
  38. | ICDeviceLocationTypeMaskRemote;
  39. // Start browsing for cameras
  40. [mDeviceBrowser start];
  41.  
  42. }
  43.  
  44. // Stop browser and release it when done
  45. - (void)applicationWillTerminate:(NSNotification*)notification {
  46. mDeviceBrowser.delegate = NULL;
  47. [mDeviceBrowser stop];
  48. [mDeviceBrowser release];
  49. [mCameras release];
  50. }
  51.  
  52. // Method delegates for device added and removed
  53. //
  54. // Device browser maintains list of cameras as key-value pairs, so delegate
  55. // must call willChangeValueForKey to modify list
  56. - (void)deviceBrowser:(ICDeviceBrowser*)browser didAddDevice:(ICDevice*)addedDevice moreComing:(BOOL)moreComing
  57. {
  58. if ( addedDevice.type & ICDeviceTypeCamera )
  59. {
  60. addedDevice.delegate = self;
  61.  
  62. // implement manual observer notification for the cameras property
  63. [self willChangeValueForKey:@"cameras"];
  64. [mCameras addObject:addedDevice];
  65. [self didChangeValueForKey:@"cameras"];
  66. }
  67. }
  68.  
  69.  
  70. - (void)deviceBrowser:(ICDeviceBrowser*)browser didRemoveDevice:(ICDevice*)device moreGoing:(BOOL)moreGoing
  71. {
  72. device.delegate = NULL;
  73.  
  74. // implement manual observer notification for the cameras property
  75. [self willChangeValueForKey:@"cameras"];
  76. [mCameras removeObject:device];
  77. [self didChangeValueForKey:@"cameras"];
  78. }
  79.  
  80. - (void)didRemoveDevice:(ICDevice*)removedDevice
  81. {
  82. [mCamerasController removeObject:removedDevice];
  83. }
  84.  
  85. // Check to see if the camera has image files to download
  86. - (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context
  87. {
  88. if ( [keyPath isEqualToString:@"selectedObjects"] && (object == mMediaFilesController) )
  89. {
  90. [self willChangeValueForKey:@"canDownload"];
  91. [self didChangeValueForKey:@"canDownload"];
  92. }
  93. }
  94.  
  95. - (BOOL)canDownload
  96. {
  97. if ( [[mMediaFilesController selectedObjects] count] )
  98. return YES;
  99. else
  100. return NO;
  101. }
  102.  
  103. // Download images
  104. // (Add a download button in interface builder -- use boolean to enable button)
  105. - (void)downloadFiles:(NSArray*)files
  106. {
  107. NSDictionary* options = [NSDictionary dictionaryWithObject:[NSURL fileURLWithPath:[@"~/Pictures" stringByExpandingTildeInPath]] forKey:ICDownloadsDirectoryURL];
  108.  
  109. for ( ICCameraFile* f in files )
  110. {
  111. [f.device requestDownloadFile:f options:options downloadDelegate:self didDownloadSelector:@selector(didDownloadFile:error:options:contextInfo:) contextInfo:NULL];
  112. }
  113. }
  114.  
  115. // Done downloading -- log results to console for debugging
  116. - (void)didDownloadFile:(ICCameraFile*)file error:(NSError*)error options:(NSDictionary*)options contextInfo:(void*)contextInfo
  117. {
  118. NSLog( @"didDownloadFile called with:\n" );
  119. NSLog( @" file: %@\n", file );
  120. NSLog( @" error: %@\n", error );
  121. NSLog( @" options: %@\n", options );
  122. NSLog( @" contextInfo: %p\n", contextInfo );
  123. }
  124. @end
To copy to clipboard, switch view to plain text mode 

and
ObjectiveC-Integrate.pro
Qt Code:
  1. QT += core gui multimedia
  2.  
  3. TARGET = ObjectiveC-Integrate
  4. TEMPLATE = app
  5.  
  6.  
  7. SOURCES += main.cpp\
  8. mainwindow.cpp
  9.  
  10. HEADERS += mainwindow.h
  11.  
  12. FORMS += mainwindow.ui
  13.  
  14. CONFIG -= app_bundle
  15. CONFIG += x86_64
  16. CONFIG -= i386
  17. LIBS += -lssl -lcrypto
  18. LIBS += -framework AppKit
  19.  
  20. OBJECTIVE_HEADERS += \
  21. appcontroller.h
  22.  
  23. OBJECTIVE_SOURCES += \
  24. appcontroller.mm
To copy to clipboard, switch view to plain text mode 
after a lot of search on google and review other posts i am unable to make my code BUILD on my machine.
Please help me out of this problem.