小编Spi*_*ire的帖子

将设备令牌发送到服务器

我已经阅读了很多这方面的教程,我只是想知道这是否是正确的方法

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
    NSLog(@"My token is: %@", deviceToken);

    NSString* newToken = [deviceToken description];

    newToken = [newToken stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
    newToken = [newToken stringByReplacingOccurrencesOfString:@" " withString:@""]; 


    NSString *urlString = [NSString stringWithFormat:@"http://myhost.com./filecreate.php?token=%@",newToken];

    NSURL *url = [[NSURL alloc] initWithString:urlString];

    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];

    NSData *urlData;
    NSURLResponse *response;
    urlData = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:nil];

}
Run Code Online (Sandbox Code Playgroud)

任何建议都受到欢迎.

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{

    const char* data = [deviceToken bytes];
    NSMutableString* token = [NSMutableString string];

    for (int i = 0; i < [deviceToken length]; i++) { …
Run Code Online (Sandbox Code Playgroud)

iphone token devicetoken

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

在UITableView中自定义删除按钮

我有"滑动删除"的功能TableViewCell.我想自定义删除按钮.在此输入图像描述

这可能,以及如何访问删除按钮?

iphone xcode customization uibutton

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

删除新版本的占位符itunes connect

如何删除iTunes Connect上的版本占位符?我在错误的应用程序上上传了一个版本,当我意识到我删除了二进制文件但我从未想过这个 - 我还可以删除占位符吗? - 因为尚未为此应用程序开发更新.

图片用于解释

在此输入图像描述

binary itunesconnect version duplicate-removal ios

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

UIPickerView在文本字段编辑时有多个来源

到目前为止我所拥有的是什么

@synthesize txtCountry,txtState;
int flgTextField;
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { 
    [pickerView reloadAllComponents];

    // Make a new view, or do what you want here
    if(textField == txtCountry || textField == txtState){
        flgTextField = textField.tag;
        [UIView beginAnimations:nil context:NULL];
        //[pvState setFrame:CGRectMake(0.0f, 199.0f, 320.0f, 216.0f)];
        [UIView commitAnimations];  
        return NO;
    }
    else {
        return YES;
    }

}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView;
{
    return 1;
}

- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {

    if(flgTextField==1){
        return [arryCountry count];
    }
    else {
        return [arryState count];
    }

}

- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row …
Run Code Online (Sandbox Code Playgroud)

uipickerview uipicker ios4

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

没有按钮的UIAlertView以及如何关闭它

我在警报视图中有活动指示器,直到我的应用程序获得服务器响应时才会使用.应用程序将数据发送到服务器,警报视图显示,当服务器向我发送响应时如何关闭它.这是来自我的警报的代码

        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Canceling reservation" message:@"please wait" delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
        [alert show];

        UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

        // Adjust the indicator to place at the bottom of the dialog window.
        indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height-50);
        [indicator startAnimating];
        [alert addSubview:indicator];
Run Code Online (Sandbox Code Playgroud)

iphone xcode uialertview

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

用户与蓝牙设备配对的权限

我正在阅读" 执行常见的中心角色任务",它有关于如何发现外围设备以及如何连接到外围设备的信息,但我似乎无法找到如何检查用户是否在弹出窗口中选择取消或配对,因为弹出窗口出现时我打电话[myCentralManager connectPeripheral:peripheral options:nil];.如果用户单击"对"弹出窗口中的"取消",我希望连接到(或断开连接)外围设备.我可以通过其他方式调用配对弹出窗口吗?

connect user-permissions ios core-bluetooth pairing

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