Closed ispiropoulos closed 9 years ago
Hi,
I could think of two issues in this case:
1) You have a cycle in your import statements.
2) RMPickerViewController.h is imported before <UIKit/UIKit.h>
is imported. In this case, defined values like YES or NO are unknown as they are defined somewhere in the depths of <Foundation/Foundation.h>
which is imported by <UIKit/UIKit.h>
.
Hope, this helps a bit :)
Best regards, Roland
Hello and thank you for the fast answer.
(1). The only imports I have are on my bridging header (I code in Swift)
(2). I have no idea what you are talking about :tongue:
Whoops, I'm sorry. For some reason GitHub hides everything within <
and >
. I updated (2) above ;)
So, if UIKit is imported after RMPicker... how can that be changed? :\ I don't quite get it. Do I have to import UIKit.h on my Bridging header?
Is your bridging header a precompiled prefix header? Where do you import your bridging header in the classes that use RMDateSelectionViewController/RMPickerViewController?
When I added the RMDateSelectionViewController files, Xcode asked me If I want a bridging header, said yes, did #import "RMDateSelectionViewController.h" and it worked fine. The picker has issues.
I have not imported any bridging header into RMDateSelectionViewController/RMPickerViewController classes
Just tried it on a new clean project. Same error with the Picker.
Add the picker files in the clean project, Xcode asked me for bridging header, YES, then #import RMPickerViewController.h still gives me errors (even If I do not import RMPickerViewController.h with the bridging header)
Ok, can you send me that clean test project? I'll try to figure it out then ;)
OK, I think I figured it out. I would like you to update to RMDateSelectionViewController 1.4.3 and RMPickerViewController 1.3.3 as they import their public header and <QuartzCore/QuartzCore.h>
right after the license.
Should fix your problem :)
YES!!! Moving the imports right after the license worked! Thank you for the quick fix!!!
By the way, I haven't quite understood how to add the translations to the buttons localisation (I hard-coded them), so, If you want to do it for the Greek Language:
Now: Τώρα Cancel: Άκυρο Select: Επιλογή
Hope I' ve helped at least a bit :)
In Swift you could extend your app delegate like follows:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
var localizedSelectTitle = NSLocalizedString("Select", comment: "");
var localizedCancelTitle = NSLocalizedString("Cancel", comment: "");
RMPickerViewController.setLocalizedTitleForSelectButton(localizedSelectTitle);
RMPickerViewController.setLocalizedTitleForCancelButton(localizedCancelTitle);
//Some more code...
return true;
};
Note that your also need a Localizable.strings file (or a similar file), which contains the translations for Select
and Cancel
.
Hello and thank you for RMPickerViewController and for RMDateSelectionViewController!
I am using RMDateSelectionViewController without any issues on my test project.
Although, when I add RMPickerViewController, I import the .h file on my bridging header I am getting the following errors:
http://i.imgur.com/69d2LIY.png
Any idea on how to resolve?