小编P.J*_*P.J的帖子

NSDateFormatter中"YYYY"和"yyyy"之间的区别

'YYYY'和'yyyy'之间的确切区别是什么?我在这个链接中读到,它说明了这一点

一个常见的错误是使用YYYY.yyyy指定日历年,而YYYY指定ISO年度日历中使用的年份("年度周").在大多数情况下,yyyy和YYYY会产生相同的数字,但它们可能会有所不同.通常,您应该使用日历年.

但是当我尝试使用时

NSString *stringDate = @"Feb 28, 2013 05:30pm";
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"MMM dd, yyyy hh:mma"];
NSDate *date=[dateFormatter dateFromString:stringDate];
NSLog(@"Date 1 : %@",date); //2013-02-28 12:00:00 +0000

NSString *stringDatee = @"Feb 28, 2013 05:30pm";
NSDateFormatter *dateFormatterr = [[NSDateFormatter alloc] init];
[dateFormatterr setDateFormat:@"MMM dd, YYYY hh:mma"];
NSDate *datee=[dateFormatterr dateFromString:stringDatee];
NSLog(@"Date 2 : %@",datee); //2013-01-05 12:00:00 +0000

NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"MMM dd, YYYY hh:mma"];
NSString *dateString = [dateFormat stringFromDate:datee];
NSLog(@"date 3 : …
Run Code Online (Sandbox Code Playgroud)

objective-c nsdate nsdateformatter ios

61
推荐指数
2
解决办法
4万
查看次数

如何在iPhone中Ping或检查特定IP地址的服务器是否可用/已连接

我希望Ping或查找服务器的特定IP地址,如果它在特定时间连接或可用,或者不在我的iPhone应用程序中.

我在互联网上搜索了很多但是找不到任何相关的结果.

请帮助我,因为我是这个领域的新手.

提前致谢.

iphone xcode ip-address ios

25
推荐指数
2
解决办法
5万
查看次数

在滑动手势UITableView上获取单元格索引路径

我正在进行滑动手势UITableView并且想知道我的手指当前进入的单元格的索引路径,即从哪个单元格执行的滑动手势.

我需要indexPath显示所选单元格的信息.

提前致谢..

iphone objective-c uitableview ios swipe-gesture

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

presentViewController不支持iOS 6中的方向

我正在使用此代码

if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
    {
        [self presentViewController:navigationControllerCustom animated:YES completion:nil];
    }
    else
    {
        [self presentModalViewController:navigationControllerCustom animated:YES];
    }
Run Code Online (Sandbox Code Playgroud)

我的应用程序有两个方向纵向和纵向颠倒.此代码适用于iOS 5.1,但方向在iOS 6上不起作用

我也在navigationControllerCustom课上添加了这段代码

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}

-(NSUInteger)supportedInterfaceOrientations
{
    return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
Run Code Online (Sandbox Code Playgroud)

请帮我解决这个问题.

提前致谢.

iphone orientation uinavigationcontroller ios ios6

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

从其他应用打开Facebook应用

有没有办法从我自己的应用程序打开Facebook应用程序?

例如,我正在使用Facebook-api在登录用户墙上发布内容.当我收到回复帖子成功添加后,我想在用户墙上打开Facebook应用程序(如果应用程序安装在设备上),以显示他们的帖子在那里.

iPhone或Android或两者的答案将非常感激.

iphone android facebook

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

在Apple应用商店上传应用程序时收到警告

我是这项技术的新手.

从Application Loaded上传应用程序时,我收到以下警告.

警告说" 该应用程序引用"App Name"实例中的非公共选择器,viewController "

请帮我解决这个警告.

提前致谢!

编辑

图片 :-

在此输入图像描述

编辑: -

我的申请会得到批准吗?

iphone objective-c ios application-loader

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

使用UIPasteboard通过代码[iOS]将.gif图像复制到剪贴板

我想将.gif图像复制到剪贴板,以便用户可以将gif图像从应用程序粘贴到邮件等...

我试过了 :-

NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://fc05.deviantart.net/fs37/f/2008/283/a/b/KaleidoCoils_animated__gif_by_1389AD.gif"]];
UIPasteboard *pasteBoard=[UIPasteboard generalPasteboard];
[pasteBoard setImage:[UIImage imageWithData:data]];
Run Code Online (Sandbox Code Playgroud)

但它的格式为.png而不是.gif.如何将带动画的.gif图像复制到剪贴板,可以在其他应用程序中用作粘贴选项?

应用程序https://itunes.apple.com/us/app/animated-3d-emoji+emoticons/id429348043?mt=8已经这样做了.

请帮我.

提前致谢

iphone objective-c animated-gif uipasteboard ios

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

获取仅绘制特定区域边界的UIImage - PaintView

我已经使用以下方法实现了绘画/绘画:

- (void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event
-(void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event
- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event
Run Code Online (Sandbox Code Playgroud)

现在的问题是,对于任何绘制的线,我想得到那个特定的线/油漆图像.我不想要整个屏幕的图像,只需要绘制线条/绘图的区域/边界.

原因是我想在该行/绘制的绘图上执行平移手势/删除功能.

用户可以绘制多条线,因此需要分别UIImage使用所有这些线.

任何逻辑或代码片段都会非常有用

提前致谢

iphone paint objective-c uiimage ios

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

哪一个更好地使用NSInvocation或NSNotificationCentre或Delegate方法

在整个项目中哪一个更好用于将数据从一个类流向另一个类?

NSInvocation

NSNotificationCentre

delegate 方法

或者我不知道的任何其他方法?

iphone delegates nsinvocation nsnotificationcenter ios

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

如何更新核心数据输入的值

[newVehicle setValue: _txtFieldVehicleNumber.text forKey:@"number"];

[newVehicle setValue: lblFuelType.text forKey:@"fueltype"];

[newVehicle setValue: lblFuelUnit.text forKey:@"fuelunit"];

[newVehicle setValue: lblDistanceUnit.text forKey:@"distanceunit"];
Run Code Online (Sandbox Code Playgroud)

我想更新名为"Vehicle"的核心数据实体,对于该实体,我有几个属性,我想更新其中一些但不是全部,当我从实体中选择特定属性时.所以我该怎么做 ??

attributes entity core-data insert-update ios

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