我们如何在iOS中获得全时区名称, 如印度标准时间而不是IST.
NSTimezone *timeZone=[NSTimeZone localTimeZone];
Run Code Online (Sandbox Code Playgroud)
我正在获得GMT,但我希望它像完整的形式字符串
我在整合谷歌加日志时遇到问题我收到以下错误:
2015-02-17 20:03:39.377 SIR[288:14344] -[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x14d57a20
2015-02-17 20:03:39.383 SIR[288:14344] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x14d57a20'
Run Code Online (Sandbox Code Playgroud)
我以前用于谷歌登录的代码如下:
-(void) setGooglePlusButtons {
UIButton *googlePlusSignInButton = [UIButton buttonWithType:UIButtonTypeCustom] ;
UIImage *backgroundButtonImage = [UIImage imageNamed:@"google.png"];
googlePlusSignInButton.frame = CGRectMake(0.0f,
400,
150,
50);
googlePlusSignInButton.titleLabel.textColor = [UIColor whiteColor];
googlePlusSignInButton.titleLabel.font = [UIFont boldSystemFontOfSize:11.0f];
googlePlusSignInButton.titleLabel.numberOfLines = 2;
googlePlusSignInButton.titleLabel.shadowColor = [UIColor darkGrayColor];
googlePlusSignInButton.titleLabel.shadowOffset = CGSizeMake(0.0f,
-1.0f);
[googlePlusSignInButton setTitle:NSLocalizedString(@"", @"")
forState:UIControlStateNormal];
[googlePlusSignInButton setBackgroundImage:backgroundButtonImage
forState:UIControlStateNormal];
[self.view …Run Code Online (Sandbox Code Playgroud) 我只想要一个以NSDate的形式包含一年中所有星期一的数组但是很快.我在目标-c中使用以下代码,但不知道如何在swift中使用它.
NSDate *pickerDate = [NSDate date];
NSLog(@"pickerDate: %@", pickerDate);
NSDateComponents *dateComponents;
NSCalendar *calendar = [NSCalendar currentCalendar];
dateComponents = [calendar components:NSWeekdayCalendarUnit fromDate:pickerDate];
NSInteger firstMondayOrdinal = 9 - [dateComponents weekday];
dateComponents = [[NSDateComponents alloc] init];
[dateComponents setDay:firstMondayOrdinal];
NSDate *firstMondayDate = [calendar dateByAddingComponents:dateComponents toDate:pickerDate options:0];
dateComponents = [[NSDateComponents alloc] init];
[dateComponents setWeek:1];
for (int i=0; i<64; i++) {
[dateComponents setWeek:i];
NSDate *mondayDate = [calendar dateByAddingComponents:dateComponents toDate:firstMondayDate options:0];
NSLog(@"week#: %i, mondayDate: %@", i, mondayDate);
}
Run Code Online (Sandbox Code Playgroud) 我在实施谷歌+登录时遇到以下错误.
2015-02-11 21:23:27.925 SIR[3761:154305] -[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x78e53cb0
2015-02-11 21:23:27.929 SIR[3761:154305] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x78e53cb0'
- (void)viewDidLoad {
[super viewDidLoad];
checkUp=NO;
class=[[ArrayClass alloc]init];
class.delegate=self;
[class calledWhenStringISPArsed:@"1"];
datePicker.tintColor=[UIColor whiteColor];
[datePicker setValue:[UIColor whiteColor] forKeyPath:@"textColor"];
timeTextField.delegate=self;
textField1.delegate=self;
textField2.delegate=self;
testField3.delegate=self;
textField4.delegate=self;
textField5.delegate=self;
textField6.delegate=self;
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
//signIn.shouldFetchGoogleUserEmail = YES; // Uncomment to get the user's email
// You previously set kClientId …Run Code Online (Sandbox Code Playgroud) objective-c ×3
ios ×2
xcode ×2
arrays ×1
google-login ×1
google-plus ×1
login ×1
nscalendar ×1
nsdate ×1
nstimezone ×1
swift ×1
timezone ×1