小编Fir*_*ous的帖子

如何在UIViewController中与UITableView进行交互?

我沉迷于在storyboard中使用TableViewController,它的类直接继承自UITableViewController,其功能如下:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
Run Code Online (Sandbox Code Playgroud)

默认情况下,你只需要实现它们.但是现在我在storyboard中使用ViewController(继承自UIViewController),并通过拖放将Object库中的UITableView控件用于视图控制器.显然,我将附加到我的故事板ViewController的类将继承自UIViewController.现在,我如何与视图控制器中UITableView控件中的表格单元格进行交互.想要实现上面的相同行功能.

uitableview uiviewcontroller ios ios5

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

如何Facebook风格过渡

想要实现类似于在facebook和许多其他应用程序中使用的视图控制器转换,附加快照.它需要使用CoreAnimation框架还是可以在工具包中使用?

在此输入图像描述

core-animation uiviewcontroller uiviewanimationtransition ios ios5

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

在voip通话期间以编程方式启用扬声器

我想在ios应用程序的voip调用期间以编程方式启用扬声器.有可能吗?怎么样?

voip core-audio twilio ios ios5

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

3D旋转中的透视问题

我希望实现这样的目标:

在此输入图像描述

这是我的视图控制器的快照

我试过的代码是这样的:

    UIWindow *window = [[UIApplication sharedApplication] keyWindow];

    // Take a snapshot
    //
    _screenshotView = [[UIImageView alloc] initWithFrame:CGRectNull];

    _screenshotView.image = [self getScreenSnapshot];

    _screenshotView.frame = CGRectMake(-160, -284, _screenshotView.image.size.width, _screenshotView.image.size.height);
    _screenshotView.userInteractionEnabled = YES;
    _screenshotView.layer.anchorPoint = CGPointMake(0, 0);

    _originalSize = _screenshotView.frame.size;

    [window addSubview:_screenshotView];

    [self minimizeFromRect:CGRectMake(0, 0, _originalSize.width, _originalSize.height)];


- (void)minimizeFromRect:(CGRect)rect
{
    UIWindow *window = [[UIApplication sharedApplication] keyWindow];
    CGFloat m = 0.7;
    CGFloat newWidth = _originalSize.width * m;
    CGFloat newHeight = _originalSize.height * m;

    [CATransaction begin];
    [CATransaction setValue:[NSNumber numberWithFloat:0.6] forKey:kCATransactionAnimationDuration];
    [self addAnimation:@"position.x" view:_screenshotView …
Run Code Online (Sandbox Code Playgroud)

iphone core-animation catransform3d ios ios6

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

在git提取了一些文件之后得到'Aborting'

我使用git进行版本控制,我试图从服务器中提取代码更改.当我运行'git pull origin master'时,在拉出一些文件后它显示我'Aborting'.这是怎么回事,我过去3个月一直在研究git但是没有发生过这样的事情.有什么东西腐败了吗?

因为没有拉动所有文件,也无法'git push'

就像是:

 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
    sites/all/modules/examples/form_example/form_example_tutorial.inc
    sites/all/modules/examples/form_example/form_example_wizard.inc
    sites/all/modules/examples/image_example/image_example.info
    sites/all/modules/examples/image_example/image_example.install
    sites/all/modules/examples/image_example/image_example.module
    sites/all/modules/examples/image_example/image_example.pages.inc
    sites/all/modules/examples/image_example/image_example.test
    sites/all/modules/examples/js_example/accordion.tpl.php
    sites/all/modules/examples/js_example/css/jsweights.css
    sites/all/modules/examples/js_example/js/ajaxy.js
    sites/all/modules/examples/js_example/js/black.js
    sites/all/modules/examples/js_example/js/blue.js
    sites/all/modules/examples/js_example/js/brown.js
    sites/all/modules/examples/js_example/js/green.js
    sites/all/modules/examples/js_example/js/purple.js
    sites/all/modules/examples/js_example/js/red.js
    sites/all/modules/examples/js_example/js_example.info
    sites/all/modules/examples/js_example/js_example.module
    sites/all/modules/examples/menu_example/menu_example.info
    sites/all/modules/examples/menu_example/menu_example.module
    sites/all/modules/examples/menu_example/menu_example.tes
Aborting
Run Code Online (Sandbox Code Playgroud)

git git-pull

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

隐式转换失去整数精度:'long long'到'NSInteger'(又名'int')

我试图将类型为"long long"的变量赋值给NSUInteger类型,这样做的正确方法是什么?

我的代码行:

expectedSize = response.expectedContentLength > 0 ? response.expectedContentLength : 0;
Run Code Online (Sandbox Code Playgroud)

其中expectedSizeNSUInteger类型,返回类型为response.expectedContentLength' long long'.变量response属于类型NSURLResponse.

显示的编译错误是:

语义问题:隐式转换失去整数精度:'long long'到'NSUInteger'(又名'unsigned int')

nsuinteger ios ios5 xcode4.2 long-integer

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

在 iOS 应用程序中以编程方式检测 safari 弹出窗口阻止设置

有没有办法让我的 iPhone 应用程序知道 Safari 弹出窗口阻止设置是否已启用?或者有没有办法提示用户启用 iphone safari 浏览器的弹出窗口?

iphone safari mobile-safari ios

5
推荐指数
0
解决办法
1171
查看次数

查找元素并设置值

我有一个带有 id 的 div 元素hover-1,在 div 中我有一个隐藏的表单元素,text_page_title在层次结构中具有类名。我在一个变量中动态地获得了父 div 元素 id,现在我想找到具有类名的隐藏元素text_page_title并将其值设置为 'foo'

结构是这样的:

<div id="hover-1">
<input type="hidden" class="text_page_title">
</div>
<div id="hover-2">
<input type="hidden" class="text_page_title">
</div>
Run Code Online (Sandbox Code Playgroud)

我正在尝试这样做:

$($parentId).find('input.text_page_title').val('foo');
Run Code Online (Sandbox Code Playgroud)

但它不起作用,我错过了什么?

jquery

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

客观C中的^是什么意思?

Objective C中的^字符是什么意思?如下面的代码

TWTweetComposeViewControllerCompletionHandler 
    completionHandler =
    ^(TWTweetComposeViewControllerResult result) {
        switch (result)
        {
            ...
        }
        [self dismissModalViewControllerAnimated:YES];
    };
Run Code Online (Sandbox Code Playgroud)

objective-c

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

想要从两个类扩展PHP类,其中一个类是抽象的

我可以从两个类扩展PHP类,其中一个是抽象的而另一个不是?喜欢:

class customer extends SomeControllerClass implements SomeAbstractClass {
...
}
Run Code Online (Sandbox Code Playgroud)

我要做的是在抽象类中使用常用的函数和逻辑.

php oop inheritance abstract-class multiple-inheritance

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