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

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.

Related

Xcode error - use of undeclared identifier 'GAdInterstitialKey_Live'

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.

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.

Dropbox iOS API - Simple Questions / DBRestClient Problems

EDIT:
I think I have fixed my issues. Thank you for the help - I really appreciate it.
Original Question:
I am new to objective-c and iOS programming, so hopefully my issues are not difficult to correct. I am trying to add the ability to open a file from Dropbox to my simple iOS application. I have been following the tutorial here:
http://www.mathiastauber.com/integration-of-dropbox-in-your-ios-application-making-api-calls/
I have so far successfully gotten my app to link to my Dropbox account and display the "link successful" message.
Now I am having trouble using the DBRestClient. I have the following code currently:
myviewcontroller.h
...
#end
DBRestClient *restClient;
myviewcontroller.m
- (DBRestClient *)restClient {
if (!restClient) {
restClient =
[[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
restClient.delegate = self;
}
return restClient;
}
I am getting an error on the line
restClient.delegate = self;
that says
"Assigning to 'id<DBRestClientDelegate>' from incompatible type 'myviewcontroller'"
What could be going wrong? I have read through every example I can find and can see no issues with what I am trying to do.
If I try to cast by doing the following, it does not work
restClient.delegate = (id)self;
I have also found that if I remove the code in myviewcontroller.m and only have the variable declaration in the header file (as shown above) I get an error that says "Apple Mach-O Linker Error"
I would greatly appreciate any help you can provide. I am very much stuck with this problem.
In your header file you need to specify that you adhere to the DBRestClientDelegate's protocol.
For example:
#interface MyViewController: UIViewController <DBRestClientDelegate>
If you're already adhering to other protocols, simply add the DBRestClientDelegate and comma seperate, such as...
#interface MyViewController: UIViewController <UITableViewDelegate, DBRestClientDelegate>
For more information, I'd recommend a read of the Delegation section of Cocoa Core Competencies, especially as you'll be encountering delegates (and indeed perhaps defining your own protocols, etc.) a lot in Cocoa.
The error is because the right side of restClient.delegate = self; is not of type id<DBRestClientDelegate>
id<DBRestClientDelegate> is basically any object that conforms to the DBRestClientDelegate protocol
The first step (maybe only step) to removing the error is in your Myviewcontroller.h file
change
#interface Myviewcontroller : UIViewController //<-- my best guess at your interface line
to
#interface Myviewcontroller : UIViewController <DBRestClientDelegate>

xcode4 parameter of incompatible type

A project that runs fine on Xcode3, fails to compile on Xcode4 with this error:
file://localhost/users/Ishaq/Projects/game01/libs/cocos2d/CCLayer.m:
error: Semantic Issue: Sending 'ccColor4B' (aka 'struct _ccColor4B')
to parameter of incompatible type 'CIColor *'
the code that throws this error is below (from cocos2d-iphone CCLayer.m):
+ (id) layerWithColor:(ccColor4B)color
{
return [[[self alloc] initWithColor:color] autorelease];
}
Somehow Xcode thinks this code is calling - (id)initWithColor:(CIColor *)color; of CIImage (inside CIImage.h). How can I set Xcode's brain straight? ;-)
I've got the same problem. My resolution was to explicitly cast it proper type which helps the compiler to find the proper class. So the code looks like this:
return [[(CCColorLayer*)[self alloc] initWithColor:color] autorelease];
You could change self to the actual classname CCLayer which should point Xcode in the right direction.
The same thing happened for me when using the "LLVM GCC 4.2" compiler. Changing the compiler setting to "Apple LLVM Compiler 3.0" fixed it.

Resources