error message
2016-03-10 00:54:38.475 GoogleAdTest[2677:1499976]
Google Mobile Ads SDK version: afma-sdk-i-v7.7.0
2016-03-10 00:54:38.475 GoogleAdTest[2677:1499976]
-[UIView setAdUnitID:]: unrecognized selector sent to instance 0x7fbed26188a0
2016-03-10 00:54:38.480 GoogleAdTest[2677:1499976]
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setAdUnitID:]: unrecognized selector sent to instance 0x7fbed26188a0'
code:
NSLog(#"Google Mobile Ads SDK version: %#", [GADRequest sdkVersion]);
// Replace this ad unit ID with your own ad unit ID.
self.bannerView.adUnitID = #"myadmobcode";
self.bannerView.rootViewController = self;
GADRequest *request = [GADRequest request];
request.testDevices = #[
#"2077ef9a63d2b398840261c8221a0c9a" // Eric's iPod Touch
];
[self.bannerView loadRequest:request];
Hope, it will solve your issue. Go to project settings > Build Settings And set -ObjC to Other Linker Flags.
Related
I'm working on an app and it's my first time using Core Data and everything was going smooth until I hit a rock.
Here is my stack trace
2015-07-20 23:39:41.030 Small Things[290:21425] -[Entity1 length]: unrecognized selector sent to instance 0x13769ecb0
2015-07-20 23:39:41.031 Small Things[290:21425] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Entity1 length]: unrecognized selector sent to instance 0x13769ecb0'
*** First throw call stack:
(0x184eaff94 0x199853f2c 0x184eb6cac 0x184eb3c4c 0x184db725c 0x184d97798 0x18a4cce20 0x10005f5f0 0x100063730 0x18a7fdb90 0x18a7fdce8 0x18a7ee890 0x18a802910 0x18a5abe78 0x18a4be4fc 0x189cfad04 0x189cf5920 0x189cf57e0 0x189cf4e80 0x189cf4bd4 0x189cee34c 0x184e66f44 0x184e64cbc 0x184e650ec 0x184d91800 0x18fe1f170 0x18a52a5e8 0x10005f4a0 0x19a08e8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
and here is the code that caused the problem:
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
//Fetch data from persistence
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:#"Entity1"];
NSFetchRequest *fetchRequest2 = [[NSFetchRequest alloc] initWithEntityName:#"Entity2"];
self.arr1 = [[managedObjectContext executeFetchRequest:fetchRequest error:nil]mutableCopy];
self.arr2 = [[managedObjectContext executeFetchRequest:fetchRequest2 error:nil]mutableCopy];
[self.tableView reloadData];
}
I really don't get what's wrong.
Thanks in advance
Usually, this error is about the entity name you're using is not kind of NSString, so the code believes that you are using some type else (not NSString).
But it could be also, that is the model associated with the context’s persistent store coordinator does not contain an entity named Entity1.
I'm adding Google Admob Fullscreen ads
m_interstitial = [[GADInterstitial alloc] initWithAdUnitID:ADMOB_FS_ID]; // crash here!!!
m_interstitial.delegate = self;
GADRequest* request = [GADRequest request];
request.testDevices = #[ #"XXXXXXXXXXXXXXXXXXXXXXXxxx" ];
[m_interstitial loadRequest:request];
But the app is crash at the init line.
I'm using the Admob ios sdk 7.3.1.
The crash report is below
2015-06-03 00:22:17.077 XXX[17213:4624660] -[GADInterstitialViewController setSlot:]: unrecognized selector sent to instance 0x14e4b6f0
2015-06-03 00:22:17.079 XXX[17213:4624660] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADInterstitialViewController setSlot:]: unrecognized selector sent to instance 0x14e4b6f0'
*** First throw call stack:
(0x29e9a5a7 0x37a80c77 0x29e9fa6d 0x29e9d949 0x29dceb68 0x1dc9f4 0x19b8b4 0xd3923 0xe488d 0x2d3b437b 0x2d418553 0x2d4184dd 0x2d3945e7 0x29e61275 0x29e5e959 0x29e5ed5b 0x29dabb51 0x29dab963 0x312ea1a9 0x2d3fdc91 0x102011 0x38029aaf)
libc++abi.dylib: terminating with uncaught exception of type NSException
Whats the matter?
EDIT: My whole code is below
in AppDelegate.m
- (void)showNag
{
// GAD full
// m_interstitial = [[GADInterstitial alloc] initWithAdUnitID:ADMOB_FS_ID];
m_interstitial = [[GADInterstitial alloc] init];
m_interstitial.adUnitID = ADMOB_FS_ID;
m_interstitial.delegate = self;
GADRequest* request = [GADRequest request];
request.testDevices = #[ #"251a8278d43c4c1468ce2d807a0ccc72" ];
[m_interstitial loadRequest:request];
}
viewcontroller.m
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
AppDelegate* delegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
[delegate showNag];
}
I got it. I had the named GADViewController.h/m files. They made conflict with the GAD framework. The framework also has the same named files. I renamed my files and it works now.
I am using BlackRaccoon to download a file from FTP server. Following is the code:
- (IBAction)download:(id)sender {
downloadData = [NSMutableData dataWithCapacity: 1];
downloadFile = [[BRRequestDownload alloc] initWithDelegate: self];
downloadFile.path = #"psnewsletter.pdf";
downloadFile.hostname = #"server";
downloadFile.username = #"user";
downloadFile.password = #"pswd";
[downloadFile start];
}
Its gives following error
2014-02-20 11:48:43.526 BlackHillPrimarySchool[2036:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainViewController requestFailed:]: unrecognized selector sent to instance 0xcd609f0'
Any help will be appreciated.
requestFailed: is one of the BRRequest delegate method that you must implement in your view controller.
- (void)requestFailed:(BRRequest *)request {
BRRequestError *reqError = request.error;
// check the error, handle as needed.
}
I'm not sure how your code even compiled. This is a required method of the protocol.
i've a piece of code that should get the current location and than put lat and long in a string.
when a new location is found i put it in a NSString
currentLatit = [NSString stringWithFormat:#"%f",newLocation.coordinate.latitude];
currentLongit = [NSString stringWithFormat:#"%f",newLocation.coordinate.longitude];
Than when i press a button i do:
NSLog(currentLatit);
[[UIApplication sharedApplication] openURL:[[NSURL alloc] initWithString: [NSString stringWithFormat:#"http://maps.google.com/maps?saddr=%#,%#&daddr=%#,%#",currentLatit,currentLongit,detailLatitudine,detailLongitudine]]];
but when i execute this, i get this error:
-[__NSCFArray length]: unrecognized selector sent to instance 0x1e1830
2011-11-15 11:29:07.567 Marcovaldo[771:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray length]: unrecognized selector sent to instance 0x1e1830'
*** First throw call stack:
(0x30ae78bf 0x37c8c1e5 0x30aeaacb 0x30ae9945 0x30a44680 0x30a310a9 0x30ac5a97 0x30a42217 0x30a55b8f 0x37b09b9b 0x37b09b3b 0x7253 0x30a41435 0x32a9c9eb 0x32a9c9a7 0x32a9c985 0x32a9c6f5 0x32a9c321 0x32a8f99b 0x30abbb4b 0x30ab9d87 0x30aba0e1 0x30a3d4dd 0x30a3d3a5 0x3366bfed 0x32aaf743 0x2221 0x21e0)
terminate called throwing an exception(gdb)
The error occur on the NSLog execution
realy cannot understand what's wrong whit this simple code...
thanks for any help
-UPDATE-
changed the NSLog as follow:
NSLog(#"%#",currentLatit);
Now the app crash with BAD_ACCESS_EXCEPTION on the NSLog
No, it seems the app crashed at some point other than NSLog. Please clean and build. Or Enable NSZombie and get the exact error location.
Update:
Just do like as following and try.
if( currentLatit )
[currentLatit release];
if( currentLongit )
[currentLongit release];
currentLatit = [[NSString stringWithFormat:#"%f",newLocation.coordinate.latitude] retain];
currentLongit = [[NSString stringWithFormat:#"%f",newLocation.coordinate.longitude] retain];
Request:
- (void) getMyImageWithContestOfFace{
currentApiCall = getMyImageFb;
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"SELECT pic FROM user WHERE uid=me()",#"query",
nil];
AppDelegate *delegate = (AppDelegate *) [[UIApplication sharedApplication] delegate];
[[delegate facebook] requestWithMethodName:#"fql.query"
andParams:params
andHttpMethod:#"POST"
andDelegate:self];
}
Parsing:
...
case getMyImageFb:{
flag = TRUE;
imageWithFace = [[UIImage alloc] init];
imageWithFace = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[result objectForKey:#"pic"]]]];
}
break;
...
When i call it i catch very strange exeption:
*2011-11-10 00:30:30.661 FaceGraph[1699:f803] I have some information
2011-11-10 00:30:30.664 FaceGraph[1699:f803] -[__NSArrayM objectForKey:]: unrecognized selector sent to instance 0x6d3d470
2011-11-10 00:30:30.666 FaceGraph[1699:f803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM objectForKey:]: unrecognized selector sent to instance 0x6d3d470'
First throw call stack:
(0x15d9052 0x176ad0a 0x15daced 0x153ff00 0x153fce2 0x254db 0xb6d6 0xbcf7 0xc9ba59 0xc99e94 0xc9aeb7 0xc99e4f 0xc99fd5 0xbdef6a 0x3b8bbbd 0x3c585ea 0x3b82298 0x3c5816b 0x3b82137 0x15ad97f 0x1510b73 0x1510454 0x150fdb4 0x150fccb 0x14c2879 0x14c293e 0x2a6a9b 0x2332 0x22a5)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Current language: auto; currently objective-c
No idea why. The most strange that i did it before ABSOLUTELY the same, and it worked fine.
I can't find the difference between my old projects and current. Maybe somebody have the same problem?? If you need more code - ask for it.
thanks
Well, the exception seems to be quite clear: result is probably an array and not a dictionary.
PS: The line imageWithFace = [[UIImage alloc] init]; is totally superfluous given the line that follows it. You should remove it.
I forgot to add:
if ([result isKindOfClass:[NSArray class]]){
result = [result objectAtIndex:0];
}
in result-parsing function.