iOS Build failed for custom framework on simulator only - ios

When trying to build my custom framework on simulator, I get this error
No type or protocol named 'NSURLSessionDelegate'
But it's working fine on devices
I added x86_64 and i386 to the valid architecture but still get this error
this this the header file where the error appears:
#import <Foundation/Foundation.h>
#interface CustomManger: NSObject <NSURLSessionDelegate,NSURLSessionTaskDelegate, NSURLSessionDataDelegate,NSURLSessionDownloadDelegate>
#end

Related

Integrating Google Plus in iOS application

I'm trying to integrate Google Plus authentication, and have followed a tutorial in this link.
When I add #import "GPPSignIn.h" I get the error :
GPPSignIn.h not found.
However, when I use #import "/Users/MH/Documents/TestGooglePlus/GooglePlus.framework/Headers/GPPSignIn.h" it works.
After compilation my application crash and I have this message:
-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x7fc71b568010
It sounds like you have two problems.
First, the header.
See: https://developers.google.com/+/mobile/ios/sign-in#enable_sign_in
#import <GooglePlus/GooglePlus.h>
#import <GoogleOpenSource/GoogleOpenSource.h>
Second, you're missing an important linker flag.
See: https://developers.google.com/+/mobile/ios/getting-started#step_2_initialize_the_google_client
Step 6.2:
Add the ObjC linker flag to the app target's build settings:
Other Linker Flags: -ObjC

Error compiling in real device but not simulator iOS 8

I'm trying to compile a code using Reachability by Apple. Using an iPhone 5s on the simulator works.
But in iOS it's like some libraries are not included in the device.
It tells me that:
/Users/rebouhaymen/Desktop/Projets/UrBike/UrBike/UrBike/UrBike-Bridging-Header.h:6:9: note: in file included from /Users/rebouhaymen/Desktop/Projets/UrBike/UrBike/UrBike/UrBike-Bridging-Header.h:6:
#import "Reachability.h"
^
/Users/rebouhaymen/Desktop/Projets/UrBike/UrBike/UrBike/Tools/Reachability/Reachability.h:49:9: error: 'SystemConfiguration/SystemConfiguration.h' file not found
#import <SystemConfiguration/SystemConfiguration.h>
^
<unknown>:0: error: failed to import bridging header '/Users/rebouhaymen/Desktop/Projets/UrBike/UrBike/UrBike/UrBike-Bridging-Header.h'
Resolved. It seems I used 6.0 Xcode version instead 6.0.1. It works now.

Compile error with cocoa pod code in iOS 8 beta

I'm developing in Xcode6 Beta 6 for iOS 8.
I am encountering an code error on an imported LastFM Cocoa Pod:
when I try to compile, but I can't seem to figure out what's causing the error. (Using all the code from the example)
I keep getting the following error in my AppDelegate.m file :
Property 'cacheDelegate' not found on object of type 'LastFm *'
I have however ensured to have the following code in my LastFm.h file :
#interface LastFm : NSObject
#property (unsafe_unretained, nonatomic) id <LastFmCache> cacheDelegate;
Any thought why it would claim I have not set the property in LastFM ? Not sure if this is an iOS 8 issue, or simply an error on my part?
Thanks for any suggestions.

Xcode 5 gives error when run old projects

I have some problems when i am run any projects in Xcode 5 it gives error like
Duplicate interface definition for class 'ViewController'
it is happen in most of situations if i download any project from git hub or from other sources.
But if i run that project in earlier version of Xcode than its working fine.
I have tried to run it Xcode 4.6 .
here is sample code that i run in Xcode 5 and gives error.
So whats problem with Xcode 5 ??
Solved:
By some Mistake i have Change System Header file from UIKIT > UITableViewController.h to
NS_CLASS_AVAILABLE_IOS(2_0) #interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
SO in any project if there is a viewcontroller named ViewController it gives this error,
So i have look in old xcode and changed it to
NS_CLASS_AVAILABLE_IOS(2_0) #interface UITableViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

CLLocation subclassing on OSX

I'm working on a more advanced CLLocationManager mock than the one provided by Xcode and I ran into a strange issue. I have subclassed both CLLocationManager and CLLocation:
// foobar.h
#interface MyLocation : CLLocation
#end
#interface MyLocationManager : CLLocationManager
#end
// foobar.m
#implementation MyLocation
#end
#implementation MyLocationManager
#end
Now if I build the project for iOS everything is fine but when I do the same for OS X, I get this error at linking:
Undefined symbols for architecture x86_64:
"_OBJC_METACLASS_$_CLLocation", referenced from:
_OBJC_METACLASS_$_MyLocation in AppDelegate.o
"_OBJC_METACLASS_$_CLLocationManager", referenced from:
_OBJC_METACLASS_$_MyLocationManager in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Unlike in this question Error on CLLocation subclassing, I do have the proper frameworks added to the project and, as I said, this setup builds flawlessly for iOS, just not for OSX.
FWIW, I'm using Xcode 4.6.3 with iOS SDK 6.1 and OSX SDK 10.8, building for x86_64 with the default LLVM 4.2.
Any clues why this is happening?
Linker errors are something to do with the framework. Forgetting to import the framework somewhere or add the Core Location framework to the OS X target. If it works for one but not the other, it sounds like the two targets are set up differently.
Double check. Clean the build. Restart Xcode.

Resources