小编The*_*Dev的帖子

CLGeocoder和向后兼容性

我有一个简单的问题.

MKReverseCoder已弃用,自iOS 5起无效.我们必须使用CLGeocoder.但是,iOS4下有很多人.新应用如何与iOS4和iOS5配合使用进行地理编码?

谢谢!

iphone backwards-compatibility reverse-geocoding ios5

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

ALAsset上的defaultRepresentation fullScreenImage不会返回全屏图像

在我的应用程序中,我将图像保存为专辑作为资产.我也想检索它们并全屏显示它们.我使用以下代码:

ALAsset *lastPicture = [scrollArray objectAtIndex:iAsset]; 

ALAssetRepresentation *defaultRep = [lastPicture defaultRepresentation];

UIImage *image = [UIImage imageWithCGImage:[defaultRep fullScreenImage] 
                                          scale:[defaultRep scale] orientation:
    (UIImageOrientation)[defaultRep orientation]];
Run Code Online (Sandbox Code Playgroud)

问题是返回的图像是.我在ALAssetRepresentation参考文献中读到,当图像不适合时,它返回nil.

我把这个图像放到UIImageView了iPad屏幕的大小.我想知道你是否可以帮我解决这个问题?

先感谢您.

objective-c uiimageview ios alasset

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

如何在iPhone中制作无限滚动视图?

我有一个scrollview宽度88 5个的图像视图.

我希望scrollview滚动到每个图像视图(不分页)

我想在iPhone中制作无限滚动视图,这意味着当它滚动到最后一个项目时,它将显示它旁边的第一个项目.

我一直在尝试偏移,但是当它通过偏移移动时停止,我也使用了苹果街道滚动器,它不允许我停止中心的每个元素(就像Picker视图一样).

iphone objective-c ios ios5

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

如何创建像应用程序的viber?

是否有关于使用ipad和iphone等应用程序的教程?是否有任何api或教程应用程序来了解voip或wifi配置发短信和从iphone或ipad拨打电话也从3G for ipad2提前感谢

iphone voip

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

ios 6:使用自动布局约束垂直居中UILabel

UILabel有时候想要在一个单元格中垂直居中.这必须以编程方式完成.我已经尝试添加以下约束来居中它(locName是UILabel):

[cell addConstraint:[NSLayoutConstraint constraintWithItem:cell
attribute:NSLayoutAttributeCenterY relatedBy:0 toItem:cell.locName 
attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]];
Run Code Online (Sandbox Code Playgroud)

这是我得到的结果:

在此输入图像描述

看起来它的中心位置,但也许改变了它的高度UILabel

这是IB中的视图控制器:

在此输入图像描述

如何以编程方式实现垂直居中?

iphone centering ios autolayout ios6

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

Objective-C:关联对象行为

是否OBJC_ASSOCIATION_RETAIN_NONATOMIC在的关联对象行为Objective-C运行参考,呼吁release对相关对象引用的旧值赋给和保留新的前值?

associative objective-c objective-c-runtime

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

导航栏背景图像太大了

我正在尝试使用setBackgroundImage: forBarMetrics:我的设置方法更改导航栏的背景图像.

问题是图像不适合条形,看起来像图像拉伸至少是原始尺寸的两倍...

图像尺寸为320 x 44 ...

我尝试将图像重命名为@ 2x,但它没有改变一件事......

我尝试将此图像分配给navigationItem.titleView但是视图在边缘被切断了......

是否有人提示如何设置图像以使其不会被拉伸?

UINavigationBar *naviBar = [self.navigationController navigationBar];
UIImage *img = [UIImage imageNamed:@"NavBar02@2x.png"];
[naviBar setBackgroundImage:img forBarMetrics:UIBarMetricsDefault];
Run Code Online (Sandbox Code Playgroud)

提前致谢

xcode uinavigationbar uinavigationcontroller ios

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

Logcat说 - 应用程序可能在其主线程上做了太多工作并且错误消息说 - StringtoReal.invalidReal(string.boolean)行:63

每当我在模拟器中运行我的应用程序时,Logcat说 - 应用程序可能在其主线程上做了太多工作并且错误消息说 - StringtoReal.invalidReal(string.boolean)行:63这里,我试图添加3个textviews的值并使用checbox上的tick显示他们在另一个textview中的总数

10-12 17:23:21.074: W/ActivityThread(700): 
Application com.suvendu.tutorial.cb is waiting for the debugger on port 8100...
10-12 17:23:21.134: I/System.out(700): Sending WAIT chunk
10-12 17:23:21.143: I/dalvikvm(700): Debugger is active
10-12 17:23:21.334: I/System.out(700): Debugger has connected
10-12 17:23:21.334: I/System.out(700): waiting for debugger to settle...
10-12 17:23:21.545: I/System.out(700): waiting for debugger to settle...
10-12 17:23:21.744: I/System.out(700): waiting for debugger to settle...
10-12 17:23:21.943: I/System.out(700): waiting for debugger to settle...
10-12 17:23:22.155: I/System.out(700): waiting for debugger to settle...
10-12 17:23:22.353: I/System.out(700): waiting …
Run Code Online (Sandbox Code Playgroud)

android android-emulator android-logcat

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

textField在UITableView中出现两次

我有我的ageTextField财产TableViewController.我将它添加到第一部分单元格的子视图但我不知道为什么它在另一部分(#3)中向下滚动时显示...

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier];
    }
    // Configure the cell...
    switch (indexPath.section){
        case 0:
        {
            [cell addSubview:self.ageTextField];
        }
        break;
        case 1:
        {
            cell.textLabel.text = [screeningArray objectAtIndex:indexPath.row];
            if (indexPath.row == 0)     //no choice
                cell.accessoryType = self.doneScreening ? UITableViewCellAccessoryNone:UITableViewCellAccessoryCheckmark;
            else                        //yes choice
                cell.accessoryType = self.doneScreening ? UITableViewCellAccessoryCheckmark:UITableViewCellAccessoryNone;
        }
        break;
        case 2:
        {
            cell.textLabel.text = …
Run Code Online (Sandbox Code Playgroud)

uitableview uitextfield

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

如何在iphone中设置NSDictionary中的数组值和键?

这里我使用NSMutableArray存储日期,然后我尝试设置键并在字典中分配ArrayValue但应用程序崩溃了,请帮助我

提前致谢

 Here i tried the code for your reference:

  [DateArray addObject:dateString]; //NSMutablArray 
  NSMutableDictionary *myDictionary =[[NSMutableDictionary alloc]init];         
  [myDictionary setObject:DateArray forKey:@"Date"]; //put array value and set key in NSDictionary.
Run Code Online (Sandbox Code Playgroud)

iphone object nsdictionary nsmutablearray ios

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