小编kir*_*iri的帖子

如何在iPhone应用程序中禁用后退按钮

在我的项目中,当我们选择项目时,我在下一个控制器中显示详细信息,但我已经使用Libxml获取详细信息,我必须在加载页面时禁用后退按钮,如何可能,请帮助我

谢谢

iphone iphone-sdk-3.0

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

在[NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil]中泄漏泄漏

我在 returnData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil];

以下是我正在使用的代码

    NSString* curl = @"https://Some Url?ticket=";
curl = [curl stringByAppendingString:self.ticket];
curl = [curl stringByAppendingString:@"&apikey=hjgajgfjaghjf&XMLString="];
curl = [curl stringByAppendingString:stringB];
curl = [curl stringByReplacingOccurrencesOfString:@"\n" withString:@""];
NSURL *finalURL = [NSURL URLWithString:curl];

    NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:finalURL cachePolicy:NSURLRequestReloadIgnoringCacheData   timeoutInterval:10]; 
     [theRequest setHTTPMethod:@"POST"];

   NSData* returnData= [NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil];
Run Code Online (Sandbox Code Playgroud)

任何一个可以告诉我为什么我在得到泄漏returndata我relased的returndata并尝试过,但我仍得到.

谢谢

memory-leaks objective-c iphone-sdk-3.0 nsurlrequest

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

在RestKit 0.20中映射对象时出错

我正在研究Rest Kit 0.2o,我正在使用一些来自Web的Json格式的示例URL,响应如下.我正在使用对象映射.我按照以下链接作为参考" https://github.com/RestKit/RestKit/wiki/Object-Mapping "我使用链接中给出的几乎相同的响应.

{
  "geonames": [
    {
      "fcodeName":"capital of a political entity",
      "toponymName":"Mexico City",
      "countrycode":"MX",
      "fcl":"P",
      "fclName":"city, village,...",
      "name":"Mexiko-Stadt",
      "wikipedia":"en.wikipedia.org/wiki/Mexico_City",
      "lng":-99.12766456604,
      "fcode":"PPLC",
      "geonameId":3530597,
      "lat":19.428472427036,
      "population":12294193
    },
    {
      "fcodeName":"capital of a political entity",
      "toponymName":"Manila",
      "countrycode":"PH",
      "fcl":"P",
      "fclName":"city,village,...",
      "name":"Manila",
      "wikipedia":"en.wikipedia.org/wiki/Manila",
      "lng":120.9822,
      "fcode":"PPLC",
      "geonameId":1701668,
      "lat":14.6042,
      "population":10444527
    }]
}
Run Code Online (Sandbox Code Playgroud)

下面是代码

RKObjectMapping *newsMapping = [RKObjectMapping mappingForClass:[News class]];
[newsMapping addAttributeMappingsFromDictionary:@{
     @"fcodeName": @"fcodeName",
     @"toponymName": @"toponymName",
     @"countrycode": @"countrycode",
     @"fcl": @"fcl",
     @"fclName": @"fclName",
     @"name":@"name",
     @"wikipedia":@"wikipedia",
     @"lng":@"lng",
     @"fcode":@"fcode",
     @"geonameId":@"geonameId",
     @"lat":@"lat",
     @"population":@"population",
}];

RKResponseDescriptor* responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:newsMapping
                                                                                   pathPattern:nil …
Run Code Online (Sandbox Code Playgroud)

ios restkit-0.20

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

删除ArrayList中的重复对象

所有,

我有一个对象

public class Device {

     public String getUserId() {
        return userId;
    }
    public String getDeviceId() {
        return deviceId;
    }

}
Run Code Online (Sandbox Code Playgroud)

我得到了所有的价值清单

     List<Device> uList = getList();
Run Code Online (Sandbox Code Playgroud)

在列表中,我有一个基于userId的重复值现在我要获取“唯一”列表,该列表将删除userId的重复项

我要如何实现它,我是Java的新手

java arraylist comparator

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

为iPhone SDK 3.2准备通用应用程序

我正在开发一个通用应用程序,我使用UISplitViewController做iPad应用程序.我遵循通用应用程序指南,即我将基本SDK保持为3.2,iPhone目标OS广告iPhone OS 3.1.3,Taget设备作为iPhone/iPad.我为UISplitViewController和UIPopOverController使用了"为新符号添加运行时检查".

Class splitVCClass = NSClassFromString(@"UISplitViewController");

if (splitVC)

{

   UISplitViewController* mySplitViewController = [[splitVCClass alloc] init];

   // Configure the split view controller.

}
Run Code Online (Sandbox Code Playgroud)

我在.m文件中使用了这个,我也在.h文件中声明了UIPopOverController

"dyld:未找到符号:_OBJC_CLASS _ $ _ UIPopoverController参考自:/var/mobile/Applications/9E0CE75F-D2A9-4132-AE56-1780928BCF21/UniversalTask​​s.app/UniversalTask​​s预期:/System/Library/Frameworks/UIKit.framework/UIKit在/var/mobile/Applications/9E0CE75F-D2A9-4132-AE56-1780928BCF21/UniversalTask​​s.app/UniversalTask​​s"

我必须要做的任何人都可以帮助我

iphone universal

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

从String转换日期

在我的代码中,我从服务器获取一个字符串,值为"06-27-2014",然后我想转换为其他日期格式,但我得到的最终结果是非常不同的.这是我正在使用的代码.

        NSString* dateVal = @"06-27-2014";

        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setDateFormat:@"mm-dd-yyyy"];
        NSTimeZone *gmtZone = [NSTimeZone systemTimeZone];
        [dateFormatter setTimeZone:gmtZone];

        NSDate* aDate = [dateFormatter dateFromString:**dateVal**];
           I am getting the aDate as **2014-01-26 18:36:00 +0000** here the month is completely changing to first month from 6th. 

        NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
        [dateFormat setDateStyle:NSDateFormatterShortStyle];

        NSDate *theDateSelected =aDate;

        NSString *theDate = [dateFormat stringFromDate:theDateSelected];
Run Code Online (Sandbox Code Playgroud)

我得到的最后日期是2014年1月27日,这完全不同任何人都可以建议正确的日期格式.

objective-c nsdate nsdateformatter ios

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