小编tra*_*uan的帖子

如何使用appledoc生成类似Apple的文档

我正在阅读有关如何在此处生成类似Apple的HTML文档的文章.我的问题是命令行的用途.我们如何组合命令行和appledoc xcode项目来生成HTML.

xcode appledoc

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

iOS功能说"CGRectMinY"应该是左下角

根据Apple文档,

CGRectMinY(CGRect)rect返回指定矩形右上角的y坐标

它不应该是矩形的左下角吗?因为我认为Y轴是向下的.

ios cgrect

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

不要在初始化方法和dealloc中使用访问器方法

我正在阅读有关内存管理的一些内容,他们不建议在初始化方法中使用访问器方法.

问题:为什么我们不应该在initilizer方法中使用访问器方法

我正在stackoverflow和其他网站上搜索有关此问题的引用.但是,我并不是很困惑.

任何人都可以就这个问题向我提出建议,或者你是否可以向我提出一个例子或一个好的参考资料,以便我可以自己去做.谢谢

iphone memory-management objective-c

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

获取[NSURL cachePolicy]:在下载图像期间发送到实例的无法识别的选择器AFNetworking

我的目的是尝试通过成功的块获取下载图像的大小,如下所示:

[imageView setImageWithURLRequest:[NSURL URLWithString:((ObjectA*)obj[indexPath.row]).imageUrl]
                placeholderImage:nil
                         success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
                            CGFloat imageHeight = image.size.height;
                            CGFloat imageWidth = image.size.width;
                            NSLog(@"width of image is %f",imageWidth);
                            NSLog(@"height of image is %f",imageHeight);
                        }
                        failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
                            ;
                        }  ];
Run Code Online (Sandbox Code Playgroud)

但是,我遇到了崩溃,显示如下错误:

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURL cachePolicy]: unrecognized selector sent to instance 0x1edb9e70'
Run Code Online (Sandbox Code Playgroud)

有谁知道这个错误的原因.如果您有任何想法,请帮忙

objective-c ios afnetworking

7
推荐指数
2
解决办法
2122
查看次数

总是得到Crashlytics在做git status,objective c,git时被修改

我正在使用Crashlytics框架进行崩溃报告.从xcode运行项目并执行后git status,我总是收到如下消息

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   Crashlytics.framework/Versions/A/Crashlytics
    modified:   Crashlytics.framework/Versions/A/Resources/Info.plist
    modified:   Crashlytics.framework/run
Run Code Online (Sandbox Code Playgroud)

请告诉我如何从Crashlytics中删除这些修改过的文件


@Abizem:我为.gitignore所做的是跟随

.DS_Store
#backups
*.swp
*~.nib
*~.xib
*~

*.zip
*.gz

build
*.[oa]
DerivedData
VERSION-FILE
Crashlytics.framework/
#XCode
*.pbxuser
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
project.xcworkspace/
xcuserdata/
Run Code Online (Sandbox Code Playgroud)

但它仍然无效.

git iphone objective-c

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

使用Notification,iphone传递数据

可能重复:
将NSString变量传递给具有NSNotification的其他类

我的问题是:我们是否可以使用postNotificationName和iphone中通知类的addObserver将数据从一个视图控制器传递到另一个视图控制器

iphone ios

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

为视图应用阴影会使我的文本模糊

我的集合视图单元结构如下所述

在此输入图像描述

因为cellItemAtIndex,我做了以下

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    UICollectionViewCell    *cell   =   [self.collectionView dequeueReusableCellWithReuseIdentifier:@"reusedCell" forIndexPath:indexPath];


    // Set shadow around the cell
    [cell.layer setMasksToBounds    :NO ];
    [cell.layer setShadowColor      :[[UIColor whiteColor ] CGColor ] ];// shadow's color
    [cell.layer setShadowOpacity    :0.65 ];                            // set the opacty
    [cell.layer setShadowRadius     :5.0 ];                             // set the blur radius
    [cell.layer setShadowOffset     :CGSizeMake( 0 , 0 ) ];             // set shadow position
    [cell.layer setShouldRasterize  :YES ];                             // tell the cell to render it’s CALayer as a …
Run Code Online (Sandbox Code Playgroud)

objective-c calayer ios uicollectionview

6
推荐指数
2
解决办法
1221
查看次数

是什么构成了NSCharacterSet中的"标记"类别?

我正在读书NSCharacterSet.任何人都可以告诉我(如果可能的话,有一个例子)"Marks"类别中有哪些字符?

cocoa nscharacterset

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

何时调用layoutSubviews方法?

我正在阅读一个提到以下方法的教程:

-(void)layoutSubviews
Run Code Online (Sandbox Code Playgroud)

位于CustomerCell.m

在应用程序执行期间何时调用此方法?是自动调用吗?我没有看到任何回调.

iphone ios

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

获得autolayout,NSAutoLayout,Objective C的警告

我的目标:将指示器(垂直和水平)居中到视图中的按钮

我在做的是:

[self.logInButton addConstraint:[NSLayoutConstraint constraintWithItem:spinner1
                                                             attribute:NSLayoutAttributeCenterY
                                                             relatedBy:NSLayoutRelationEqual
                                                                toItem:self.logInButton
                                                             attribute:NSLayoutAttributeCenterY
                                                            multiplier:1.0
                                                              constant:0]];
[self.logInButton addConstraint:[NSLayoutConstraint constraintWithItem:spinner1
                                                             attribute:NSLayoutAttributeCenterX
                                                             relatedBy:NSLayoutRelationEqual
                                                                toItem:self.logInButton
                                                             attribute:NSLayoutAttributeCenterX
                                                            multiplier:1.0
                                                              constant:0]];
self.logInButton addSubView:spinner
Run Code Online (Sandbox Code Playgroud)

但是,我在下面收到警告

The view hierarchy is not prepared for the constraint: <NSLayoutConstraint:0x17e19390 UIActivityIndicatorView:0x17d035d0.centerY == UIButton:0x17df4430.centerY>
    When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView _viewHierarchyUnpreparedForConstraint:] to debug.
2013-06-12 17:37:19.610 FlipGive[366:60b] The …
Run Code Online (Sandbox Code Playgroud)

objective-c ios autolayout nslayoutconstraint

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