小编Mas*_*oke的帖子

iOS6中的UIPageViewController

在iOS6中的方法viewControllerAfterViewControllerviewControllerBeforeViewController如果我返回nil(当我在第一页或最后一页时阻止页面导航)应用程序崩溃时出现此异常:

'提供的视图控制器数量(0)与请求的转换所需的数量(1)不匹配

在iOS5中,一切都很好.

iphone objective-c ios uipageviewcontroller

20
推荐指数
3
解决办法
8924
查看次数

如何在ios中动态创建中重复图像

任何人都可以帮我,我希望水平多次添加相同的图像,高度和宽度相同.重要的是我正在动态创建图像视图我想为所有图像使用相同的图像视图!这是图像在此输入图像描述 我想像这样横向制作 在此输入图像描述 但是这样只需要一行.

iphone objective-c uiimageview ios dynamic-image-generation

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

Apple拒绝任何访问UDID的应用程序,不支持Retina,iPhone 5显示器?

来自TNW的消息,其中说:"Starting May 1, the App Store will no longer accept new apps or app updates that access UDIDs. Please update your apps and servers to associate users with the Vendor or Advertising identifiers introduced in iOS 6."

我的问题很简单,那些在5月1日之前发布的OLDER APPS如何访问UDID?此外,如果该应用程序不支持视网膜显示怎么办?他们是否从App Store中删除了它?如果是这样,我害怕听到YES.

appstore-approval ios4 ios

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

即使未启用推送通知,是否可以获取设备令牌?

我需要获取设备令牌,因为我将它用于自动登录.但是,如果用户在他/她的设备中不允许来自我的应用程序的推送通知,我将无法获得设备令牌.我想知道即使他/她没有启用APN,是否可以获取并存储用户的设备令牌.谢谢.

iphone objective-c devicetoken ios

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

在scrollview iphone周围的阴影或边框

我想在uiscrollview周围绘制一个边框/阴影,我知道我可以通过额外的视图或滚动视图到达那里但不喜欢处理缺点但我听说应该有可能直接绘制一个边框滚动视图这就是我想要的.

我对iphone开发很安静,任何答案都会有所帮助.

iphone border shadow scrollview uiscrollview

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

如何获取Google云端硬盘文件的公开网址?

我正在尝试获取一个可以在任何地方访问流媒体的公共URL.我可以得到downloadUrl,但对于exportLinksnull值的结果也一样.这个代码如下,但我不知道我的问题是什么.

NSError *error;
NSString *exportURLStr;  
GTLDriveFile *file = [driveFiles objectAtIndex:indexPath.row];
exportURLStr = [NSString stringWithFormat:@"%@",file.exportLinks];  
NSURL *url = [NSURL URLWithString:exportURLStr];
NSString *temp1= [NSString stringWithFormat:@"%@",url];

// NSLog of temp1 is Null
// I tried with file.WebContentLink  but getting 404 Error
Run Code Online (Sandbox Code Playgroud)

这只是代码片段,所以如果我需要表现出更多的,只问.

iphone objective-c ios google-drive-api

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

内存泄漏_ContiguousArrayStorage?

我是swift的新手.我正在运行内存泄漏的仪器工具.我发现了泄漏 "_ContiguousArrayStorage<String>"

屏幕截图的仪器

它导致下面部分代码

let myData = NSData(data: request.value!)
let buffer = Array(UnsafeBufferPointer(start: UnsafePointer<CUnsignedChar>(myData.bytes), count: myData.length))
Run Code Online (Sandbox Code Playgroud)

代码泄漏线的屏幕截图

谁能帮我吗?.

上面的代码有什么问题吗?

编辑:添加更多代码.

let myData = NSData(data: request.value!)
var buffer = Array(UnsafeBufferPointer(start: UnsafePointer<CUnsignedChar>(myData.bytes), count: myData.length))

let responseArray: [CUnsignedChar] = Array(buffer)

let responseValue = BluetoothCommunicationManager.sharedInstance.parseData(responseArray,length: myData.length).0

let responseName = BluetoothCommunicationManager.sharedInstance.parseData(responseArray,length: myData.length).1

NSNotificationCenter.defaultCenter().postNotificationName(responseName, object: request, userInfo: responseValue as [NSObject : AnyObject])
Run Code Online (Sandbox Code Playgroud)

singleton类的parseData方法返回NSMutableDictionary.

func parseData(responseData: [CUnsignedChar]) -> NSMutableDictionary
{
        let infoDictionary = NSMutableDictionary()
        let subIndexValue = Int(responseData[5])
        infoDictionary.setValue(subIndexValue, forKey: KEY_SUB_INDEX)
        return responseData
}
Run Code Online (Sandbox Code Playgroud)

提前致谢.

iphone xcode memory-leaks ios swift

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

将按钮作为子视图放在UILable/UITextView的最后一个字符旁边

我已经使用了四个UITextviews来放置每个段落.现在我想为每个UITextview添加一个UIButton作为子视图.

我意识到用框架创建子视图CGRectMake(textview.frame.width-50,textview.frame.height-20,50,20)不是一个理想的解决方案,因为句子可能在任何地方结束,我的意思是任何段落的最后一个字符可能在任何地方结束,但它的位置不是常数.

因此,底线是,我想补充UIButtonUITextView,毗邻拉特字.我怎么做?

任何解决方案将不胜感激.:)

iphone objective-c uitextview ios

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

如何在iOs中将UITabbarController添加到UIViewController

如何使用TabbarController推送Viewcontroller?在Viewcontroller'XIB中,我创建了UITabbarController.然后我推这个ViewController,但它没有出现UITabbarController.这是我的代码:*Viewcontroller.h:

 @interface StatusViewController : UIViewController<UITabBarControllerDelegate>
{
    IBOutlet UITabBarController *tabBarController;

    IBOutlet UIButton *UploadButton;
    IBOutlet UIButton *ConvertorButton;
    IBOutlet UIButton *CompletedButton;
}
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@end
Run Code Online (Sandbox Code Playgroud)

*Viewcontroller.m:

@implementation StatusViewController
@synthesize tabBarController ;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization

    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self createTabView];
}
-(void)createTabView
{
    ....

    ....
    [ConvertorButton addSubview:Label3];

    [CompletedButton …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitabbarcontroller uiviewcontroller ios

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

- [__ NSArrayM insertObject:atIndex:]:object不能为nil

我收到错误对象不能为零.我正在使用Web服务,当我使用循环解析它崩溃并发送输出-[__NSArrayM insertObject:atIndex:]:对象不能为nil作为错误,因为我在空白值上有空值NSMutableArray我正在尝试解析.

我试着修复

(1)if([Array containsObject:[NSNull null]])
(2)if([Array objectAtIndex:0
(3)if([Array objectAtIndex:counter] == 0
方法.

我的代码是,

if([[[node childAtIndex:counter] name] isEqualToString:@"Phone"]){

                if([phoneno containsObject:[NSNull null]]){
                    phone.text = @"-";
                }
                else{
                    NSString *str = [[node childAtIndex:counter] stringValue];
                    [phoneno addObject:str];
                    NSString *myString = [phoneno componentsJoinedByString:@","];
                    [phone setText:myString];
                    phone.text = [NSString stringWithFormat:@"%@",myString];
                }
            }
Run Code Online (Sandbox Code Playgroud)

在这里,phoneno是NSMutableArray

iphone xcode objective-c ios

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