小编rai*_*lin的帖子

如何取消UIView基于块的动画?

我搜索了很多SO的东西和Apple的参考资料,但仍然无法解决我的问题.

是)我有的:

  1. 屏幕与2 UIImageViews nad连接2 UIButtons
  2. 2种动画:
    2.1.第一个是向上扩展,然后在viewDidLoad 2.2中一个接一个地向下移动每个图像.第二个,当按下按钮(这是自定义按钮,隐藏在每个UIImageView的'内部')时,它会触发相应UIImageView的动画 - 只有一个,而不是两个 - (也可以向上扩展,然后向下).
  3. 当我为iOS4 +写作时,我被告知要使用基于块的动画!

我需要的:

如何取消正在运行的动画?除了最后一个,我设法取消了...:/这是我的代码片段:

[UIImageView animateWithDuration:2.0 
                               delay:0.1 
                             options:UIViewAnimationOptionAllowUserInteraction 
                          animations:^{
        isAnimating = YES;
        self.bigLetter.transform = CGAffineTransformScale(self.bigLetter.transform, 2.0, 2.0);
    } completion:^(BOOL finished){
        if(! finished) return;
        [UIImageView animateWithDuration:2.0 
                                   delay:0.0 
                                 options:UIViewAnimationOptionAllowUserInteraction 
                              animations:^{
            self.bigLetter.transform = CGAffineTransformScale(self.bigLetter.transform, 0.5, 0.5);
        } completion:^(BOOL finished){
            if(! finished) return;
            [UIImageView animateWithDuration:2.0 
                                       delay:0.0 
                                     options:UIViewAnimationOptionAllowUserInteraction 
                                  animations:^{
                self.smallLetter.transform = CGAffineTransformScale(self.smallLetter.transform, 2.0, 2.0);
            } completion:^(BOOL finished){
                if(! finished) return;
                [UIImageView animateWithDuration:2.0 
                                           delay:0.0 
                                         options:UIViewAnimationOptionAllowUserInteraction 
                                      animations:^{
                    self.smallLetter.transform = CGAffineTransformScale(self.smallLetter.transform, 0.5, 0.5);
                }
                                      completion:^(BOOL …
Run Code Online (Sandbox Code Playgroud)

iphone animation uiimageview ios4 ios

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

如何使用AFNetworking 2.0下载图像?

显然没有AFImageRequestOperation,但只有AFImageResponseSerializer坦率地说我没有得到它或者我只是通过AFNetworking网站看起来太长了...用以前的AFNetworking下载图像就像一个魅力.我不想回到旧的AFnetworking,因为我通过新版本做了几乎所有的东西......任何人?

iphone xcode ios afnetworking-2

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

使用AFNetworking 2.0上传图像

我用这个把头撞在墙上.我想UIImage从库中选择并将其上传到服务器,就像可以做到的那样<form action="http://blabla.request.cfm" method="post" enctype="multipart/form-data">.而不是成功我得到了这个错误:

error = Error Domain = NSCocoaErrorDomain Code = 3840"操作无法完成.(Cocoa error 3840.)"(JSON文本不是以数组或对象开头,而是选项允许未设置片段.)UserInfo = 0x145e5d90 {NSDebugDescription = JSON文本不以数组或对象和选项开头,以允许未设置片段.}

我试过这种方式:

-(void)uploadPhoto{
NSString *path = @"http://blabla.request.cfm";
NSData *imageData = UIImageJPEGRepresentation(self.imageView.image, 0.9);
int priv = self.isPrivate ? 1 : 0;
NSDictionary *parameters = @{@"username": self.username, @"password" : self.password, @"private" : @(priv), @"photo" : imageData};
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager POST:path parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
    if(self.imageView.image){
        [formData appendPartWithFileData:imageData name:@"avatar" fileName:@"avatar.jpg" mimeType:@"image/jpeg"];
    }
} success:^(AFHTTPRequestOperation *operation, id responseObject) …
Run Code Online (Sandbox Code Playgroud)

file-upload objective-c uiimageview ios afnetworking-2

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

如何使iOS应用程序名称可本地化?

我正在尝试找到本地化我的应用程序的最简单方法.我正在使用sqlite,所以我基本上只需要切换我的数据库名称.问题是应用程序名称 - 它是否可以从代码本地化,或者我必须为x语言制作x应用程序,因此任何人都将使用他/她的母语应用程序名称?后者似乎已经拒绝了app给我......有人吗?

iphone xcode localization nslocalizedstring ios

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

如何从Personal Apple Developer更改为Enterprise?

我的iOS开发人员许可证将于2月1日到期,我想知道我是否可以切换到企业许可证,或者我应该从一开始就这样做?我希望保留我的Apple ID和应用程序......

iphone-developer-program ios

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

无法在iOS6中设置UITableViewCell的背景颜色?

我开始在模拟器下测试我的应用程序,因为我没有任何iOS 6设备,偶然发现了奇怪的问题.我无法设置UITableViewCell的backgroundColor属性.如果我这样:

cell.contentView.backgroundColor = [UIColor redColor];
Run Code Online (Sandbox Code Playgroud)

它只适用于iOS 6,当我使用它时:

cell.backgroundColor = [UIColor redColor];
Run Code Online (Sandbox Code Playgroud)

或这个

[cell setBackgroundColor:[UIColor redColor]];
Run Code Online (Sandbox Code Playgroud)

它仅适用于iOS7.

当我使用它们cell.contentView并且cell.backgroundColor它适用于iOS时......对于这样一个"简单"的属性,它不应该是一个答案吗?或者也许是一些模拟器错误?

更新:如果它改变了同一个tableview和单元格中的任何内容,我accessoryType既不能通过StoryBoard也不能设置代码......

更新2:由于某种原因设置tableview样式为plain删除了我的所有更改,但分组显示为预期...

objective-c uitableview ios ios-simulator

8
推荐指数
3
解决办法
7630
查看次数

iOS mobileconfig walkarounds

我搜索了很少有关于使用mobileconfig文件通过无线方式配置iPhone的网站,并在某个阶段停留...:/这里是我发现的:http: //cryptopath.wordpress.com/2010/ 01/29/iphone-certificate-flaws / 但这部分超出了我的理解范围

使用openssl smime和Verisign提供的P12,签署包含完整CA链的mobileconfig文件并将其放到公共HTTP服务器上

如果我理解正确,我必须做的是:
1)从Verisign获取证书(基于key.pem得到它和从openssl生成的request.pem)
2)在iPhone配置实用程序中创建.mobileconfig文件(我必须要有)它中的所有设置都已填满,或者只是拥有此文件?)
3)和...这个CA链是什么?

我也在这里找到了东西:http ://www.rootmanager.com/iphone-ota-configuration/iphone-ota-setup-with-signed-mobileconfig.html
在这里,我也坚持使用这种连锁东西......有没有人/知道,最好像我一样的逐步解决方案?;)(最想要的是显然创建整个证书的解决方案,因为后来是相当直接的教程)

profile configuration certificate ota ios

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

UITableView在UIViewController中重新排序单元格 - 重新排序控件未显示

我正在尝试使用2个UITableViewCell类的UITableView(第0部分有一行,第1部分有[self.dataArray count]行).

我试过这些链接:http: //developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/ManageReorderRow/ManageReorderRow.html

UITableView 重新排序控件中的
重新排序控件未显示在表视图中

我已经添加:

    -(void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{   

    // Get the object we are going to move
    Task *task = [[Task alloc] init];
    task = [self.taskArray  objectAtIndex:[destinationIndexPath row]];

    // We will delete and move it to another location so well have to retain it
    //[task retain];

    // Remove it an move it to other place
    [self.taskArray removeObjectAtIndex:[sourceIndexPath row]];
    [self.taskArray insertObject:task atIndex:[destinationIndexPath row]];
}


     // Override to support conditional rearranging of …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios

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

Cocoapods与自定义框架

我想生成一个podspec文件,它有一个自定义框架,一个类和一个第三方框架作为依赖.

单个类通过包含该框架的一个头来引用自定义框架.如果我跑

pod lib lint

出现此错误:

- ERROR | [xcodebuild] /Users/xyz/Documents/iOS/Apps/Sample/Core/Sample.h:10:9: fatal error: 'CustomFramework/Bar.h' file not found

我的podspec文件的相关部分如下所示:

 s.source_files     = 'Core/*' , 'Core/CustomFramework.framework/Headers/*.h'
 s.preserve_paths   = 'Core/CustomFramework.framework/**/*' 
 s.xcconfig         = { 'FRAMEWORK_SEARCH_PATHS' => '"${PODS_ROOT}/Headers"' }
 s.frameworks       = 'CustomFramework'
 s.xcconfig         = { 'OTHER_LDFLAGS' => '-ObjC' , 'LIBRARY_SEARCH_PATHS' =>    '"${PODS_ROOT}/CustomFramework/Headers"'}

 s.dependency 'MapBox', '1.1.0'
Run Code Online (Sandbox Code Playgroud)

单个类继承自MapBox框架的类.

我觉得我想念一些但却无法弄清楚是什么.有什么建议或提示吗?

xcode frameworks ios cocoapods

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

我可以在Objective-C中为自己的弃用添加fix-it吗?

试图找出我是否可以为自己的弃用创建自己的"修复"建议?有可能吗?如果是,那么任何资源都将非常感激!

objective-c deprecated ios

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

应用程序内购买缺少非消耗品选项?

我找到了这个教程,看起来很棒,除了事实,我只有"免费订阅"选项列出,当我进入iTunes Connect并在我的应用程序中点击管理应用内购买时......:/我看不到消耗品或非消耗品选项:(基本上我想要的是,上传免费的应用程序与额外的内容,当通过应用程序内购买,但它是非消费品,而不是下属...任何人?

iphone itunesconnect app-store in-app-purchase ios

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