Xcode error - use of undeclared identifier 'GAdInterstitialKey_Live' - ios

When I'm trying to build this project in Xcode8 I get this error
use of undeclared identifier 'GAdInterstitialKey_Live'
on this line
interstitial = [[GADInterstitial alloc] initWithAdUnitID:GAdInterstitialKey_Live];

Do you have that string in some part of your code? By the way, are you using admob? Interstitial might be related to it.
Assuming you are using something like admob you have to define keys provided by the service to relate the user to your app. You might not have defined then or dit it in a wrong way.

Related

Use of unresolved identifier - app development with Swift Project 2

Sorry - I realise this is a complete beginner question, but I've googled for half a day now and still can't resolve the issue myself.
I'm using xCode 8.3 and trying to complete the apple - app development with swift course - end of unit project 2. I'm told (by the Apple book) I should be able to run the app without build failures, even if it isn't finished.
I get an unresolved identifier error when I add the following code to my ViewControler file, inside the class ViewController: UIViewController.
func updateUI() {
correctWordLabel.text = game.formattedWord
scoreLabel.text = "Wins: \(totalWins), Losses: \(totalLosses)"
treeImageView.image = UIImage(named: "Tree \(currentGame.incorrectMovesRemaining)")
}
xCode suggests I change it to Game.formattedWord, but when i do get 'Instance member 'formattedWord' cannot be used on type 'Game' ViewController.Swift'.
Could someone please help?
I've checked the sample code from Apple about 100 times and they are def saying it should be game.formattedWord in the code.
Thank you!
Try correctWordLabel.text = currentGame.formattedWord
I think it’s a typo.
Earlier in your code you create an instance of the Game struct called currentGame so you are accessing the formattedWord variable inside that instance. That’s why you couldn’t change it to Game. Game is like the blueprint of the struct. currentGame is your actual ‘thing’ Hope that makes some sense.

Cannot implement Swift SSLCreateContext

I am new to iOS development, and am trying to implement an SSL connection to a custom port.
I found the code from this answer as the best/easiest implementation of a secure connection over a socket https://stackoverflow.com/a/30733961/2306428
However, I am getting these errors:
Use of unresolved identifier 'kSSLClientSide'
Use of unresolved identifier 'kSSLStreamType'
Use of unresolved identifier 'kSSLSessionOptionBreakOnClientAuth'
I have checked and I am running Swift version 2.1.1, using iOS 9.2 SDK and Xcode 7.2. I have even tried adding import Security but that has no effect.
What is the reason that these constants are not being found?
The line being tested is here: https://github.com/ksred/bank-ios/blob/master/Bank/TCPClient.swift#L209
Please use the identifiers declared in Swift:
if let sslContext = SSLCreateContext(kCFAllocatorDefault, SSLProtocolSide.ClientSide, SSLConnectionType.StreamType) {
SSLSetIOFuncs(sslContext, sslReadCallback, sslWriteCallback)
SSLSetConnection(sslContext, &socketfd)
SSLSetSessionOption(sslContext, SSLSessionOption.BreakOnClientAuth, true)
SSLHandshake(sslContext)
}

UIStackView has no member delegate error in Swift

I'm learning how to program in Swift.
At one step in the iOS Developer Library
https://developer.apple.com/library/ios/referencelibrary/GettingStarted/DevelopiOSAppsSwift/Lesson3.html#//apple_ref/doc/uid/TP40015214-CH22-SW1
it tells me to add the command:
nameTextField.delegate = self
After entering the Command a Error pops up saying:
Value of type 'UIStackView' has no Member 'delegate'
Please someone have a solution?
Thank you in advance.
You should try adding the UITextFieldDelegate protocol.

Box iOS SDK - Receiver 'BoxSearchRequestBuilder' for class message is a forward declaration

I am trying to use the BoxSearchRequestBuilder class to be able to perform a search in Box via the iOS SDK (v2). When I try to instantiate a BoxSearchRequestBuilder instance with its initializer, I get a compiler error.
What I am trying to do:
BoxSearchRequestBuilder* builder = [[BoxSearchRequestBuilder alloc] initWithSearch:#"123" queryStringParameters:#{#"content_types" : #"tags"}];
The error:
receiver 'BoxSearchRequestBuilder' for class message is a forward declaration or
receiver type 'BoxSearchRequestBuilder' for instance message is a forward declaration.
Basically the BoxSearchRequestBuilder class is declared via a forward declaration (#BoxSearchRequestBuilder), so I cannot directly access its properties/initializers.
I can fix the error by going to the iOS SDK class BoxSearchResourceManager and changing the forward declaration to an import statement:
#import "BoxSearchRequestBuilder.h"
//#class BoxSearchRequestBuilder;
However, I don't think I should be doing this. Are there any other alternatives? The rest of the API works fine.
Thanks for flagging this.
It has been fixed thanks to your feedback in this change:
https://github.com/box/box-ios-sdk-v2/commit/67064ea1f0c1aff040fba1e249b9f550281c01e2
feel free to file issues on SDK github page.

Error in Iphone development - greeting undeclared (first use in this function)

I Am new Iphone development. And i got his error "greeting undeclared (first use in this function)".I have attached the screen shot file here.
code is below:
greetings = [[greeting alloc] initWithName:#"Missing You"
andURL1:#"http://dimitko.com/banners/icards/missing/missing1.png"
andURL2:#"http://dimitko.com/banners/icards/missing/missing2.png"
andURL3:#"http://dimitko.com/banners/icards/missing/missing3.png"
andURL4:#"http://dimitko.com/banners/icards/missing/missing4.png"
andHeader:#"Miss you..."
andSubject:#"Missing You a Whole Bunch!!!"
andColor:[UIColor colorWithRed:_RGB2COCOA(236) green:_RGB2COCOA(57) blue:_RGB2COCOA(46) alpha:1]
andColorWeb:#"#ec392e"
andGreetingFont:#"SnellRoundhand"
andFontSize:12
andWebFont:#"5"
Import the header that defines your greeting class.
Also, that's quite a wordy initialiser, you should consider just using properties instead.

Resources