After Updating iZettle SDK 3 in Xcode issue occur - ios

After updating iZettle SDK 3, shows a error and build failed.
The error is
No visible #interface for 'iZettleSDK' declares the selector 'enforcedUserAccount'
Error showing on this code
[[iZettleSDK shared]enforcedUserAccount];
Project written in Objective-C.

If you search the iZettle SDK on GitHub it quickly becomes apparent that they have refactored this API call into another class - AccountManager.
From : https://github.com/iZettle/sdk-ios/blob/d16ed180a20acc36676222a595db0e7863556ed4/Example/Sample/iZettleSDKSample/ViewController.m#L100
[AccountManager shared].enforcedUserAccount = email.length > 0 ? email : nil;

Related

'name' is unavailable: not available on iOS - XCode11

After upgrading from XCode 10.0 to 11
I am getting the error 'name' is unavailable: not available on iOS
This is during Build for Swift 4.2 on XCode 11.0 and 11.1 , I can still build using XCode 10
This is happening in the code of one of the Objective C external libraries we have been using through Cocopods.
return [(NSNumber *)[table[state] objectForKey:[rule name]] unsignedIntegerValue];
I can work around the issue by renaming the variable name to ruleName , but I would rather not do this.
Why is Xcode objecting to a variable name of name? Is this an Xcode but or is it something I can fix in the build settings
Edit
The specific pod is NUI 0.5.5
In module NUIPShiftReduceGotoTable.m
- (NSUInteger)gotoForState:(NSUInteger)state rule:(NUIPRule *)rule
{
return [(NSNumber *)[table[state] objectForKey:[rule name]] unsignedIntegerValue];
}
Apple made a change that can break previously compiling code in Xcode 11.0/11.1. Previously the compiler would be fine with passing the 'name' message to an object that it didn't know the type of. This can happen for many reasons in the weakly typed Objective-C world.
Currently in Xcode 11.1 you can do.
id x = nil;
[x name];
And this will compile, no problem. But:
NSObject *x = nil
[x name];
won't compile due to the compiler identifying the most likely selector being the API_UNAVAILABLE one in NSLayoutAnchor.h (maybe).
If the compiler had more information it can map the correct selector. This might be as simple as including the header for whatever has name property in the .m file that is failing.
My guess is something like in NUIPShiftReduceGotoTable.m you add a line
#import"NUIPRule.h"

Parse SDK and Swift: Incorrect argument label in call PFObject 'withoutDataWithObjectId'

I subclass PFObject exactly as described here.
Then I create a new instance of the subclassed object without data, but since Swift 1.2 I get an error (It did work perfectly before):
var test = Armor(withoutDataWithObjectId: "1234567890")
-> Xcode complains:
"Incorrect argument label in call (have 'withoutDataWithObjectId:',
expected: 'className:')"
Why className? It should get the class name from the class function parseClassName
And I can under no circumstances create a new object with objectId but no data (which I MUST have to fetch it from the local datastore)
This is super annoying as my app doesn't compile any longer.
Update to the newest Parse SDK, available here.
The issue is caused due to necessary adaptions in the Parse SDK after the Swift language update. This issue also occurs with the most recent update to Swift 2.2. The newest (as of today) Parse SDK release 1.13.0 already fixes this.
UPDATE
Parse iOS SDK 1.13.0 has a typo and the function PFUser(withoutDataWithObjectId:) is called PFUser(outDataWithObjectId:). So upgrading the Parse SDK alone does solve this. Until this is fixed a temporary workaround would be to extend PFObject with a convenience initializer. To do this add a new Swift file to your project and insert this:
import Parse
extension PFObject {
convenience init(withoutDataWithObjectId objectId: String?) {
self.init(outDataWithObjectId: objectId)
}
}
It may be a little late to answer this question.
I use swift 1.2, and v 1.7.5 Parse SDK, and it works totally fine.
however, make sure you have define objective-c bridging header in "build setting".
and try to run it, even though there may reports some error

Metaio SDK getAllGeometriesFromViewportCoordinates

Hi I am building an augmented reality iOS app with the Metaio SDK, and am running into some issues with the function getAllGeometriesFromViewportCoordinates. In my header (.h file), I'm calling the class constructor:
#interface HelloWorldViewController : MetaioSDKViewController
{
metaio::Vector3d modelLocation;
}
and in my .mm file:
modelLocation = m_metaioSDK->getAllGeometriesFromViewportCoordinates(loc.x, loc.y, true, 3, 0);
The error I'm getting is "No viable overloaded '='"
Here's what the Metaio docs say about this function: http://doxygen.metaio.com/metaioSDK55/getAllGeometriesFromViewportCoordinates_1a31f4d68ef273dc05d8be5094dc25910d.html
Any help would be appreciated. Thanks, Steve
The return type of getAllGeometriesFromViewportCoordinates is
stlcompat::Vector < metaio::GeometryHit >
You're trying to assign it to a metaio::Vector3d.
Maybe you actually want to call this method? http://doxygen.metaio.com/metaioSDK55/get3DPositionFromScreenCoordinates_1ae31b85a5c22fd3392ef6186401fd6046.html

class method +setLoggingEnabled: not found

I am using Google Cloud Endpoint with iOS. I am trying to create the service object per the instructions at https://developers.google.com/appengine/docs/java/endpoints/consume_ios#Java_Creating_the_service_object. For the line of code [GTMHTTPFetcher setLoggingEnabled:YES]; xCode is showing the warning
class method '+setLoggingEnabled:' not found (return type defaults to 'id')
But when I look inside the .h file for GTMHTTPFetcher I can actually see the method as
#if STRIP_GTM_FETCH_LOGGING
// if logging is stripped, provide a stub for the main method
// for controlling logging
+ (void)setLoggingEnabled:(BOOL)flag;
#endif // STRIP_GTM_FETCH_LOGGING
and in the .m file it looks like this
#if STRIP_GTM_FETCH_LOGGING
+ (void)setLoggingEnabled:(BOOL)flag {
}
#endif // STRIP_GTM_FETCH_LOGGING
Also the class is generated by Google so...it should work (?)
Set as follows :
#define STRIP_GTM_FETCH_LOGGING 1
In the file that contains the following line of code:
[GTMHTTPFetcher setLoggingEnabled:YES];
Add the following importation:
#import "GTMHTTPFetcherLogging.h"
I just faced the same problem.
In my case, it was because I was using the GTMHTTPFetcher from the Google+ iOS SDK:
Adding required files to your iOS project (Point 2.)
I had set the header information as described (Copied below here for simplicity):
If you are using the Google+ iOS SDK, set up your Xcode project as follows:
In your Xcode project, go to the settings page for the target.
In the Build Settings tab, add the following item to Header Search Paths:
GOOGLE_PLUS_SDK_DIRECTORY/GoogleOpenSource.framework/Headers where
GOOGLE_PLUS_SDK_DIRECTORY is the directory where you installed the
Google+ iOS SDK.
(I have Google+ iOS SDK within my project so I am using: $(PROJECT_DIR)/MyProject/External/GoogleOpenSource.framework/Headers)
However to see the setLoggingEnabled method you will need to add -ObjC -all_load to Other Linker Flags

No Visible #interface error in ios

Im getting the following issue in ios how to clear and run the code successfully.
The issue is:
"No visible #interface for 'ViewController' declares the selector 'performSelector:afterDelay:'".
There is no such function performSelector:afterDelay:.
Looking at the docs the only function that includes "performSelector" and "afterDelay" is...
performSelector:withObject:afterDelay:
and
performSelector:withObject:afterDelay:inModes:

Resources