小编PAn*_*tri的帖子

如何获得全时区名称ios

我们如何在iOS中获得全时区名称, 如印度标准时间而不是IST.

NSTimezone *timeZone=[NSTimeZone localTimeZone];
Run Code Online (Sandbox Code Playgroud)

我正在获得GMT,但我希望它像完整的形式字符串

xcode timezone objective-c nstimezone ios

8
推荐指数
2
解决办法
1万
查看次数

面对谷歌加登录IOS的问题

我在整合谷歌加日志时遇到问题我收到以下错误:

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)

xcode objective-c google-login

7
推荐指数
1
解决办法
4283
查看次数

如何在日期ios数组中获取所有星期日

我只想要一个以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)

arrays nsdate nscalendar ios swift

4
推荐指数
1
解决办法
1368
查看次数

在ios中使用google plus进行签名时遇到错误

我在实施谷歌+登录时遇到以下错误.

    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)

login objective-c unrecognized-selector google-plus

1
推荐指数
1
解决办法
1450
查看次数