My ViewController code is as follows
#import "ViewController.h"
#import <GTLServiceYouTube.h>
#interface ViewController ()
#end
#implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
GTLServiceYouTube *g=[[GTLServiceYouTube alloc] init];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
For the above code i receive the following error.
GTLDriveChannel (api#channel) registration conflicts with
GTLCalendarChannel GTLPlusDomainsAcl (plus#acl) registration conflicts
with GTLPlusAcl GTLPlusDomainsActivity (plus#activity) registration
conflicts with GTLPlusActivity GTLPlusDomainsActivityFeed
(plus#activityFeed) registration conflicts with GTLPlusActivityFeed
GTLPlusDomainsComment (plus#comment) registration conflicts with
GTLPlusComment GTLPlusDomainsCommentFeed (plus#commentFeed)
registration conflicts with GTLPlusCommentFeed GTLPlusPeopleFeed
(plus#peopleFeed) registration conflicts with GTLPlusDomainsPeopleFeed
GTLPlusPerson (plus#person) registration conflicts with
GTLPlusDomainsPerson GTLPlusPlace (plus#place) registration conflicts
with GTLPlusDomainsPlace GTLStorageChannel (api#channel) registration
conflicts with GTLDriveChannel
My podfile configuration is listed below
target 'VideoApp', :exclusive => true do
pod "youtube-ios-player-helper", "~> 0.1"
pod 'Google-API-Client'
end
Nothing helpful here too. https://groups.google.com/forum/#!topic/google-api-objectivec-client/cW2TIBZ7mwA
In the developer console two apis are enabled.
I already implemented my own wrapper for YouTube Data API, you can use it if you wish, it is simple :)
https://github.com/muhammadbassio/YouTubeAPI3-Objective-C-wrapper
Related
I recently upgraded a project to SDWebImage 4.0, which I'm only using to cache images and later retrieve them. Had this working flawlessly on the 3.x version. I'm now getting the following error after migrating...
-[SDImageCache storeImage:forKey:toDisk:completion:]: unrecognized selector sent to instance 0x174097cf0
This seems like it should be a simple error to resolve, but after multiple attempts, I'm unable to fix it.
Here is my previous code from the 3.x API...
#property (strong, nonatomic) SDImageCache *imageCache;
- (SDImageCache *)imageCache {
if (!_imageCache) {
_imageCache = [[SDImageCache alloc] initWithNamespace:NAME_SPACE_IMAGE_CACHE];
}
return _imageCache;
}
[self.imageCache storeImage:[UIImage imageWithContentsOfFile:imageData.imageURL.path] forKey:imageData.imageURL.absoluteString toDisk:YES];
Here is my updated code for the 4.0 API, which is the line of code throwing the error...
[self.imageCache storeImage:[UIImage imageWithContentsOfFile:imageData.imageURL.path] forKey:imageData.imageURL.absoluteString toDisk:YES completion:^{
NSLog(#"INFO: Image cached successfully!");
}];
Could someone please help clarify what the issue is?
Thanks in advance!
I try like this and it works, you must shift + cmd + k and build again, must solve the problem as is pointed out here https://github.com/rs/SDWebImage/issues/1602
#import "ViewController.h"
#interface ViewController ()
#property SDImageCache * imageCache;
#end
#implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.imageCache = [SDWebImageManager sharedManager].imageCache;
// Do any additional setup after loading the view, typically from a nib.
[_imageCache storeImage:[UIImage imageNamed:#"test"] forKey:#"testKey" toDisk:YES completion:^{
NSLog(#"INFO: Image cached successfully!");
}];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#end
CONSOLE OUTPUT
2017-07-11 00:55:12.146 SDWebImageSOQuestion[17275:339149] INFO: Image
cached successfully!
Hope this helps
I had the same issue when my pod updated to 5.0. To fix it I needed to...
Change
[imageCache clearDisk];
To
[imageCache clearDiskOnCompletion:^{
}];
I am building an app with cordova/ionic for iOS
For multiple reasons we have to put code inside generated application() of AppDelegate.m.
I allready found some similar question, but no answer yet.
https://stackoverflow.com/questions/36792158/cordova-phonegap-ios-modify-generated-appdelegate
There is a way to do it properly with some overloading or extending ?
The simple answer is "I can edit the AppDelegate.m" but since it's a generated file in the project, i can not do it.
Any ideas ?
Maybe you can use runtime to add new method in AppDelegate.m
for example
#interface testViewController (){
AppDelegate *m_appDelegate;
}
#implementation testViewController
- (void)viewDidLoad {
[super viewDidLoad];
m_appDelegate = [AppDelegate new];
// add new method in AppDelegate.m
[self addMethod];
// call new method in AppDelegate.m
[m_appDelegate performSelector:#selector(join)];
}
- (void)addMethod{
BOOL addSuccess = class_addMethod([AppDelegate class], #selector(join), (IMP)happyNewYear, "v#:");
}
void happyNewYear(id self,SEL _cmd){
NSLog(#"new method");
}
-(void)join{
NSLog(#"in the join %s",__func__);
}
hope it helps.
I have an old Pebble Classic watch, upgraded to latest firmware (3.8.2) and using latest Pebble-SDK.
I have followed the few simple steps to install SDK, setup an Xcode project and adding the code to initialise and connect:
https://developer.getpebble.com/guides/mobile-apps/ios/
My problem is, that the delegate method pebbleCentral:watchDidConnect never gets called!
I am using the Pebble Time app on the iPad to install the watchApp in the watch, so I know the iPad is connected to the watch. The same iPad runs the iOS app, which apparently does not discover the watch.
I have tried to import an old test project from a colleague, who had it running a year or two ago. Same watch, same watchApp, but of course older firmware and SDK versions. Same result...
I think the documentation on the pebble site is quite simple and easy to follow. However, I feel I am missing some explanations of how and when this watchDidConnect is supposed to be triggered.
I am most likely missing some simple step somewhere, but I am quite lost in where to look!
Any ideas are welcome!
EDIT: My code looks like this:
ViewController.h:
#import <UIKit/UIKit.h>
#import PebbleKit;
#interface ViewController : UIViewController<PBPebbleCentralDelegate>
#end
ViewController.m:
#import "ViewController.h"
#interface ViewController ()
#property (weak, nonatomic) PBWatch* connectedWatch;
#end
#implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[PBPebbleCentral defaultCentral].delegate = self;
[[PBPebbleCentral defaultCentral] run];
NSLog(#"Pebble initialised");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)pebbleCentral:(PBPebbleCentral*)central watchDidConnect (PBWatch*)watch isNew:(BOOL)isNew {
NSLog(#"Pebble connected: %#", [watch name]);
self.connectedWatch = watch;
}
- (void)pebbleCentral:(PBPebbleCentral*)central watchDidDisconnect:(PBWatch*)watch {
NSLog(#"Pebble disconnected: %#", [watch name]);
if ([watch isEqual:self.connectedWatch]) {
self.connectedWatch = nil;
}
}
#end
Are you calling the -run method, after setting up your Pebble central? I noticed that the code snippet in the link you posted does not show the central's delegate being set.
[PBPebbleCentral defaultCentral].delegate = self; // Set your delegate
[PBPebbleCentral defaultCentral].appUUID = [[NSUUID alloc] initWithUUIDString:#"Your Pebble App UUID"]; // Set the app UUID
[[PBPebbleCentral defaultCentral] run]; // Call -run on the central
I have implemented google admob sdk 6.12, ads were appearing , everything was working perfectly, after few days google updated sdk 7, again i imported new sdk but this time i am unable to use #import "GADInterstitial.h" each time i get error #import "GADInterstitial.h" not found, imported all frameworks but no success and no ads are appearing if i use #class GADInterstitial.h; and use this code
- (void)viewDidLoad {
[super viewDidLoad];
self.interstitial = [[GADInterstitial alloc] init];
self.interstitial.adUnitID = Interstical_Unit_id;
GADRequest *request = [GADRequest request];
// Requests test ads on simulators.
request.testDevices = #[ GAD_SIMULATOR_ID ];
[self.interstitial loadRequest:request];
}
- (void)gameOver {
if ([self.interstitial isReady]) {
[self.interstitial presentFromRootViewController:self];
}
// Rest of game over logic goes here.
}
You don't need to import headers anymore, just use this and go
#import GoogleMobileAds
Also you don't need to link other frameworks or add the -ObjC to your linker flags.
I was having this issue myself after upgrading. Use this instead:
#import <GoogleMobileAds/GADInterstitial.h>
If you add GoogleMobileAdsSdkiOS-7.0.0 folder in your app, you have to replace your #import row with the following:
#import <GoogleMobileAds/GADBannerView.h>
I had the same issue.
Well, I updated cocoapods, added a new unit test pod that I wanted to try out, and I am unable to run even the most simple unit test.
It doesn't seem to be an issue with the pod but probably after I updated cocoapods to the newest version then did pod update.
Here's the error I get, basically the error is when I try and pull in any class from my main target into my tests.
a full size version: http://i.stack.imgur.com/x5EQP.png
uncomment the lines that are commented out and I get the error, otherwise cmd+U will run and succeed.
#import "AppDelegateTests.h"
//#define EXP_SHORTHAND
//#import "Expecta.h"
//#import "AppDelegate.h"
#implementation AppDelegateTests {
// AppDelegate *_appDelegate;
}
- (void)setUp
{
[super setUp];
// _appDelegate = [[AppDelegate alloc] init];
}
- (void)test_rootViewController_should_be_SplitViewController {
// expect(1).to.equal(1);
}
- (void)tearDown
{
// Tear-down code here.
[super tearDown];
}
#end