小编Ole*_*leg的帖子

ios使用AVFramework捕获图像

我正在使用此代码捕获图像

#pragma mark - image capture

// Create and configure a capture session and start it running
- (void)setupCaptureSession 
{
    NSError *error = nil;

    // Create the session
    AVCaptureSession *session = [[AVCaptureSession alloc] init];

    // Configure the session to produce lower resolution video frames, if your 
    // processing algorithm can cope. We'll specify medium quality for the
    // chosen device.
    session.sessionPreset = AVCaptureSessionPresetMedium;

    // Find a suitable AVCaptureDevice
    AVCaptureDevice *device = [AVCaptureDevice
                           defaultDeviceWithMediaType:AVMediaTypeVideo];

    // Create a device input with the …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c avfoundation ios

41
推荐指数
3
解决办法
3万
查看次数

使用CALayer变换进行变换后,对UIView的边缘进行抗锯齿处理

我有一个UIView使用CALayer变换旋转的对象:

// Create uiview object.
UIImageView *block = [[UIImageView alloc] initWithFrame....]

// Apply rotation.
CATransform3D basicTrans = CATransform3DIdentity;
basicTrans.m34 = 1.0/-distance;
blockImage.layer.transform = CATransform3DRotate(basicTrans, rangle, 1.0f, 0.0f, 0.0f);
Run Code Online (Sandbox Code Playgroud)

旋转后,对象的边缘不会抗锯齿.我需要反他们.请帮帮我.怎么做到呢?

iphone objective-c rotation antialiasing uiview

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

AVCaptureSession指定捕获图像的分辨率和质量obj-c iphone app

嗨我想设置AV捕获会话以使用iphone相机捕获具有特定分辨率(如果可能,具有特定质量)的图像.这是setupping AV会话代码

// Create and configure a capture session and start it running
- (void)setupCaptureSession 
{
    NSError *error = nil;

    // Create the session
    self.captureSession = [[AVCaptureSession alloc] init];

    // Configure the session to produce lower resolution video frames, if your 
    // processing algorithm can cope. We'll specify medium quality for the
    // chosen device.
    captureSession.sessionPreset = AVCaptureSessionPresetMedium;

    // Find a suitable AVCaptureDevice
    NSArray *cameras=[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
    AVCaptureDevice *device;
    if ([UserDefaults camera]==UIImagePickerControllerCameraDeviceFront)
    {
        device =[cameras objectAtIndex:1];
    }
    else …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c avcapture avcapturesession

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

获取iphone objective-c上已安装应用程序的列表

我有一个应用程序需要获取设备上已安装(其他可能是第三方)应用程序的列表.怎么做到呢?或者它可以完成吗?

iphone objective-c uidevice ios

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

UITableView的单元格在不可见时释放

我有一个UITableView.每一行都是带有视频,图像等的重物.当用户滚动此视图时,如何释放不可见行的内存并加载当前可见的行?

iphone objective-c uitableview ios

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

UITableView 延迟加载单元格数据

我需要在 UITableView 中实现某种延迟加载。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    //... some initializations here

    //this is a function that pulls my cell data using helper class
    NSData *cellData=[MyDataClass dataForCellAtIndexPath:indexpath.row];

    //... here I populate pulled data to cell

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

一切都很好,表视图滚动不顺畅,因为dataForCellAtIndexPath方法很慢。所以我需要通过调用此方法来实现将数据惰性填充到单元格中。我期望的结果是表格视图将平滑滚动,但单元格的内容将在绘制单元格后填充一点。请帮助我,该怎么办?

iphone objective-c uitableview

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

ios UISwipeGestureRecognizer计算偏移量

我正在为我的应用程序添加滑动手势识别器

- (void)createGestureRecognizers
{

    //adding swipe up gesture
    UISwipeGestureRecognizer *swipeUpGesture= [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeUpGesture:)];
    [swipeUpGesture setDirection:UISwipeGestureRecognizerDirectionUp];
    [self.view addGestureRecognizer:swipeUpGesture];
    [swipeUpGesture release];
}
Run Code Online (Sandbox Code Playgroud)

以及处理滑动事件的方法:

-(IBAction)handleSwipeUpGesture:(UISwipeGestureRecognizer *)sender
{
    NSLog(@"handleSwipeUpGesture: called");
}
Run Code Online (Sandbox Code Playgroud)

我该如何计算偏移?移动视图?

iphone objective-c uigesturerecognizer ios uiswipegesturerecognizer

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

twitter ios5集成使用自定义登录名和密码进行自动化

我希望我的ios5应用程序发布推文.我正在使用ReyWenderlich教程中的标准代码:

-(void)postOnTwitter:(id)sender
{
    NSLog(@"postOnTwitter: called");
    if ([TWTweetComposeViewController canSendTweet])
    {
        TWTweetComposeViewController *tweetSheet = 
        [[TWTweetComposeViewController alloc] init];
        [tweetSheet setInitialText:@"Tweeting from iOS 5 By Tutorials! :)"];
    [self presentModalViewController:tweetSheet animated:YES];
    }
    else
    {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"You can't send a tweet right now, make sure your device has an internet connection    and you have at least one Twitter account setup" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alertView show];
    };
}
Run Code Online (Sandbox Code Playgroud)

一切都很好,如果我在我的设备上有Twitter帐户,这个代码将工作.但!我需要在我的应用程序的信息屏幕中输入twitter登录名和密码.所以我需要使用我的自定义登录数据执行此操作,而不是通过从twitter帐户中提取的登录数据.对于前者 我需要相同的推文,但登录:123和密码:qwerty.

请帮帮我,怎么办?

iphone twitter objective-c ios ios5

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

测试与facebook集成的应用程序

我想测试我的应用程序的facebook集成.我的应用程序尚未在appstore中发布.我应该如何处理捆绑ID和appstore ID?我应该在那里写什么数据?如果我在appstore中提供我未发布但已注册的应用程序的bundleID和appstore ID,它会工作吗?

iphone facebook objective-c app-store ios

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

在变换objective-c之后设置新帧

我有一个设置新框架到uiview对象的问题.这是我的代码:

UIImageView *blockImage=[[UIImageView alloc] initWithFrame:CGRectMake(0, [y doubleValue], self.view.frame.size.width, 86)];

[blockImage setImage:[UIImage imageNamed:@"mainscreen_block_sample.jpg"]];
[blockImage setBackgroundColor:[UIColor blackColor]];


//setting anchor point
[blockImage.layer setAnchorPoint:CGPointMake(0.5, 1.0)];

//preparing transform
float distance = 500;
CATransform3D basicTrans = CATransform3DIdentity;
basicTrans.m34 = 1.0 / -distance;

//calculating angle
double OF=oldSize/2.0-difference;
double OC=oldSize/2.0;    
double angle= acosf(OF/OC);
angle=angle/2.0;

//transforming
blockImage.layer.transform = CATransform3DRotate(basicTrans, angle, 1.0f, 0.0f, 0.0f);

double newOriginY=[y doubleValue]-difference;
double newFrameHeight=blockImage.frame.size.height;

[blockImage setFrame:CGRectMake(0, newOriginY, blockImage.frame.size.width, newFrameHeight)];

NSLog(@"    blockImage frame y: %g", blockImage.frame.origin.y);
NSLog(@"    blockImage frame height:   %g", blockImage.frame.size.height);

//adding subview
[blocks addObject:blockImage]; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c frame uiview

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

接收滚动方向,电源ios

我有一个视图,如果用户滚动它会更改.我需要一些东西来读取用户的滚动数据(方向,力等)UITableView.如果用户触摸屏幕并将手指移动到向上视图,则需要接收滚动数据以调用重绘方法.如何接收滚动数据?

iphone objective-c uitableview uiview ios

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

开发iphone 3gs和iphone 4的区别

我已经开发了原始iPhone,3G和3GS的应用程序,现在我需要为iPhone开发应用程序4.开发iPhone 3GS应用程序和iPhone 4有什么区别?

iphone objective-c iphone-3gs iphone-4

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